aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/make.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old fmake. It wasn't built by default for some time. Users thatWarner Losh2015-06-161-819/+0
| | | | | | | | | | 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
* - Partially revert r200417. config.h brings several definitions,Stanislav Sedov2009-12-171-0/+1
| | | | | | | | that appears to be actually used. Without config.h included cross-build of world failed (at least for ARM). Notes: svn path=/head/; revision=200630
* Remove unnecessary includes.Xin LI2009-12-111-3/+0
| | | | | | | Reviewed by: rodrigc Notes: svn path=/head/; revision=200417
* Avoid infinite loops when remaking makefiles not onlyMax Khon2009-04-071-5/+21
| | | | | | | for Makefile targets but also for targets they depend on. Notes: svn path=/head/; revision=190821
* Exit with error code 2 when run with -k (continue if errors) and build failed.Max Khon2008-12-181-4/+2
| | | | Notes: svn path=/head/; revision=186279
* Improve logging when -dm is specified: if the node is consideredMax Khon2007-04-201-8/+5
| | | | | | | | out-of-date print not only "modified before source" message but also the path of youngest source. Notes: svn path=/head/; revision=168893
* The caller of Var_Value() should not change the variable value. MakeHartmut Brandt2005-05-241-7/+7
| | | | | | | | | this clear by constifying the return value. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146581
* Get rid of the third argument to Var_Value() the pointer it pointedHartmut Brandt2005-05-241-12/+4
| | | | | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146580
* Move the definitions of the OP_* constants from make.h into GNode.hHartmut Brandt2005-05-101-0/+1
| | | | | | | | | | | where they actually belong to. Move the definitions of the strings for special macros like "$*" from make.h to parse.h - they're used only in the parser. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.211) Notes: svn path=/head/; revision=146066
* Style: indentation.Hartmut Brandt2005-04-011-459/+457
| | | | Notes: svn path=/head/; revision=144478
* Replace another bunch of Lst_ForEachs by LST_FOREACHs and simplify code.Hartmut Brandt2005-03-161-144/+98
| | | | Notes: svn path=/head/; revision=143694
* General whitespace cleanup: remove mixes of tabs and spaces, removeHartmut Brandt2005-02-041-1/+1
| | | | | | | | | space after function names, remove spaces on emtpy lines. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141270
* Clean up include files and file including. Split nonints.h into piecesHartmut Brandt2005-02-011-5/+14
| | | | | | | | | | | | | | | | 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
* Instead of dynamically allocating list heads allocated them staticallyHartmut Brandt2004-12-161-38/+35
| | | | | | | | | | | 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
* Get rid of the sequential access feature of the lists. This was usedHartmut Brandt2004-12-081-44/+36
| | | | | | | | | | | 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
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofHartmut Brandt2004-12-071-7/+7
| | | | | | | | | 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
* Make needs no circular lists so remove them from the list code.Hartmut Brandt2004-12-071-1/+1
| | | | Notes: svn path=/head/; revision=138510
* Style: remove a lot of unnecessary casts, add some and spell the nullHartmut Brandt2004-12-011-29/+29
| | | | | | | | | pointer constant as NULL. Checked by: diff -r on the object files before and after Notes: svn path=/head/; revision=138264
* Stylification: missing spaces, extra space after function names, castsHartmut Brandt2004-11-301-84/+93
| | | | | | | | | | | 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
* Add code to enforce the paralleism count (-j N) for the entire treePoul-Henning Kamp2004-11-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | of submakes spawned during processing. We create a fifo and stuff one character into it for each job we are allowed to run. The name of the fifo is passed to child processes in the MAKE_JOBS_FIFO environment variable. A make which finds this variable on startup will open the fifo and only spawn jobs when it managed to read a token from the fifo. When the job completes a token is writen back to the fifo. Slave make processes get one token for free: the one their parent make got in order to run them. This makes the make processes themselves invisible in the process counts. The net effect is that "make -j 12 -s buildworld" will start at most 12 jobs at the same time, instead of as previously up to 65 jobs would get started. Notes: svn path=/head/; revision=137606
* Remove efree(), it isn't used consistently enough to even pretend that itJuli Mallett2002-10-231-4/+4
| | | | | | | | | might help on the systems it could possibly be used as a bandaid for. In fact, the only thing it's useful for is instrumenting free(3) calls, and in that capacity, it's better served as a local patch, than a public wrapper. Notes: svn path=/head/; revision=105826
* Convert make(1) to use ANSI style function declarations. VariableJuli Mallett2002-10-091-34/+15
| | | | | | | | | | | | | | 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
* Code that has been #if0'd with the comment "WHY" since revision 1.1 canJuli Mallett2002-10-021-8/+1
| | | | | | | disappear. Notes: svn path=/head/; revision=104375
* Make make(1) WARNS=6 clean except for const issues. This mostly involvesJuli Mallett2002-09-281-3/+3
| | | | | | | | | | | | | | renaming variables to not shadow libc functions or greater scope locals. Kinda makes one wonder if the extern ones weren't meant in some of these places :) The only thing I'd still like to do WRT this is possibly combine rstat and status in compat.c -- that should be fine, as I do not think the codepaths will want both around at once. Sponsored by: Bright Path Solutions Notes: svn path=/head/; revision=104121
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichJuli Mallett2002-09-181-17/+17
| | | | | | | | 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
* Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingJuli Mallett2002-09-171-49/+25
| | | | | | | | | | | | 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
* Prefer BSDmakefile over makefile and Makefile.David E. O'Brien2002-04-131-1/+1
| | | | | | | | Submitted by: jmallett Obtained from: OpenBSD Notes: svn path=/head/; revision=94594
* Update SCM ID method.David E. O'Brien2002-04-131-3/+1
| | | | Notes: svn path=/head/; revision=94587
* De'register.David E. O'Brien2002-04-131-13/+13
| | | | Notes: svn path=/head/; revision=94584
* remove __PWarner Losh2002-03-221-6/+6
| | | | Notes: svn path=/head/; revision=92921
* There's also no point in #typedef'ing void/char pointers. Accordingly,Will Andrews2000-12-021-27/+27
| | | | | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD Notes: svn path=/head/; revision=69531
* There's no reason to use fancy forms of NULL. Replace all instancesWill Andrews2000-12-021-9/+9
| | | | | | | | | of NIL, NILLST, NILLGNODE, etc. with NULL. Obtained from: OpenBSD Notes: svn path=/head/; revision=69527
* Use __RCSID()Wilfredo Sanchez2000-07-091-6/+4
| | | | Notes: svn path=/head/; revision=62833
* Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)Tim Vanderhoek1999-09-111-2/+0
| | | | Notes: svn path=/head/; revision=51150
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-2/+2
| | | | Notes: svn path=/head/; revision=50477
* Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).Tim Vanderhoek1999-08-171-13/+15
| | | | | | | Obtained from: OpenBSD, sometimes indirected from NetBSD; myself Notes: svn path=/head/; revision=49938
* Revert $FreeBSD$ to $Id$Peter Wemm1997-02-221-1/+1
| | | | Notes: svn path=/head/; revision=23006
* Make the long-awaited change from $Id$ to $FreeBSD$Jordan K. Hubbard1997-01-141-1/+1
| | | | | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise. Notes: svn path=/head/; revision=21673
* O' to be bitten by CVS. Cleanup after importSteve Price1996-10-081-0/+2
| | | | | | | | | of Christos' version of make(1) and add Id's. Set straight by: Bruce Evans and Peter Wemm :) Notes: svn path=/head/; revision=18804
* Merge in NetBSD's changes to make(1). Changes include:Steve Price1996-10-061-3/+12
| | | | | | | | | | | | | | | | | | | - Add the .PHONY, .PARALLEL, and .WAIT directives - Added the -B and -m commandline flags - misc. man page cleanups - numerous job-related enhancements - removed unused header file (bit.h) - add util.c for functions not found in other envs. - and a few coordinated whitespace changes Special thanks to Christos Zoulas <christos@netbsd.org> for help in the merge. A 'diff -ur' between Net and FreeBSD now only contains sccsid-related diffs. :) Obtained from: NetBSD, christos@netbsd.org, and me Notes: svn path=/head/; revision=18730
* NetBSD fixes: declare more prototypes, move .OPTIONAL in alphabetAndrey A. Chernov1995-06-181-0/+2
| | | | | | | | | | | order, prevent suffix rule, if direct or children dependances exists, forget to free v->name in var.c My fixes: fix famous ^\t\n bug, correct free order in str_end Reviewed by: bde Obtained from: NetBSD, me Notes: svn path=/head/; revision=9254
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-18/+18
| | | | Notes: svn path=/head/; revision=8874
* Bring in a number of changes from NetBSD's make, fixing quite a fewJordan K. Hubbard1995-01-231-27/+67
| | | | | | | | | | | | | | | problems in the process: 1. Quoting should work properly now. In particular, Chet's reported bash make problem has gone away. 2. A lot of memory that just wasn't being free'd after use is now freed. This should cause make to take up a LOT less memory when dealing with archive targets. 3. Give proper credit to Adam de Boor in a number of files. Obtained from: NetBSD (and Adam de Boor) Notes: svn path=/head/; revision=5814
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+859
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590