Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
# $NetBSD: bsd.dep.mk,v 1.74 2012/02/19 23:19:37 matt Exp $
|
2010-02-16 15:41:33 +01:00
|
|
|
|
|
|
|
##### Basic targets
|
|
|
|
realdepend: beforedepend .depend afterdepend
|
|
|
|
.ORDER: beforedepend .depend afterdepend
|
|
|
|
|
|
|
|
beforedepend .depend afterdepend: # ensure existence
|
|
|
|
|
|
|
|
##### Default values
|
|
|
|
MKDEP?= mkdep
|
|
|
|
MKDEP_SUFFIXES?= .o
|
|
|
|
|
|
|
|
##### Build rules
|
|
|
|
# some of the rules involve .h sources, so remove them from mkdep line
|
|
|
|
|
|
|
|
.if defined(SRCS) # {
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
__acpp_flags= ${_ASM_TRADITIONAL_CPP}
|
2010-02-16 15:41:33 +01:00
|
|
|
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
.if defined(NODPSRCS)
|
|
|
|
.for f in ${SRCS} ${DPSRCS}
|
|
|
|
.if "${NODPSRCS:M${f}}" == ""
|
|
|
|
__DPSRCS.all+= ${f:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/}
|
|
|
|
.endif
|
|
|
|
.endfor
|
|
|
|
beforedepend: ${DPSRCS}
|
|
|
|
.else
|
|
|
|
__DPSRCS.all+= ${SRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/} \
|
2010-02-16 15:41:33 +01:00
|
|
|
${DPSRCS:C/\.(c|m|s|S|C|cc|cpp|cxx)$/.d/}
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
.endif
|
2010-02-16 15:41:33 +01:00
|
|
|
__DPSRCS.d= ${__DPSRCS.all:O:u:M*.d}
|
|
|
|
__DPSRCS.notd= ${__DPSRCS.all:O:u:N*.d}
|
|
|
|
|
2013-06-17 16:51:49 +02:00
|
|
|
.if defined(__MINIX)
|
|
|
|
__DPSRCS.bcd= ${"${USE_BITCODE:Uno}" == "yes":? ${SRCS:M*.c:O:u:.c=.bcd}:}
|
|
|
|
__DPSRCS.d+= ${__DPSRCS.bcd}
|
|
|
|
.endif # defined(__MINIX)
|
|
|
|
|
2010-02-16 15:41:33 +01:00
|
|
|
.NOPATH: .depend ${__DPSRCS.d}
|
|
|
|
|
|
|
|
.if !empty(__DPSRCS.d) # {
|
|
|
|
${__DPSRCS.d}: ${__DPSRCS.notd} ${DPSRCS}
|
|
|
|
.endif # }
|
|
|
|
|
|
|
|
.depend: ${__DPSRCS.d}
|
|
|
|
${_MKTARGET_CREATE}
|
|
|
|
rm -f .depend
|
2011-07-22 17:28:27 +02:00
|
|
|
${MKDEP} -d -f ${.TARGET} -s ${MKDEP_SUFFIXES:Q} ${__DPSRCS.d}
|
2010-02-16 15:41:33 +01:00
|
|
|
|
2013-06-17 16:51:49 +02:00
|
|
|
.SUFFIXES: .bcd .d .s .S .c .C .cc .cpp .cxx .m
|
|
|
|
|
|
|
|
.if ${USE_BITCODE:Uno} == "yes"
|
|
|
|
.c.bcd:
|
|
|
|
${_MKTARGET_CREATE}
|
|
|
|
${MKDEP} -f ${.TARGET} -s .bc -- ${MKDEPFLAGS} \
|
|
|
|
${CFLAGS:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*} \
|
|
|
|
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
|
|
|
.endif
|
2010-02-16 15:41:33 +01:00
|
|
|
|
|
|
|
.c.d:
|
|
|
|
${_MKTARGET_CREATE}
|
2011-07-22 17:28:27 +02:00
|
|
|
${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}
|
2010-02-16 15:41:33 +01:00
|
|
|
|
|
|
|
.s.d .S.d:
|
|
|
|
${_MKTARGET_CREATE}
|
2011-07-22 17:28:27 +02:00
|
|
|
${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]*} \
|
|
|
|
${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} ${.IMPSRC}
|
2010-02-16 15:41:33 +01:00
|
|
|
|
|
|
|
.endif # defined(SRCS) # }
|
|
|
|
|
|
|
|
##### Clean rules
|
|
|
|
.if defined(SRCS)
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
CLEANDIRFILES+= .depend ${__DPSRCS.d} ${.CURDIR}/tags ${CLEANDEPEND}
|
2010-02-16 15:41:33 +01:00
|
|
|
.endif
|
|
|
|
|
|
|
|
##### Custom rules
|
2011-07-22 17:28:27 +02:00
|
|
|
.if !target(tags)
|
|
|
|
tags: ${SRCS}
|
|
|
|
.if defined(SRCS)
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
-cd "${.CURDIR}"; ctags -f /dev/stdout ${.ALLSRC:N*.h} | \
|
2011-07-22 17:28:27 +02:00
|
|
|
${TOOL_SED} "s;\${.CURDIR}/;;" > tags
|
|
|
|
.endif
|
|
|
|
.endif
|
Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
* tools
* distribution
* sets
* release
The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.
For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.
Regarding new or modifications of Makefiles a few things:
* Read share/mk/bsd.README
* If you add a subdirectory, add a Makefile in it, and have it called
by the parent through the SUBDIR variable.
* Do not add arbitrary inclusion which crosses to another branch of
the hierarchy; If you can't do without it, put a comment on why.
If possible, do not use inclusion at all.
* Use as much as possible the infrastructure, it is here to make
life easier, do not fight it.
Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-09-12 09:37:05 +02:00
|
|
|
|
|
|
|
##### Pull in related .mk logic
|
|
|
|
.include <bsd.clean.mk>
|