Home | History | Annotate | Download | only in mkdep
History log of /src/usr.bin/mkdep/mkdep.c
RevisionDateAuthorComments
 1.47  20-Aug-2021  rillig mkdep: make argument of findcc const

Previously, findcc modified its argument string, even though it had been
declared as 'const char *'. This triggered a lint warning that "strchr
effectively discards 'const char *' from argument", in fact, this code
caused the lint check to be implemented in the first place.

The first attempt at fixing it by removing the 'const' from the
parameter type was a bad idea since it made the API of that function
more complicated.

Revert back to making the parameter a 'const char *' and duplicate that
string internally as necessary. Add a few more tests for absolute
pathnames since these had been missing before. There are no tests yet
for snprintf with too long strings, but the current change does not
modify that part of the code.
 1.46  20-Aug-2021  rillig mkdep: fix string constness in call to findcc
 1.45  23-May-2018  joerg deconst -> __UNCONST to avoid null pointer arithmetic
 1.44  16-Jun-2015  christos branches: 1.44.14;
fix some error handling.
 1.43  05-Mar-2013  christos Conditionally include the depend files.
 1.42  05-Mar-2013  christos add -i and -v
 1.41  26-Aug-2012  jmmv branches: 1.41.2;
Add a new "-P prefix" option to mkdep(1).

This option prepends the string given in prefix to every target
filename. This is useful for programs that have source files in
multiple subdirectories and a single Makefile that references all of
them explicitly (without using the VPATH functionality because there
can be files with the same name in each subdirectory).
 1.40  04-Sep-2011  joerg branches: 1.40.2;
ANSIfy + static + __dead
 1.39  30-Jun-2011  wiz dependant -> dependent
 1.38  31-May-2011  enami Don't touch before the mmap'ed region.
 1.37  30-May-2011  christos Handle the empty suffix properly. Convert suffix list to a list from an
array and don't have limits in the suffix length. Also don't require that
suffixes have a single dot.
 1.36  17-Apr-2011  christos Recognize --sysroot but don't document it or do anything about it for now.
 1.35  26-May-2010  christos fix empty suffix case.
 1.34  26-May-2010  christos PR/43364: Nicolas Joly: mkdep(1) wrong target names when suffix list miss .o
 1.33  12-Apr-2009  lukem fix -Wcast-qual & -Wsign-compare issues
 1.32  21-Jul-2008  lukem branches: 1.32.6;
Remove the \n and tabs from the __COPYRIGHT() strings.
Tweak to use a consistent format.
 1.31  28-Apr-2008  martin branches: 1.31.2;
Remove clause 3 and 4 from TNF licenses
 1.30  25-Sep-2007  lukem branches: 1.30.6;
remove unnecessary #include
 1.29  15-Oct-2006  christos branches: 1.29.8;
- make a variable volatile, that gcc warns vfork will clobber.
- don't blindly walk before the beginning of the buffer because of a
corrupt dependency file. In this case the first character of the
dependency file was a :
 1.28  20-Mar-2006  christos make this compile again.
 1.27  20-Mar-2006  elad plug leaks, coverity cids 92, 93.
 1.26  12-Dec-2005  wiz Sort options.
 1.25  12-Dec-2005  dsl Add a -D option that acts like -d, but reads the filenames (whitespace
separated) from stdin.
Useful (eg in Makefile.kern.inc) to avoid breaking the systems command
line limit.
 1.24  07-Jun-2005  he Initialize a couple of local variables to appease -Wuninitialized.
Marked with XXXGCC for sun2 (found while compiling for it).

Reviewed by lukem.
 1.23  13-Jul-2004  wiz Sync usage with man page. From Kouichirou Hiratsuka in PR 26224.
 1.22  26-Jan-2004  dsl Redo code that expands the 'xxx.o' to 'xxx.o xxx.so xxx.po xxx.ln' so that
is doesn't care which of the wanted suffixes are in the input file.
Needed for my autodepend code where you don't know which compilation ran last.
 1.21  07-Dec-2003  dsl Only emit each filename once in a single .OPTIONAL line when -o is given.
