From 6b14fdfa52716ef8cee631be4f08f1219e2bfb4b Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Sat, 17 Jan 2004 18:51:55 +0000 Subject: [PATCH] Guess better the source for object files in case .depend file is missing and there are multiple choices using multiple inference (suffix transformation) rules. This is known to fix compilation of s_log1p.o in lib/msun on i386, as otherwise it attempted to use s_log1p.S as the source (which is marked broken) instead of legal s_log1p.c which is in CFLAGS. The normal case where .depend file exists is not affected. Reviewed by: bde --- share/mk/bsd.dep.mk | 12 ++++++++++++ share/mk/bsd.lib.mk | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/share/mk/bsd.dep.mk b/share/mk/bsd.dep.mk index 228dc89fbe08..aac8337e25c4 100644 --- a/share/mk/bsd.dep.mk +++ b/share/mk/bsd.dep.mk @@ -72,10 +72,19 @@ tags: ${SRCS} .if defined(SRCS) CLEANFILES?= +.if !exists(${.OBJDIR}/${DEPENDFILE}) +.for _S in ${SRCS:N*.[hly]} +${_S:R}.o: ${_S} +.endfor +.endif + .for _LSRC in ${SRCS:M*.l:N*/*} .for _LC in ${_LSRC:R}.c ${_LC}: ${_LSRC} ${LEX} -t ${LFLAGS} ${.ALLSRC} > ${.TARGET} +.if !exists(${.OBJDIR}/${DEPENDFILE}) +${_LC:R}.o: ${_LC} +.endif SRCS:= ${SRCS:S/${_LSRC}/${_LC}/} CLEANFILES+= ${_LC} .endfor @@ -103,6 +112,9 @@ CLEANFILES+= ${_YH} ${_YC}: ${_YSRC} ${YACC} ${YFLAGS} -o ${_YC} ${.ALLSRC} .endif +.if !exists(${.OBJDIR}/${DEPENDFILE}) +${_YC:R}.o: ${_YC} +.endif .endfor .endfor .endif diff --git a/share/mk/bsd.lib.mk b/share/mk/bsd.lib.mk index a13df73b7b2c..3679068ae951 100644 --- a/share/mk/bsd.lib.mk +++ b/share/mk/bsd.lib.mk @@ -255,10 +255,16 @@ lint: ${SRCS:M*.c} .if !exists(${.OBJDIR}/${DEPENDFILE}) .if defined(LIB) && !empty(LIB) ${OBJS} ${STATICOBJS} ${POBJS}: ${SRCS:M*.h} +.for _S in ${SRCS:N*.[hly]} +${_S:R}.po: ${_S} +.endfor .endif .if defined(SHLIB_NAME) || \ defined(INSTALL_PIC_ARCHIVE) && defined(LIB) && !empty(LIB) ${SOBJS}: ${SRCS:M*.h} +.for _S in ${SRCS:N*.[hly]} +${_S:R}.So: ${_S} +.endfor .endif .endif