summaryrefslogtreecommitdiff
path: root/usr.bin/make/dir.c
AgeCommit message (Collapse)Author
2015-06-16Remove old fmake. It wasn't built by default for some time. Users thatWarner Losh
really need it can find it in the devel/fmake port or pkg install fmake. Note: This commit is orthogonal to the question 'can we fmake buildworld'. Differential Revision: https://reviews.freebsd.org/D2840 Notes: svn path=/head/; revision=284464
2010-01-04Add ability to search up the directory hierarchy for the system directory.David E. O'Brien
Do by specifying ".../" with '-m' or MAKESYSPATH (new) environment variable. Reviewed by: <sjg@NetBSD.org> Obtained from: NetBSD (+ embellishment by me, sent back to NetBSD) Notes: svn path=/head/; revision=201526
2009-12-11Remove unnecessary includes.Xin LI
Reviewed by: rodrigc Notes: svn path=/head/; revision=200417
2009-11-17Catch up with r144020's /Dir_FindFile/Path_FindFile/David E. O'Brien
Notes: svn path=/head/; revision=199419
2009-11-17Garbage collect some old #ifdef'ed code from 1994 that causes vi's '%'David E. O'Brien
to be unable to find a match in Path_FindFile(). Notes: svn path=/head/; revision=199404
2005-03-23Make paths an explicite datatype instead of using the generic Lst.Hartmut Brandt
A Path is now a TAILQ of PathElements each of which just points to a reference counted directory. Rename all functions dealing with Paths from the Dir_ prefix to a Path_ prefix. Notes: svn path=/head/; revision=144020
2005-03-22Style: <space><tab> -> <tab>Hartmut Brandt
Notes: svn path=/head/; revision=143979
2005-03-22Rename struct Path to struct Dir and move it into the C-file. ItHartmut Brandt
is not used outside. Notes: svn path=/head/; revision=143978
2005-03-16Fix a comment.Hartmut Brandt
Notes: svn path=/head/; revision=143685
2005-02-22Use the new LST_FOREACH macro throughout the file and replace calls toHartmut Brandt
Lst_ForEach and Lst_Find. Notes: svn path=/head/; revision=142209
2005-02-04Some more easy constification.Hartmut Brandt
Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141252
2005-02-01Clean up include files and file including. Split nonints.h into piecesHartmut Brandt
that get included just where they are needed. All headers include the headers that they need to compile (just with an empty .c file). Sort includes alphabetically where apropriate and fix some duplicate commenting for struct Job, struct GNode and struct Shell by removing one version and inlining the comments into the structure declaration (the comments have been somewhat outdated). This patch does not contain functional changes (checked with md5). Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141104
2004-12-17Remove all the cleanup functions. There is no reason to free memoryHartmut Brandt
just before exiting (especially given the number of memory leaks) - it just costs time. Notes: svn path=/head/; revision=138972
2004-12-16Instead of dynamically allocating list heads allocated them staticallyHartmut Brandt
now that their size is only two pointers. This eliminates a lot of calls to Lst_Init and from there to malloc together with many calls to Lst_Destroy (in places where the list is obviously empty). This also reduces the chance to leave a list uninitilized so we can remove more NULL pointer checks and probably eliminates a couple of memory leaks. Notes: svn path=/head/; revision=138916
2004-12-09If a path element directory was never opened it is not on the list ofHartmut Brandt
open directories so there is no need to remove it from there. This fixes a core dump introduced by removing the run-time check from Lst_Remove. Notes: svn path=/head/; revision=138621
2004-12-08Get rid of the sequential access feature of the lists. This was usedHartmut Brandt
only in a couple of places and all of them except for one were easily converted to use Lst_First/Lst_Succ. The one place is compatibility mode in job.c where the it was used to advance to the next command on each invocation of JobStart. For this case add a pointer to the node to hold the currently executed command. Notes: svn path=/head/; revision=138564
2004-12-08Constify the arguments to the list compare function. This temporarilyHartmut Brandt
requires to make a copy of the filename in ReadMakefile and to duplicate two small functions in suff.c. This hopefully will go away when everything is constified. Submitted by: Max Okumoto <okumoto@ucsd.edu> (partly) Notes: svn path=/head/; revision=138561
2004-12-08Consify the arguments to str_concat. Remove the STR_DOFREE flag for thatHartmut Brandt
purpose and explicitely free the input string in the one place that was calling str_concat with that flag. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=138547
2004-12-07Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofHartmut Brandt
the structs itself not of pointers to them. This will simplify constification. Checked by: diff on the object files Notes: svn path=/head/; revision=138512
2004-12-07Make needs no circular lists so remove them from the list code.Hartmut Brandt
Notes: svn path=/head/; revision=138510
2004-12-06Some constification which doesn't require code rewrites.Hartmut Brandt
Notes: svn path=/head/; revision=138455
2004-12-06Style: fix indentation.Hartmut Brandt
Notes: svn path=/head/; revision=138441
2004-12-01Style: remove a lot of unnecessary casts, add some and spell the nullHartmut Brandt
pointer constant as NULL. Checked by: diff -r on the object files before and after Notes: svn path=/head/; revision=138264
2004-11-30Stylification: missing spaces, extra space after function names, castsHartmut Brandt
and the sizeof operator, missing empty lines, void casts, extra empty lines. Checked by: diff on make *.o lst.lib/*.o Submitted by: Max Okumoto <okumoto@soe.ucsd.edu> (partly) Notes: svn path=/head/; revision=138232
2004-11-30Change a couple of the primitve list functions to be macros. This changesHartmut Brandt
the semantic of Lst_Datum which formerly returned NULL when the argument node was NULL. There was only one place in the source that relied on this so change that place. Notes: svn path=/head/; revision=138222
2003-10-02Fix a bug that prevented exists() from finding "foo/", "foo/."Ruslan Ermilov
and "foo/.." when ".PATH: foo" was also given. PR: bin/34062 Notes: svn path=/head/; revision=120676
2003-09-14- Cut out the code that caches the "." directory out of Dir_Init()Ruslan Ermilov
into a separate function, Dir_InitDot(). - Postpone the current and object directories detection (and caching of the "." directory) until after all command line arguments are parsed. This makes the -C option DTRT. PR: bin/47149 Notes: svn path=/head/; revision=120053
2002-10-09Convert make(1) to use ANSI style function declarations. VariableJuli Mallett
documentation already adequatedly existed in the description in most cases. Where it did not, it was added. If no documentation existed beforehand, then none was added. Some unused dummies for use in the traversal functions were marked as __unused during the conversion. Occasionally, local style fixes were applied to lines already being modified or influenced. Now make(1) should always build with WARNS=3. Notes: svn path=/head/; revision=104696
2002-09-28Fix merge error in previous commit.Juli Mallett
Sponsored by: Bright Path Solutions Notes: svn path=/head/; revision=104109
2002-09-28Add empty default cases where they should be, remove non-local execution stuffJuli Mallett
in compat.c which doesn't even have preprocessor-conditional-hidden support code, and add a debugging statement where we might end up with a nil list somehow, but where I doubt it. First confirmed userland kill for Flexelint. Sponsored by: Bright Path Solutions Notes: svn path=/head/; revision=104108
2002-09-18Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichJuli Mallett
is merely printf() but to stderr. This takes care of the caveat which lead to the use of a vararg macro -- getting everything to stderr. Notes: svn path=/head/; revision=103545
2002-09-17Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingJuli Mallett
variable length arguments to a macro. Bump version as this makes DEBUG statements *always* go to stderr rather than sometimes stdout. There are a few stragglers, which I will take care of as soon as I can. Mostly these relate to the need-for-death-of some of the remote job code. Nearby stylistic nits and XXX added/fixed where appropriate. Notes: svn path=/head/; revision=103508
2002-09-17#define<space> -> #define<tab>Juli Mallett
Notes: svn path=/head/; revision=103503
2002-06-20Look for wildcards, and balanced meta-characters such as { and } like NetBSDJuli Mallett
does. Obtained from: NetBSD Notes: svn path=/head/; revision=98502
2002-06-01Remove a stray asterisk in a comment.Juli Mallett
Notes: svn path=/head/; revision=97686
2002-05-16More consistancy. file system > filesystemTom Rhodes
Notes: svn path=/head/; revision=96704
2002-04-13Fix copyrights, and undo SCS ID damage.David E. O'Brien
Notes: svn path=/head/; revision=94589
2002-04-13Update SCM ID method.David E. O'Brien
Notes: svn path=/head/; revision=94587
2002-04-13De'register.David E. O'Brien
Notes: svn path=/head/; revision=94584
2002-03-22remove __PWarner Losh
Notes: svn path=/head/; revision=92921
2001-04-25-Wall cleanup.Ruslan Ermilov
Notes: svn path=/head/; revision=75975
2001-02-10Fix nasty bug where make(1) assumed that you could read the directory itWill Andrews
was in. This shall be MFC'd in about three days (probably not a good idea to MFC the stylistic changes though - see below). PR: 19978 Submitted by: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> Patch by: roam (slightly modified by me to use NULL not NIL) Notes: svn path=/head/; revision=72310
2001-01-21Fix style(9) bug; use ISDOT[DOT,]() macro available in util.c by movingWill Andrews
it to make.h so both dir.c and util.c can use it, although bde didn't particularly like this part of the idea, IMO it's cleaner than it was. Submitted by: bde Notes: svn path=/head/; revision=71325
2000-12-26Fix for the case where the first two entries returned by readdir() areWill Andrews
actually NOT '.' and '..'. Apparently this isn't the case when accessing a directory via XFS over NFS on SGI systems. Since I don't have access to an environment like that, this will sit out in -current for at least six weeks. However, the patch proposed by the submitter seems acceptable, so I've decided to commit it to the tree, in the hope that it will solve some problems without bringing up others. PR: 23300 Submitted by: Jim Pirzyk <Jim.Pirzyk@disney.com> Notes: svn path=/head/; revision=70358
2000-12-02There's also no point in #typedef'ing void/char pointers. Accordingly,Will Andrews
rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD Notes: svn path=/head/; revision=69531
2000-12-02There's no reason to use fancy forms of NULL. Replace all instancesWill Andrews
of NIL, NILLST, NILLGNODE, etc. with NULL. Obtained from: OpenBSD Notes: svn path=/head/; revision=69527
2000-07-09Use __RCSID()Wilfredo Sanchez
Notes: svn path=/head/; revision=62833
1999-09-11Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)Tim Vanderhoek
Notes: svn path=/head/; revision=51150
1999-08-28$Id$ -> $FreeBSD$Peter Wemm
Notes: svn path=/head/; revision=50477
1999-08-17Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).Tim Vanderhoek
Obtained from: OpenBSD, sometimes indirected from NetBSD; myself Notes: svn path=/head/; revision=49938