(Saves several MB for kernel .depend files.)
 1.20  11-Nov-2003  dsl Don't rely on mmap giving a NUL terminated buffer.
Let '--' be used to separate options to mkdep from those to cc.
 1.19  10-Nov-2003  dsl Fix continuation line handling.
 1.18  10-Nov-2003  dsl Add the following options with a view to using 'cc -MD' to automatically
create dependency files:
-d process xxx.d files to generate .depend (don't run ${CC})
-o add .OPTIONAL: <headers> to output file
-q don't print warnins for missing files (with -d)
-s suf list of suffixes to replace ".o"
The -s suf should allow all the 'afterdepend' stuff to be killed.
(christos thought this might be a good idea...)
 1.17  27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.16  28-Mar-2003  msaitoh catch SIGPIPE, too.
 1.15  19-Jan-2003  elric Backing this out until it works.
 1.14  18-Jan-2003  jmmv When an unknown option is found, ignore it, as it may be cc related (i.e.,
-D and -I options).
 1.13  18-Jan-2003  jmmv Use getopt(3) instead of specific code to parse options.
Reviewed by jdolecek.
 1.12  16-Jan-2003  msaitoh catch SIGINT, SIGHUP, SIGQUIT and SIGTERM to clear a temporary file.
 1.11  14-Jun-2002  simonb Split out the findcc() function that tries to determine the path to
the C compiler so other programs can use it.
 1.10  31-Jan-2002  tv branches: 1.10.2;
Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.9  21-Jan-2002  tv Add hooks for cross-hosting on non-NetBSD platforms.
 1.8  22-Mar-2001  cgd a couple of tiny whitespace cleanups
 1.7  22-Mar-2001  cgd get closer to KNF.
 1.6  22-Mar-2001  cgd convert uses of hard-coded string "mkdep" to use getprogname().
 1.5  21-Feb-2001  cgd call setprogname(argv[0]) at start of main()
 1.4  21-Jul-1999  kleink branches: 1.4.8;
Rather than hardcoding _PATH_TMP (and relying on const string concatenation),
try TMPDIR (if set in the environment).
 1.3  31-Mar-1999  kleink * Make usage string reflect reality,
* declare internal utility functions static,
* remove unneeded workarounds for bogus -Wuninitialized reports,
* delint.
 1.2  18-Mar-1999  sommerfe Do something sane if we have CC='cc -pipe' set
 1.1  25-Jan-1999  tron branches: 1.1.1;
Initial revision
 1.1.1.1  25-Jan-1999  tron New C program to replace old "mkdep" script. Speeds up "make depend"
by at least 5 percent.
 1.4.8.2  25-Jun-2003  itojun usr.bin/mkdep/mkdep.c 1.16

catch SIGPIPE too, so that we do not leave temporary files behind.
[msaitoh, ticket #49]
 1.4.8.1  15-Mar-2003  he Pull up revision 1.12 (requested by msaitoh in ticket #19):
Catch SIGINT, SIGHUP, SIGQUIT and SIGTREM and clear a temporary
file.
 1.10.2.2  30-Jun-2003  grant Pull up revision 1.16 (requested by msaitoh in ticket #1339):

catch SIGPIPE, too.
 1.10.2.1  27-Jan-2003  jmc Pullup revisions 1.11-1.12 (with hand patching)
(requested by masanobu in ticket #1111)
Catch SIGINT, SIGHUP, SIGQUIT and SIGTERM to clear a temporary file.
 1.29.8.1  06-Nov-2007  matt sync with HEAD
 1.30.6.1  18-May-2008  yamt sync with head.
 1.31.2.1  18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.32.6.1  13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.40.2.2  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.40.2.1  30-Oct-2012  yamt sync with head
 1.41.2.1  23-Jun-2013  tls resync from head
 1.44.14.1  25-Jun-2018  pgoyette Sync with HEAD

RSS XML Feed