Import NetBSD mkdep
This commit is contained in:
+6
-5
@@ -3,15 +3,16 @@ NOOBJ= # defined
|
||||
.include <bsd.own.mk>
|
||||
|
||||
.if ${MKSHARE} != "no"
|
||||
FILES= bsd.ack.mk bsd.dep.mk bsd.files.mk \
|
||||
bsd.gcc.mk bsd.inc.mk \
|
||||
FILES= bsd.dep.mk bsd.files.mk \
|
||||
bsd.inc.mk \
|
||||
bsd.init.mk bsd.kinc.mk bsd.klinks.mk bsd.lib.mk \
|
||||
bsd.links.mk bsd.man.mk bsd.obj.mk bsd.own.mk \
|
||||
bsd.prog.mk bsd.subdir.mk bsd.sys.mk bsd.gcov.mk \
|
||||
pkgsrchooks.mk sys.mk
|
||||
bsd.prog.mk bsd.subdir.mk bsd.sys.mk \
|
||||
sys.mk
|
||||
|
||||
# MINIX-specific files
|
||||
FILES+= minix.bootprog.mk minix.service.mk
|
||||
FILES+= minix.bootprog.mk minix.service.mk minix.ackdep.mk \
|
||||
minix.ack.mk minix.gcc.mk minix.gcov.mk pkgsrchooks.mk
|
||||
|
||||
FILESDIR=/usr/share/mk
|
||||
.endif
|
||||
|
||||
+26
-35
@@ -15,7 +15,6 @@ MKDEP_SUFFIXES?= .o
|
||||
# some of the rules involve .h sources, so remove them from mkdep line
|
||||
|
||||
.if defined(SRCS) # {
|
||||
#_TRADITIONAL_CPP?=-traditional-cpp
|
||||
__acpp_flags= ${_TRADITIONAL_CPP}
|
||||
|
||||
__DPSRCS.all= ${SRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/} \
|
||||
@@ -32,43 +31,35 @@ ${__DPSRCS.d}: ${__DPSRCS.notd} ${DPSRCS}
|
||||
.depend: ${__DPSRCS.d}
|
||||
${_MKTARGET_CREATE}
|
||||
rm -f .depend
|
||||
# ${MKDEP} -d -f ${.TARGET} -s ${MKDEP_SUFFIXES:Q} ${__DPSRCS.d}
|
||||
cat ${__DPSRCS.d} > ${.TARGET}
|
||||
${MKDEP} -d -f ${.TARGET} -s ${MKDEP_SUFFIXES:Q} ${__DPSRCS.d}
|
||||
|
||||
.SUFFIXES: .d .s .S .c .C .cc .cpp .cxx .m
|
||||
|
||||
.c.d:
|
||||
${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
# mkdep -- ${MKDEPFLAGS} \
|
||||
# ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} > ${.TARGET}
|
||||
mkdep "$(CC) ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} -E" ${.IMPSRC} > ${.TARGET}
|
||||
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
# .m.d:
|
||||
# ${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${OBJCFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
.m.d:
|
||||
${_MKTARGET_CREATE}
|
||||
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
${OBJCFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
.s.d .S.d:
|
||||
${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${.IMPSRC}
|
||||
mkdep "$(CC) ${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} -E" ${.IMPSRC} > ${.TARGET}
|
||||
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${.IMPSRC}
|
||||
|
||||
# .C.d .cc.d .cpp.d .cxx.d:
|
||||
# ${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \
|
||||
# ${DESTDIR}/usr/include/g++} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
.C.d .cc.d .cpp.d .cxx.d:
|
||||
${_MKTARGET_CREATE}
|
||||
${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \
|
||||
${DESTDIR}/usr/include/g++} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
.endif # defined(SRCS) # }
|
||||
|
||||
@@ -79,10 +70,10 @@ cleandepend: .PHONY
|
||||
.endif
|
||||
|
||||
##### Custom rules
|
||||
# .if !target(tags)
|
||||
# tags: ${SRCS}
|
||||
# .if defined(SRCS)
|
||||
# -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
|
||||
# ${TOOL_SED} "s;\${.CURDIR}/;;" > tags
|
||||
# .endif
|
||||
# .endif
|
||||
.if !target(tags)
|
||||
tags: ${SRCS}
|
||||
.if defined(SRCS)
|
||||
-cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
|
||||
${TOOL_SED} "s;\${.CURDIR}/;;" > tags
|
||||
.endif
|
||||
.endif
|
||||
|
||||
+6
-2
@@ -153,10 +153,14 @@ LINKSMODE?= ${LIBMODE}
|
||||
.include <bsd.files.mk>
|
||||
.include <bsd.inc.mk>
|
||||
.include <bsd.links.mk>
|
||||
.if ${COMPILER_TYPE} == "ack"
|
||||
.include <minix.ackdep.mk>
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
.include <bsd.dep.mk>
|
||||
.endif
|
||||
|
||||
.if ${COMPILER_TYPE} == "ack"
|
||||
.include <bsd.ack.mk>
|
||||
.include <minix.ack.mk>
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
.include <bsd.gcc.mk>
|
||||
.include <minix.gcc.mk>
|
||||
.endif
|
||||
|
||||
@@ -360,12 +360,16 @@ LINKSMODE?= ${BINMODE}
|
||||
.include <bsd.inc.mk>
|
||||
.include <bsd.links.mk>
|
||||
.include <bsd.sys.mk>
|
||||
.if ${COMPILER_TYPE} == "ack"
|
||||
.include <minix.ackdep.mk>
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
.include <bsd.dep.mk>
|
||||
.endif
|
||||
|
||||
.if ${COMPILER_TYPE} == "ack"
|
||||
.include <bsd.ack.mk>
|
||||
.include <minix.ack.mk>
|
||||
.elif ${COMPILER_TYPE} == "gnu"
|
||||
.include <bsd.gcc.mk>
|
||||
.include <minix.gcc.mk>
|
||||
.endif
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
# $NetBSD: bsd.dep.mk,v 1.68 2008/10/25 22:27:36 apb Exp $
|
||||
|
||||
##### Basic targets
|
||||
cleandir: cleandepend
|
||||
realdepend: beforedepend .depend afterdepend
|
||||
.ORDER: beforedepend .depend afterdepend
|
||||
|
||||
beforedepend .depend afterdepend: # ensure existence
|
||||
|
||||
##### Default values
|
||||
MKDEP= ackmkdep
|
||||
MKDEP_SUFFIXES?= .o
|
||||
|
||||
##### Build rules
|
||||
# some of the rules involve .h sources, so remove them from mkdep line
|
||||
|
||||
.if defined(SRCS) # {
|
||||
#_TRADITIONAL_CPP?=-traditional-cpp
|
||||
__acpp_flags= ${_TRADITIONAL_CPP}
|
||||
|
||||
__DPSRCS.all= ${SRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/} \
|
||||
${DPSRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/}
|
||||
__DPSRCS.d= ${__DPSRCS.all:O:u:M*.d}
|
||||
__DPSRCS.notd= ${__DPSRCS.all:O:u:N*.d}
|
||||
|
||||
.NOPATH: .depend ${__DPSRCS.d}
|
||||
|
||||
.if !empty(__DPSRCS.d) # {
|
||||
${__DPSRCS.d}: ${__DPSRCS.notd} ${DPSRCS}
|
||||
.endif # }
|
||||
|
||||
.depend: ${__DPSRCS.d}
|
||||
${_MKTARGET_CREATE}
|
||||
rm -f .depend
|
||||
# ${MKDEP} -d -f ${.TARGET} -s ${MKDEP_SUFFIXES:Q} ${__DPSRCS.d}
|
||||
cat ${__DPSRCS.d} > ${.TARGET}
|
||||
|
||||
.SUFFIXES: .d .s .S .c .C .cc .cpp .cxx .m
|
||||
|
||||
.c.d:
|
||||
${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
# mkdep -- ${MKDEPFLAGS} \
|
||||
# ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC} > ${.TARGET}
|
||||
${MKDEP} "$(CC) ${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} -E" ${.IMPSRC} > ${.TARGET}
|
||||
|
||||
# .m.d:
|
||||
# ${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${OBJCFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
.s.d .S.d:
|
||||
${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${__acpp_flags} ${.IMPSRC}
|
||||
${MKDEP} "$(CC) ${AFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} -E" ${.IMPSRC} > ${.TARGET}
|
||||
|
||||
# .C.d .cc.d .cpp.d .cxx.d:
|
||||
# ${_MKTARGET_CREATE}
|
||||
# ${MKDEP} -f ${.TARGET} -- ${MKDEPFLAGS} \
|
||||
# ${CXXFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
||||
# ${DESTDIR:D-nostdinc++ ${CPPFLAG_ISYSTEMXX} \
|
||||
# ${DESTDIR}/usr/include/g++} \
|
||||
# ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
||||
|
||||
.endif # defined(SRCS) # }
|
||||
|
||||
##### Clean rules
|
||||
cleandepend: .PHONY
|
||||
.if defined(SRCS)
|
||||
rm -f .depend ${__DPSRCS.d} ${.CURDIR}/tags ${CLEANDEPEND}
|
||||
.endif
|
||||
|
||||
##### Custom rules
|
||||
# .if !target(tags)
|
||||
# tags: ${SRCS}
|
||||
# .if defined(SRCS)
|
||||
# -cd ${.CURDIR}; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
|
||||
# ${TOOL_SED} "s;\${.CURDIR}/;;" > tags
|
||||
# .endif
|
||||
# .endif
|
||||
@@ -2,7 +2,7 @@ LCOV=lcov.$(PROG)
|
||||
CLEANFILES+= *.gcno *.gcda $(LCOV)
|
||||
|
||||
.if ${MKCOVERAGE} == "yes"
|
||||
CFLAGS+=-fno-builtin -fprofile-arcs -ftest-coverage
|
||||
CFLAGS+=-fno-builtin -fprofile-arcs -ftest-coverage
|
||||
LDADD+= -lgcov
|
||||
COMPILER_TYPE=gnu
|
||||
CC=gcc
|
||||
Reference in New Issue
Block a user