Add an explicit rule for ${OBJS}: ${DPSRCS}, since <bsd.prog.mk>

doesn't provide that any more, and this Makefile uses the latter
in a non-standard fashion.
Fixes "make" in a clean directory when "make depend" has not been run.

Use DPSRCS rather than hand-crafted rules to achieve the same effect.
This commit is contained in:
lukem 2008-08-04 04:53:22 +00:00
parent 29ae370314
commit d929f5af49

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2007/03/09 04:40:38 matt Exp $
# $NetBSD: Makefile,v 1.3 2008/08/04 04:53:22 lukem Exp $
REQUIRETOOLS= yes
NOLINT= # defined
@ -48,6 +48,16 @@ tconfig.h:
TARGET_CPU_DEFAULT="" \
${HOST_SH} $(GNUHOSTDIST)/gcc/mkconfig.sh tconfig.h
# these aren't necessary but are #include'd
FAKEHEADERS=options.h insn-flags.h insn-constants.h
${FAKEHEADERS}:
${_MKTARGET_CREATE}
touch ${.TARGET}
DPSRCS+= ${FAKEHEADERS}
CLEANFILES+= ${FAKEHEADERS}
${OBJS}: ${DPSRCS}
.include <bsd.prog.mk>
# Override the default .c -> .o rule.
@ -56,14 +66,6 @@ tconfig.h:
${CC} ${CPPFLAGS} ${GCFLAGS} ${CPUFLAGS} -c ${.IMPSRC} -o ${.TARGET}.o
mv ${.TARGET}.o ${.TARGET}
# these aren't necessary but are #include'd
FAKEHEADERS=options.h insn-flags.h insn-constants.h
${FAKEHEADERS}:
${_MKTARGET_CREATE}
touch ${.TARGET}
tm.h ${SRCS}: ${FAKEHEADERS}
CLEANFILES+= ${FAKEHEADERS}
.else
.include <bsd.prog.mk> # do nothing