freebsd-dev/usr.bin/kdump/Makefile

58 lines
1.5 KiB
Makefile
Raw Normal View History

1994-05-27 12:33:43 +00:00
# @(#)Makefile 8.1 (Berkeley) 6/6/93
# $FreeBSD$
1994-05-27 12:33:43 +00:00
.include <src.opts.mk>
.PATH: ${.CURDIR}/../ktrace
2002-06-21 10:21:21 +00:00
PROG= kdump
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
2015-11-25 20:38:17 +00:00
SRCS= kdump_subr.c kdump_subr.h kdump.c ioctl.c subr.c utrace.c
CFLAGS+= -I${.CURDIR}/../ktrace -I${.CURDIR} -I${.CURDIR}/../.. -I.
1994-05-27 12:33:43 +00:00
.if ${MK_CASPER} != "no"
LIBADD= capsicum
CFLAGS+=-DHAVE_LIBCAPSICUM
.endif
.if ${MK_PF} != "no"
CFLAGS+=-DPF
.endif
NO_WERROR?= YES
CLEANFILES= ioctl.c kdump_subr.c kdump_subr.h
beforedepend: ioctl.c
.if (${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386")
beforedepend: linux_syscalls.c
CLEANFILES+= linux_syscalls.c
kdump.o: linux_syscalls.c
linux_syscalls.c: linux_syscalls.conf
sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
${.CURDIR}/../../sys/${MACHINE_ARCH}/linux/syscalls.master ${.CURDIR}/linux_syscalls.conf
.endif
.if (${MACHINE_ARCH} == "amd64")
beforedepend: linux32_syscalls.c
CLEANFILES+= linux32_syscalls.c
kdump.o: linux32_syscalls.c
linux32_syscalls.c: linux32_syscalls.conf
sh ${.CURDIR}/../../sys/kern/makesyscalls.sh \
${.CURDIR}/../../sys/${MACHINE_ARCH}/linux32/syscalls.master ${.CURDIR}/linux32_syscalls.conf
.endif
2002-06-21 10:21:21 +00:00
ioctl.c: mkioctls
env MACHINE=${MACHINE} CPP="${CPP}" \
sh ${.CURDIR}/mkioctls print ${DESTDIR}${INCLUDEDIR} > ${.TARGET}
1994-05-27 12:33:43 +00:00
kdump_subr.h: mksubr
sh ${.CURDIR}/mksubr ${DESTDIR}${INCLUDEDIR} | \
sed -n 's/^\([a-z].*)\)$$/void \1;/p' >${.TARGET}
kdump_subr.c: mksubr kdump_subr.h
sh ${.CURDIR}/mksubr ${DESTDIR}${INCLUDEDIR} >${.TARGET}
1994-05-27 12:33:43 +00:00
.include <bsd.prog.mk>