summaryrefslogtreecommitdiff
path: root/usr.bin/make/job.c
AgeCommit message (Collapse)Author
2003-06-03Remove the advertising clause in the UCB license which BerkeleyTodd C. Miller
rescinded 22 July 1999. Proofed by myself and Theo.
2003-04-06get rid of some strcpy/sprintf.Marc Espie
ok krw@, matthieu@, deraadt@
2003-02-18intial -> initial;Jason McIntyre
the great intial witch hunt, as prompted by tdeval@ os-aix-dso.c: ok henning@ ab.C: ok drahn@
2002-07-31use fork, not vfork. seems to fix misterious trapframe trashing on hppa; ↵Michael Shalayeff
deraadt@ ok
2002-06-12a real pid_t cleanup.Mike Pechkin
espie@ ok for make/, deraadt@ one extra eye, millert@ ok
2002-03-19Kill remote comments, un-expose private code.Marc Espie
ok millert@
2002-03-02Kill JOB_REMIGRATE.Marc Espie
2002-03-02kill #ifdef REMOTE stuff that only obfuscates issues.Marc Espie
ok millert@, miod@
2001-11-17errno savingTheo de Raadt
2001-11-11Fixed version... don't see how this could work on i386, since it didn'tMarc Espie
initialize create in main.c.
2001-11-11undo changes that crash on (at least) the alphaTheo de Raadt
2001-11-11Redo LstInit as a macro: smaller and faster code in all cases, zeroing twoMarc Espie
pointers is simpler than calling a function. Recognize purely static lst headers, which don't really need any initialization. ok miod@
2001-09-04Replace the deprecated BSD sigsetmask/sigblock/sigpause functions with their ↵Todd C. Miller
POSIX counterparts.
2001-05-29Take includes out of lst.h, re-add what's needed to separate files.Marc Espie
Removes remaining lint stuff from lst.lib.
2001-05-23Mostly clean-up:Marc Espie
- cut up those huge include files into separate interfaces for all modules. Put the interface documentation there, and not with the implementation. - light-weight includes for needed concrete types (lst_t.h, timestamp_t.h). - cut out some more logically separate parts: cmd_exec, varname, parsevar, timestamp. - put all error handling functions together, so that we will be able to clean them up. - more systematic naming: functioni to handle interval, function to handle string. - put the init/end code apart to minimize coupling. - kill weird types like ReturnStatus and Boolean. Use standard bool (with a fallback for non-iso systems) - better interface documentation for lots of subsystems. As a result, make compilation goes somewhat faster (5%, even considering the largish BSD copyrights to read). The corresponding preprocessed source goes down from 1,5M to 1M. A few minor code changes as well: Parse_DoVar is no longer destructive. Parse_IsVar functionality is folded into Parse_DoVar (as it knows what an assignment is), a few more interval handling functions. Avoid calling XXX_End when they do nothing, just #define XXX_End to nothing. Parse_DoVar is slightly more general: it will handle compound assignments as long as they make sense, e.g., VAR +!= cmd will work. As a side effect, VAR++=value now triggers an error (two + in assignment). - this stuff doesn't occur in portable Makefiles. - writing VAR++ = value or VAR+ +=value disambiguates it. - this is a good thing, it uncovered a bug in bsd.port.mk. Tested by naddy@. Okayed millert@. I'll handle the fallback if there is any. This went through a full make build anyways, including isakmpd (without mickey's custom binutils, as he didn't see fit to share it with me).
2001-05-03Synch with my current work.Marc Espie
Numerous changes: - generate can build several tables - style cleanup - statistics code - use variable names throughout (struct Name) - recursive variables everywhere - faster parser (pass buffer along instead of allocating multiple copies) - correct parser. Handles comments everywhere, and ; correctly - more string intervals - simplified dir.c, less recursion. - extended for loops - sinclude() - finished removing extra junk from Lst_* - handles ${@D} and friends in a simpler way - cleaned up and modular VarModifiers handling. - recognizes some gnu Makefile usages and errors out about them. Additionally, some extra functionality is defined by FEATURES. The set of functionalities is currently hardcoded to OpenBSD defaults, but this may include support for some NetBSD extensions, like ODE modifiers. Backed by miod@ and millert@, who finally got sick of my endless patches...
2000-12-27Show CURDIR in that failure case too. Can't show a Makefile name yetMarc Espie
though... Ok'ed miod@.
2000-11-24Change the time stamp interface to use an abstract datatype.Marc Espie
Define two possible interfaces: the classic one, and the new one (used where available) that depends on timespec. Better granularity, make is now able to distinguish between files that were built during the same second.
2000-09-14Introduce a few macros to handle timestamps in an abstract way.Marc Espie
Replace the time stamp hash in dir.c with an open hashing structure. In doing so, remove some nasty casts, simplify code a bit: Dir_MTime can return a modification time, since make does not make a distinction between out-of-date and non-existent files.
2000-09-14Replace the old hash used to hold file names within a directory withMarc Espie
open hashing. An interesting optimization is that the open hashing interface is more fine-grained, hence we can compute the correct hash value at the start of Dir_FindFile, and reuse it for each hash structure into which we look (the effect is measurable on large directories along with objdir/VPATH). Remove a few unnecessary Lst_Open/Lst_Close that serve no purpose except obfuscating the code. The interface to dir.h changes slightly, hence tedious includes changes...
2000-09-14Some systematic clean-up.Marc Espie
- UNUSED macro that expands to __attribute__((unused)) for gcc - move rcsid around so that they can be tagged UNUSED. - activate -Wunused. - use UNUSED instead of kludgy junk for function arguments. - add extern to all extern prototypes. - update comments in lst.h. - clean up var.c a little bit, constifying arguments, updating comments...
2000-06-30Recognize `+cmd' as a command that should always be executed, even inMarc Espie
make -n mode. Currently works only in sequential make mode. In parallel make mode, it's just a no-op. Useful to debug recursive Makefiles, and part of POSIX.
2000-06-23This patch replaces str_concat with a slightly unobfuscated version.Marc Espie
In particular, Dir_MakeFlags is abusing str_concat, and works much better with buffers.
2000-06-23Once those special variable are taken care of, other Var functions can takeMarc Espie
the GNode's context directly. We rename that special Lst to `SymTable *' in prevision of things to come. Along the line, we lose the special GNodes affected to VAR_CMD, VAR_GLOBAL, VAR_ENV, which become simple Lsts... This is not a problem, except when getting to a context's name for debugging (handled very nicely by offsetof). Again, this is a preparatory patch, which does not gain anything except for cleaning up issues... Reviewed by millert@ and miod@, like the previous patch
2000-06-23Start of variable fixes and speed-ups.Marc Espie
This patch may seem a bit non-sensical at first. It simply introduces some new interface. Specifically, recognizes that some variable names (.TARGET/$@, .OODATE/$?, .ALLSRC/$>, .IMPSRC/$<, .PREFIX/$*, .ARCHIVE/$!, .MEMBER/$%) are `special' (the actual variables which are local to a target, e.g. GNode). Currently, The Varq functions (for Varquick access) are only stubs to the normal functions. This fixes a very important detail before proceeding to turn variable lists into hash tables: if every GNode holds a hash table, initialization times for those will be very costly. But generic GNodes only hold those seven special variables... which can be stored directly into a small array; the only general cases are the environment, the command line and global variables.
2000-06-23Trivial consequences of the previous list changes:Marc Espie
- audit code for Lst_Datum, it's never applied to an empty pointer, so check can be removed -> turn into a macro, - Lst_First, Lst_Last can become macro as well - specialized version of Lst_Succ (Lst_Adv) to use in loops where it cannot fail, - Lst_Open can no longer fail. Trim down corresponding code. Reviewed millert@, miod@
2000-06-17This patch introduces a distinction betweenMarc Espie
Lst_Init (constructor) and Lst_New (allocation + construction) Lst_Destroy (destructor) and Lst_Delete (deallocation + destruction), and uses that to turn most dynamic allocation of lists (Lst pointers) into static structures (LIST). Most of this is mundane, except for allGNs in targ.c, where the code must be checked to verify that Targ_Init is called soon enough. Lst_New is a temporary addition. All lists will soon be static. Reviewed by millert@, like the previous patch.
2000-06-10Clean-up patch: use `void *' instead of old-fashioned ClientData/Address.Marc Espie
2000-06-10Thus, Lst_ForEach no longer needs returning a status.Marc Espie
In fact, it can become a macro based on Lst_ForEachFrom. This also introduces Lst_Every, as a shortcut for the very common case where Lst_ForEach does not need any user data. Finally, make consistent use of a few function typedefs, instead of having explicit void (*)(Lst) arguments all over the place.
2000-06-10Lst_Find and Lst_ForEach do the same thing, except that the comparisonMarc Espie
sense is reversed (Lst_Find returns when proc says 0, whereas Lst_ForEach goes on while proc says 0). This patch turns a number of Lst_ForEach into Lst_Find. Specifically, all Lst_ForEach that actually may return quickly as proc does not always returns zero. Of course, the corresponding proc need to be tweaked to swap 0 and 1...
2000-03-26Remove idiotic, braindead casts T* -> void*Marc Espie
They serve no purpose, except hiding potential bugs. In particular, remove (ClientData) cast from macro, showing potentially troublesome use of Hashes to store time_t.
2000-03-26Passing an (int) instead of an (int*) won't work.Marc Espie
Those casts are evil...
2000-02-01no need to extern int errno if errno.h is includedTheo de Raadt
2000-01-20Fix problem pointed out by FreeBSD, regen temp file name each time, toMarc Espie
avoid races. Make use of basic Unix semantics, namely you can unlink a file while holding open fd on the data. Avoid all the mess of having to track useless file names around.
1999-12-19Rearrange Lst_Find interface to conform better with other functions.Marc Espie
1999-12-18Nothing ever checks ReturnStatus on Lst_Insert, Lst_Append, Lst_AtFront,Marc Espie
Lst_AtEnd, Lst_Concat, Lst_Remove, Lst_Replace. Don't bother returning one.
1999-12-18Lst_DeQueue already checks for empty lists.Marc Espie
1999-12-18NIL, NILGNODE, etc, are only glorified NULL.Marc Espie
Get rid of them. Get rid of list.h, nothing uses it anyway.
1999-12-18make does not use circular lists, get rid of the extra weight.Marc Espie
1999-12-16Var_Subst is actually two distinct functions folded into one:Marc Espie
split the function specific to for.c out, and give them more sensible arguments at the same time. This makes .for loop handling more efficient, as we have some heuristic to evaluate the size of the buffer needed...
1999-12-06Extra parameter no longer needed, ditch.Marc Espie
1999-11-11Kill Str_FindSubString, it's strstr.Marc Espie
1999-10-05Efficiency patch from NetBSD:Marc Espie
make spends time freeing data structures right before exiting. So don't bother. Keep the code inside #ifdef, so that it's still there if someone ever wants to use make code inside a library.
1998-12-05Modifications from netbsd:Marc Espie
- don't interfere with MACHINE/MACHINE_ARCH defines for bootstrap - type clean-up, time_t, and printing `unknown' ints - fix TARGET/MEMBER bug in archive rules - memmove... - cleaner Error handler. - reentrant brk_string - .MAKE env variable - preliminary scaffolding for .NOPATH Other improvements: - efree - shellneed streamlined - display Stop in .CURDIR after an error. - document most features and misfeatures. - add a few OpenBSD notes to the tutorial.
1998-07-13ftpd: sleep for an indeterminate amount for non-existant loginsTodd C. Miller
to simulate a crypt, like login does. Use SEEK_* not L_* and kill some 0L's used in lseek while we're there.
1998-06-03zero sigaction before useTheo de Raadt
1998-03-15fix possibility of null pointer deref when using make's "-j" option.flipk
1997-12-16do not overflow fd_setTheo de Raadt
1997-06-15Avoid possible /tmp races by using mkstemp(3).Todd C. Miller
1996-11-30Sync with NetBSD:Todd C. Miller
- Merge in FreeBSD and Lite2 changes. - Fix bug where a non-archive target with a .a suffix would always be considered to be out of date, since it does not have a TOC. - Fix NetBSD PR #2930: declare missing variable.