summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2015-11-25 20:38:17 +0000
committerbdrewery <bdrewery@FreeBSD.org>2015-11-25 20:38:17 +0000
commit2ab2ea6fbd364da7f15014e3f0492082bb27e77d (patch)
tree6548852c01e9b42b9594141d18c95f2cd689c6a5
parentde581115311a750bf33d6235ae4ac8eae762c259 (diff)
downloadFreeBSD-src-2ab2ea6fbd364da7f15014e3f0492082bb27e77d.zip
FreeBSD-src-2ab2ea6fbd364da7f15014e3f0492082bb27e77d.tar.gz
Replace DPSRCS that work fine in SRCS.
This is so that 'make depend' is not a required build step in these files. DPSRCS is overall unneeded. DPSRCS already contains SRCS, so anything which can safely be in SRCS should be. DPSRCS is mostly just a way to generate files that should not be linked into the final PROG/LIB. For headers and grammars it is safe for them to be in SRCS since they will be excluded during linking and installation. The only remaining uses of DPSRCS are for generating .c or .o files that must be built before 'make depend' can run 'mkdep' on the SRCS c files list. A semi-proper example is in tests/sys/kern/acct/Makefile where a checked-in .c file has an #include on a generated .c file. The generated .c file should not be linked into the final PROG though since it is #include'd. The more proper way here is just to build/link it in though without DPSRCS. Another example is in sys/modules/linux/Makefile where a shell script runs to parse a DPSRCS .o file that should not be linked into the module. Beyond those, the need for DPSRCS is largely unneeded, redundant, and forces 'make depend' to be ran. Generally, these Makefiles should avoid the need for DPSRCS and define proper dependencies for their files as well. An example of an improper usage and why this matters is in usr.bin/netstat. nl_defs.h was only in DPSRCS and so was not generated during 'make all', but only during 'make depend'. The files including it lacked proper depenencies on it, which forced running 'make depend' to workaround that bug. The 'make depend' target should mostly be used for incremental build help, not to produce a working build. This specific example was broken in the meta build until r287905 since it does not run 'make depend'. The gnu/lib/libreadline/readline case is fine since bsd.lib.mk has 'OBJS: SRCS:M*.h' when there is no .depend file. Sponsored by: EMC / Isilon Storage Division MFC after: 1 week
-rw-r--r--gnu/lib/libreadline/readline/Makefile3
-rw-r--r--lib/libc/tests/rpc/Makefile2
-rw-r--r--usr.bin/kdump/Makefile3
-rw-r--r--usr.bin/netstat/Makefile3
-rw-r--r--usr.bin/svn/svn/Makefile2
5 files changed, 5 insertions, 8 deletions
diff --git a/gnu/lib/libreadline/readline/Makefile b/gnu/lib/libreadline/readline/Makefile
index 547f190..17c84ae 100644
--- a/gnu/lib/libreadline/readline/Makefile
+++ b/gnu/lib/libreadline/readline/Makefile
@@ -16,9 +16,8 @@ INSTALLED_HEADERS= readline.h chardefs.h keymaps.h history.h tilde.h \
CFLAGS+= -I${.OBJDIR}/..
SRCDIR= ${.CURDIR}/../../../../contrib/libreadline
-beforebuild: ${INSTALLED_HEADERS}
CLEANFILES+= ${INSTALLED_HEADERS}
-DPSRCS+= ${INSTALLED_HEADERS}
+SRCS+= ${INSTALLED_HEADERS}
.for _h in ${INSTALLED_HEADERS}
${_h}: ${SRCDIR}/${_h} .NOMETA
diff --git a/lib/libc/tests/rpc/Makefile b/lib/libc/tests/rpc/Makefile
index e6e58e7..66ff4c6 100644
--- a/lib/libc/tests/rpc/Makefile
+++ b/lib/libc/tests/rpc/Makefile
@@ -16,7 +16,7 @@ h_testbits_xdr.c: ${RPCSRC} h_testbits.h
CLEANFILES+= ${RPCSRC:.x=.h} ${RPCSRC:.x=.c} h_testbits_xdr.c
CFLAGS+= -I${.OBJDIR}
-DPSRCS+= h_testbits.h
+SRCS+= h_testbits.h
LDADD+= -lrpcsvc -lutil
DPADD+= ${LIBRPCSVC} ${LIBUTIL}
diff --git a/usr.bin/kdump/Makefile b/usr.bin/kdump/Makefile
index 6f196ac..5048fdd 100644
--- a/usr.bin/kdump/Makefile
+++ b/usr.bin/kdump/Makefile
@@ -6,8 +6,7 @@
.PATH: ${.CURDIR}/../ktrace
PROG= kdump
-SRCS= kdump_subr.c kdump.c ioctl.c subr.c utrace.c
-DPSRCS= kdump_subr.h
+SRCS= kdump_subr.c kdump_subr.h kdump.c ioctl.c subr.c utrace.c
CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I.
.if ${MK_CASPER} != "no"
diff --git a/usr.bin/netstat/Makefile b/usr.bin/netstat/Makefile
index abfebf4..8bbce90 100644
--- a/usr.bin/netstat/Makefile
+++ b/usr.bin/netstat/Makefile
@@ -6,8 +6,7 @@
PROG= netstat
SRCS= if.c inet.c main.c mbuf.c mroute.c netisr.c nl_symbols.c route.c \
unix.c mroute6.c ipsec.c bpf.c pfkey.c sctp.c \
- flowtable.c
-DPSRCS= nl_defs.h
+ flowtable.c nl_defs.h
nl_symbols.c: nlist_symbols
awk '\
diff --git a/usr.bin/svn/svn/Makefile b/usr.bin/svn/svn/Makefile
index e88dbdf..87d9df1 100644
--- a/usr.bin/svn/svn/Makefile
+++ b/usr.bin/svn/svn/Makefile
@@ -52,7 +52,7 @@ DPADD= ${LIBSVN_CLIENT} ${LIBSVN_WC} ${LIBSVN_RA} ${LIBSVN_RA_LOCAL} \
CLEANFILES+= svnlite.1
.if(defined(ORGANIZATION) && !empty(ORGANIZATION))
-DPSRCS+= freebsd-organization.h
+SRCS+= freebsd-organization.h
CLEANFILES+= freebsd-organization.h
CFLAGS+= -I. -DHAS_ORGANIZATION_NAME
freebsd-organization.h:
OpenPOWER on IntegriCloud