Home | History | Annotate | Download | only in mk
History log of /src/share/mk/bsd.dep.mk
RevisionDateAuthorComments
 1.89  03-Jun-2023  lukem bsd.dep.mk: move MKDEPINCLUDES to bsd.own.mk

Add default for MKDEPINCLUDES=no to to bsd.own.mk _MKVARS.no.
Simplify bsd.dep.mk check.
 1.88  14-Dec-2021  christos Pass W with IDU for lint and deps.
 1.87  01-Jul-2020  lukem bsd.dep.mk: fix "make tags" (again)

[repeat revision 1.85]

Fix "make tags" to actually build a tags file:
- Use !commands() instead of !target(), so that the rule actually works
- Write to ${.OBJDIR}/tags for read-only source (don't know why ${.TARGET}
isn't sufficient).
- Only match *.[cly] from ${.ALLSRCS} - just excluding *.h causes failures
because of ${targ}: subdir-${targ} in bsd.subdir.mk.

Thanks to uwe@ for assistance.
 1.86  22-Jun-2020  lukem bsd.dep.mk: revert 1.85 (for now)

Revert my recent 1.85 revision that fixed "make tags". It causes too
much build breakage elsewhere in the tree that needs to be resolved first.

Issues include:
- Directories using TESTS_CXX with .cpp and .cxx extension instead of the
default .cc extension (see bsd.prog.mk). Most of these have been fixed.
- external/gpl3/gcc build of .cc files. (No idea what's wrong there).
 1.85  21-Jun-2020  lukem bsd.dep.mk: fix "make tags"

Fix "make tags" to actually build a tags file:
- Use !commands() instead of !target(), so that the rule actually works
- Write to ${.OBJDIR}/tags for read-only source (don't know why ${.TARGET}
isn't sufficient).
- Only match *.[cly] from ${.ALLSRCS} - just excluding *.h causes failures
because of ${targ}: subdir-${targ} in bsd.subdir.mk.

Thanks to uwe@ for assistance.
 1.84  21-Jan-2019  christos Most of the mv operations are to move temporary files to their final place.
Some use -f, others don't. This can lead to spurious build failures when
the user performing the build changes. Centralize, and always use -f.
 1.83  21-Dec-2016  christos branches: 1.83.12; 1.83.14;
Don't remap mkdep, otherwise we add dependencies for /usr/include instead
of ${DESTDIR}/usr/include and things go south.
 1.82  01-Dec-2014  erh branches: 1.82.2;
PR toolchain/9618: add ".d" to MKDEP_SUFFIXES so the depend files are rebuilt
if any of their dependencies (i.e. the files they refer to) are changed.
This allows changes to transitive included headers to be handled properly.
 1.81  19-Jul-2014  plunky when calling mkdep, pass any -std=* flags for C and C++ source files
to ensure that any definitions this implies are set
 1.80  05-Dec-2013  matt branches: 1.80.2;
add ${MKTARGET_CREATE} for tags
 1.79  31-Oct-2013  mrg create mkdep output with a temporary file so that failures in
complation during .d creation don't leave an empty (stale) .d
file around to break future builds.

(hmm, probably could use .PRECIOUS here.)
 1.78  28-Oct-2013  mrg add MKDEPCXX, that is used for C++ files depend creation. also
add some missing ${COPTS.${.IMPSRC:T}} and ${CPUFLAGS.${.IMPSRC:T}}
to the dependancy rules.

this makes it possible to have C++ files .d files created with the
C++ compiler, and with the normal options for this file, which
means that we can build libstdc++-v3 from gcc 4.8.
 1.77  05-Mar-2013  christos Add a rule to rebuild dependency files that contain stale entries automatically.
 1.76  05-Mar-2013  christos MKDEPINCLUDES support.
 1.75  18-Nov-2012  apb Change some .if defined(SRCS) to .if defined(SRCS) && !empty(SRCS)
 1.74  19-Feb-2012  matt branches: 1.74.2;
Add support for --combine with gcc.
 1.73  10-Sep-2011  apb branches: 1.73.2;
Move all "clean" and "cleandir" processing to a new bsd.clean.mk
file, as proposed in tech-toolchain.
 1.72  10-Apr-2011  joerg For USETOOLS=yes, use the --sysroot support of the compiler to cut down
the number of hard-coded pathes and magic invocations.
 1.71  06-Feb-2011  joerg Allow HOSTLIB to use C++ by not specifying -nostdinc++.
 1.70  12-Jan-2011  joerg branches: 1.70.2;
Allow use of traditional CPP to be set on a per platform base in sys.mk.
Honour this for dependency processing in bsd.dep.mk. Switch i386 and
amd64 assembly to use ISO C90 preprocessor concat and drop the
-traditional-cpp on this platform.
 1.69  25-Jan-2010  christos PR/42658: Geoff Wing: Quote directory variables to deal with spaces in the
source pathname.
 1.68  25-Oct-2008  apb Use ${TOOL_SED} instead if plain sed in Makefiles.
 1.67  18-Apr-2004  lukem remove AINC support; it is now unnecessary
 1.66  29-Jan-2004  lukem Cosmetically tweak how .PHONY is used by (generally) providing it as a source,
instead of using it as a target with all the rules as its sources.
 1.65  27-Jan-2004  lukem Replace
:M-[IDU]*
with
:C/-([IDU])[ ]*/-\1/Wg:M-[IDU]*
so that arguments with whitespace after them work correctly.
Resolves [toolchain/18248] from Andrew White at Motorola.

Be consisent in this syntax; previously we'd sometimes we'd just have :M-[ID]*
which would ignore -Ufoo ...

(This needs :C///W support in make(1) that Simon Gerraty added for me :)
 1.64  11-Nov-2003  dsl Use -- to separate mkdep options from cc ones.
Avoids problems when the cc options start with -fpic.
 1.63  10-Nov-2003  dsl Use modified mkdep(1) (not cat) to merge '*.d' into '.depend'.
Allows some of the postprocessing to be done there instead of a separate
sed script called from 'afterdepend'.
 1.62  28-Oct-2003  mrg fix a typo in previous pointed out by lukem
 1.61  27-Oct-2003  mrg allow -traditional-cpp to be overridden when making dependancies
 1.60  21-Oct-2003  lukem Rework how MAKEVERBOSE operates:

* Don't bother prefixing commands with a line of ${_MKCMD}\
and instead rely upon "make -s". This is less intrusive on
all the Makefiles than the former. Idea from David Laight.

* Rename the variables use to print messages. The scheme now is:
_MKMSG_FOO Run _MKMSG 'foo'
_MKTARGET_FOO Run _MKMSG_FOO ${.TARGET}
From discussion with Alistair Crooks.
 1.59  19-Oct-2003  lukem Provide _MKMSG{BUILD,CREATE,COMPILE,FORMAT,INSTALL,LINK,LEX,YACC} to display
${_MKMSG} " ... {$.TARGET}" and use appropriately.

Provide _MKMSGLINK.m to provide "link" message by itself (without ${.TARGET})

Replace _MKSHCMD with _MKSHECHO
 1.58  18-Oct-2003  lukem Implement MAKEVERBOSE to control how "verbose" the standard make(1) rules are.
Supported values:
0 Minimal output ("quiet")
1 Describe what is occurring
2 Describe what is occurring and echo the actual command ("verbose")
This is the default, and is equivalent to the previous behaviour.
 1.57  11-Aug-2003  lukem order .SUFFIXES similar to other *.mk files
 1.56  06-Aug-2003  martin Handle empty __DPSRCS.d, avoiding executing commands like "cat > .depend"
in directories where only non-C/C++ files are in SRCS (e.g.: the forth
code for sparc bootblocks).

Patch from Luke.
 1.55  01-Aug-2003  lukem Rework how dependency generation is performed:

* DPSRCS contains extra dependencies, but is _NOT_ added to CLEANFILES.
This is a change of behaviour. If a Makefile wants the clean semantics
it must specifically append to CLEANFILES.
Resolves PR toolchain/5204.

* To recap: .d (depend) files are generated for all files in SRCS and DPSRCS
that have a suffix of: .c .m .s .S .C .cc .cpp .cxx

* If YHEADER is set, automatically add the .y->.h to DPSRCS & CLEANFILES

* Ensure that ${OBJS} ${POBJS} ${LOBJS} ${SOBJS} *.d depend upon ${DPSRCS}

* Deprecate the (short lived) DEPENDSRCS


Update the various Makefiles to these new semantics; generally either
adding to CLEANFILES (because DPSRCS doesn't do that anymore), or replacing
specific .o dependencies with DPSRCS entries.

Tested with "make -j 8 distribution" and "make distribution".
 1.54  01-Aug-2003  lukem tweak ${DEPENDSRCS.d} target so that ${SRCS} isn't there. this fixes the
"make: out of memory" problem when make dependencies in lib/libc.

XXX: this is a temporary workaround. i'm working on cleaning up how
the DPSRCS stuff is used throughout the tree...
 1.53  31-Jul-2003  lukem bsd.dep.mk: add a dependency for *.d on ${SRCS} ${DPSRCS}. this should fix
some build problems where DPSRCS contains .h files that need to exist to
build the .d file.

document that bsd.dep.mk should be included after anything that might
update SRCS or DPSRCS so that the above works correctly, and actually
ensure this is the case.
 1.52  29-Jul-2003  lukem Set .NOPATH for all ${DEPENDSRCS} and not just .depend.
Should fix build problem noted by Geoff Wing on current-users@
 1.51  28-Jul-2003  lukem Use the more "standard" `foo.d' instead of `foo.SUFFIX.dep'; the rules
are simpler and would have helped prevent the previous fubar.
Don't bother using -a with ${MKDEP} to build the individual .d files.
 1.50  28-Jul-2003  matt Make all the suffix rules with .c .c.dep (e.g not .cc .cc.cc.dep)
 1.49  28-Jul-2003  lukem Simplify .*.dep generation by using suffix transforms.
This also fixes a problem in the previous where the .ALLSRC would contain
any other dependencies that .depend had, thus breaking the mkdep invocation.

Provide DEPENDSRCS which effectively contains ".depend *.dep", to be
used in other Makefiles that want to add dependencies for .depend.
 1.48  28-Jul-2003  lukem Always use the "per source file".dep method to build the .depend file
(that was formerly only used for HOST_CYGWIN.).
Clean up implementation to minimise unnecessary variable munging.
Ensure all .dep files are deleted in cleandepend:.

This allows us to correctly support CPPFLAGS.<file> in make depend, and
whilst this method is marginally slower in the "no existing .depend file"
case, it should be faster in the "rebuilding depend for a subset of
source files" case.
 1.47  27-Jul-2003  mrg introduce a new $CPPFLAG_ISYSTEMXX that is used to reference c++ system
includes. for GCC3, set this to -I instead of -isystem.

XXX this should really be either not required or a -isystem-cxx, but for
now this is required to build libstdc++-v3, which otherwise complains
heavily about STL headers not being C code(!)
 1.46  18-Jul-2003  lukem whitespace cleanup
 1.45  11-Jun-2003  wiz Add missing } for rev. 1.43.
 1.44  11-Jun-2003  wiz Also recognize cpp files as C++ files for CYGWIN case.
 1.43  11-Jun-2003  christos recognize .cpp as c++ files.
 1.42  27-May-2003  wiz Back this out until I know why it does not work.
 1.41  27-May-2003  wiz Add .cpp dependency rules.
 1.40  08-May-2003  christos Fix _HOST_CYGWIN lossage.
 1.39  08-May-2003  christos Hacks for limited command and environment space (John Gordon)
 1.38  26-Nov-2002  thorpej The traditional C preprocessor is fixed in GCC 3.3 now, so no need
to skip -traditional-cpp for HAVE_GCC3.
 1.37  10-Nov-2002  thorpej Oops, AINC actually is still used; put it back.
 1.36  10-Nov-2002  thorpej The MIPS toolchain now defines __ABICALLS__ when abicalls are in use,
and the sources now use that define, so there is no need for us to define
ABICALLS. Since that was the only use for the AINC variable, garbage-collect
it.
 1.35  04-Jun-2002  thorpej Don't use -traditional-cpp if HAVE_GCC3.
 1.34  28-Nov-2001  tv If DESTDIR is set, do a similar nostdinc dance for the standard C++ include
directory.
 1.33  02-Nov-2001  tv Improve readability and reduce redundant redundancy in share/mk; add some
descriptive comments. The guts of hostprog, lib, and prog are mostly
unchanged; this will be done in another pass.

Make several things work properly with UNPRIVILEGED set, and make the
install-time "cmp" logic work for MANZ. Also reimplement INCS{DIR,NAME}_foo
(requested by wiz) in a backwards compatible way.

Reviewed by christos.
 1.32  14-Aug-2001  tv Rather than explicitly saying "clean cleandir:" all the time, make clean
a dependency of cleandir (so that "make cleandir" implies "make clean").
 1.31  01-Jun-2001  tv Make "distclean" a REAL synonym for "cleandir" by actually aliasing it
in <bsd.own.mk>, rather than sprinkling it in all the .mk files (and
some Makefiles throughout the tree).
 1.30  22-Jan-2000  mycroft Make `dependall' play nicely with SUBDIR, using a hack similar to `realinstall'
for both `depend' and `all'.
Also, remove the old hack that invokes an extra shell for .depend, now that
make(1) has been fixed.
 1.29  16-Nov-1999  tron Add missing "\" in two line shell command.
 1.28  16-Nov-1999  minoura Pass -traditional-cpp to mkdep for assembler files,
as in the actual compilation (${COMPILE.S} rule in sys.mk).
 1.27  11-Aug-1999  sommerfeld branches: 1.27.4;
correct previous fix:
- add CLEANDEPEND variable for stuff which should be cleaned out
in "cleandepend" phase.
- add it to the files removed during the cleandepend phase.
 1.26  24-Feb-1999  simonb Change CFLAGS to AFLAGS for mkdep of .S/.s files. Fixes "make depend"
on pmax kernels (and doesn't break "make depend" on entire tree).
 1.25  07-Feb-1999  tv Use :Q to quote arguments to "echo" so that quote marks don't fall out of
the printed mkdep command.
 1.24  03-Feb-1999  tv Our make can't actually turn off implicit rules per-target, and the
"depend:" rule had no actual commands to execute, so it used the implicit
".c:" rule in gas.new (which has a depend.c). Add a command here -- just
"true" -- that prevents use of implicit rules. This may need a new
.-option in make(1) to be done Right.
 1.23  18-Aug-1998  tv Kill spaces in the $$files check introduced by borrowing the C++ rule for
ObjC.
 1.22  18-Aug-1998  tv Add dependency rule for Objective-C files.
 1.21  09-Aug-1998  lukem add distclean as a synonym for cleandir
 1.20  09-May-1997  mycroft Automatically add the .c files corresponding to .l and .y files to DPSRCS.
Automatically add DPSRCS to CLEANFILES.
 1.19  09-May-1997  mycroft Remove cruft.
 1.18  08-May-1997  gwr Set the .NOPATH flag for the .depend target.
 1.17  07-May-1997  mycroft Don't use _SUBDIRUSE outside of bsd.subdir.mk.
 1.16  07-May-1997  mycroft Always define cleandepend. Don't use a .depend target if SRCS is empty.
 1.15  07-May-1997  mycroft Shuffle some .PHONYs around, to work better with `-t'.
 1.14  06-May-1997  mycroft Add a pile of missing .PHONYs.
 1.13  07-Mar-1997  gwr Allow mkdep to exist as a different name (fixes PR#3302)
 1.12  27-Sep-1995  christos - make sure the afterdepend rule fires `after' .depend gets created.
[fixed for parallel make]
- make depend prettier printing.
 1.11  13-Dec-1994  mycroft Remove `-+' arg to mkdep.
 1.10  13-Dec-1994  mycroft Add CPPFLAGS to mkdep lines, for cross-compilation.
 1.9  30-Jun-1994  cgd RCSID frobbing, and minor sanity adjustments.
 1.8  30-Jun-1994  cgd don't be careless with _SUBDIRUSE
 1.7  27-Feb-1994  cgd cleandepend should happen on 'cleandir' not 'clean', from michaelv@iastate.edu
 1.6  05-Dec-1993  cgd do .S files, too
 1.5  05-Sep-1993  mycroft Depend .s files.
 1.4  15-Aug-1993  mycroft Don't do tags and cleandepend if no SRCS.
 1.3  15-Aug-1993  mycroft Makefile: Use `install -d' to create directory.
bsd.dep.mk: Add defaults for `beforedepend' and `afterdepend'.
sys.mk: 8 tabs --> space
 1.2  15-Aug-1993  mycroft Move man rules to sys.mk.
Use bsd.subdir.mk for building subdirectories.
Don't forget to remove x.cc and x.C when using SHAREDSTRINGS.
Make ${PROG} always depend on ${LIBCRT0}.
Don't duplicate code between cleandir and clean.
Move tags target to bsd.dep.mk.
Move STRIP to bsd.own.mk.
Remove redundant definitions of {BIN,MAN}{DIR,GRP,OWN,MODE}.
Move {LIB,DOC}{DIR,GRP,OWN,MODE} defaults to bsd.own.mk.
 1.1  15-Aug-1993  mycroft Abstract out dependency stuff, and add RCS identifiers.
 1.27.4.1  27-Dec-1999  wrstuden Pull up to last week's -current.
 1.70.2.1  08-Feb-2011  bouyer Sync with HEAD
 1.73.2.3  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.73.2.2  16-Jan-2013  yamt sync with (a bit old) head
 1.73.2.1  17-Apr-2012  yamt sync with head
 1.74.2.3  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.74.2.2  23-Jun-2013  tls resync from head
 1.74.2.1  20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.80.2.1  10-Aug-2014  tls Rebase.
 1.82.2.1  07-Jan-2017  pgoyette Sync with HEAD. (Note that most of these changes are simply $NetBSD$
tag issues.)
 1.83.14.1  10-Jun-2019  christos Sync with HEAD
 1.83.12.1  26-Jan-2019  pgoyette Sync with HEAD

RSS XML Feed