summaryrefslogtreecommitdiff
path: root/usr.bin/make
AgeCommit message (Collapse)Author
2008-01-29A few changes:Marc Espie
- expand commands earlier, so that we can eventually scan them to take smarter decisions. - clean up the select() mask code and rename variables to sensible things. - quite a few minor renames for readability - erecalloc - clean up wait status handling, do not try to rebuild wait status, but instead parse it early and deal with the parsed code. tested by lots of people, thanks guys!
2008-01-12better error reporting/job handling error:Marc Espie
- systematically reorder jobs based on who did output last, so that the last job to output is *first* to output again. - better reaction to errors: any job that outputs is checked for termination directly, and the Error message is printed right afterwards. - better error messages, giving more useful information in -j mode.
2008-01-12new function: lstRequeue, to be used by the job handlerMarc Espie
2008-01-10fix stupid typo in grouping, make PWD work correctly again.Marc Espie
Found out by Christian Ehrhardt.
2008-01-02fix obvious bug in .NODEFAULT handlingMarc Espie
2007-12-31if our node doesn't have a lineno/fname, inherit from `used' node.Marc Espie
This lets suffix rules finally print out where they come from...
2007-12-10zap field nothing uses.Marc Espie
2007-12-01zap trailing whitespace;Jason McIntyre
2007-12-01I was sure I had committed this already, grrrr.Marc Espie
Anyways, switch to a growable array for job to do. Allows us to randomize it. fix manpage. do not add delay if just one job to run.
2007-11-28grrrMarc Espie
2007-11-28debug scaffolding: allows the insertion of a random delay before firing upMarc Espie
jobs in parallel mode.
2007-11-28PHONY targets never correspond to real files.Marc Espie
2007-11-26keep unmade uptodate all the time, even for targets we're not making yet,Marc Espie
since we might want to make them later. okay millert@, beck@
2007-11-24more parallel make fixes.Marc Espie
Preparations to fix the engine: - new function has_been_built(gn), that tells you what's the status of a given node. Allows us to run Suff_FindDeps later, by updating the number of unmade children correctly. - take out the code that handles shell expansions in an expand_children* set of functions, called by Suff_FindDeps, among others. These must be called early in the engine to avoid creating bogus nodes. Engine fixes: - take the predecessor/successor special handling out, deal with it in separate functions. - don't count nodes. Explicitly track them all in a hash table (better way to deal with non-built issues). - don't run Suff_FindDeps at start, but just before building an actual node. This allows make to find all dependencies correctly, as in groff. Pfiou! now it works.
2007-11-18simplify, no sense to break just to do return afterwardsMarc Espie
2007-11-17simplify dynamic variable handling a great deal:Marc Espie
first remove all usage of Varq_Append by building the string directly. then replace `common' handling with specialized handling for dynamic strings (since they no longer need a buffer). Finally, identify the place where the variable value needs to be copied because it's going to be free'd or erased soon, and finally, use simple char* pointers. Shaves about 80 bytes off every gnode structure, and kills quite a few unnecessary malloc()s as well.
2007-11-17.PHONY targets should not look at files.Marc Espie
2007-11-17read only .depend if !make(depend)Marc Espie
On the basis that: - .depend is a bsd extension anyways, changing its semantics doesn't affect posix compliance. - it may allow regenerating broken .depend files without needing to remove them. approved by miod@, millert@, deraadt@.
2007-11-10UNMADE -> UNKNOWNMarc Espie
2007-11-10clearer debug codeMarc Espie
2007-11-10rename make -> must_make, made -> built_statusMarc Espie
to make them easier to find in source files.
2007-11-06bug-fix: try the empty suffix when we cannot find any transformation, notMarc Espie
when we cannot find any suffix. This allows Makefiles like: .SUFFIXES: .in .sh all: truc.sh truc.sh.in: echo "bonjour" >$@ .in: sed -e 's/a/b/' <$< >$@ to work (before that, the empty suffix would not be tried, since truc.sh matches the .sh suffix, even though there is NO transformation).
2007-11-06simplify the way we deal with implicit rules and handle $<.Marc Espie
Having an `iParents' field is actually backwards, it's ways simpler to store the pointer in the child, as an impliedsrc, and to set the variable just in time along with all the rest in DoAllVar. This is simpler, and it should allow us to call SuffFindDeps much later.
2007-11-06get make.c in a more readable state, by extracting code into separateMarc Espie
functions. Restore a big more debug: if DEBUG(JOB), print commands (unexpanded).
2007-11-04prevent gcc from complainingMarc Espie
2007-11-03fix some lint FALLTHROUGHTheo de Raadt
2007-11-03#ifdef stuff that is only used under #ifdef; ok espieTheo de Raadt
2007-11-03remove extraneous space;Jason McIntyre
2007-11-03simplify: Job_CheckCommands deals with silent and ignerr now, so there'sMarc Espie
no need to duplicate that info at the job level since we can just use the gn->type.
2007-11-03zap dead codeMarc Espie
2007-11-03token is a confusing name, rename to bannerMarc Espie
2007-11-03document that .ORDER only means something in parallel modeMarc Espie
2007-11-03do the silent/ignore check in Job_CheckCommands, so that make -j4 -s worksMarc Espie
2007-11-03fix an obnoxious bug: in parallel mode, dieing in the job controller is notMarc Espie
the same as dieing in a sub job, since waiting on sub-jobs won't work. So keep track of who we are via a state variable.
2007-11-03suff.c sets IMPSRC correctly, whereas this is bogus and strips the pathMarc Espie
a lot of the time.
2007-11-03zap confusing old commentMarc Espie
2007-11-03mark nodes as made when there is no command around the target.Marc Espie
real files get updated anyways, but phony nodes stay around as unmade, which breaks things in subtle ways, since parallel mode just assumes things get built.
2007-11-02sort arguments;Jason McIntyre
2007-11-02Work done at p2k7.Marc Espie
This is a really big step towards getting parallel make to work. Note that this is not yet complete. There are still a few `details' to fix before this works 100%. Specifically: sequential make (compat) and parallel make don't use the same engine, and the parallel engine still has a few limitations. For instance, some known issues: - parallel make does not deal with .phony targets correctly all the time. - some errors are deadly in parallel make mode. - parallel make NEEDS way more sturdy correspondance of file system paths and target names, since it often needs to match dependencies to targets before the corresponding files exist. - some local variables like $* get set in a bogus way in some cases. - suffix handling has issues, especially related to the NULL suffix. So, if you find stuff that does NOT yet work with parallel make, don't go blindly try to fix the Makefile. It's very likely you might have stumbled into a make bug. (unless you really, really, understand Makefiles, DON'T GO CHANGING THEM YET). Tested by lots of people, thanks go to miod@, and robert@ among other people. Quick summary of what this does: - remove `saving commands' extension (it's not really usable, nor used) - move compat job runner and parallel interrupt handling into engine.c - tweak the code so that both compat and parallel mode use the same job runner and the same interrupt handling. Remove the other one. - optimize job runner so that, in parallel mode, the last command does not fork if we can avoid it (as it's already running in a sub shell). - scrape all the code that dealt with creating shell scripts from commands. - scrape all the code that dealt with recognizing special sequences in command output to print/not print output. - fix the parallel job pipe to not keep around file descriptors that are not needed. - replace the parallel job buffering with a nicer one, that deals with non-blocking descriptors to try to agregate as much output from one job in one go (greed) to unconfuse the users. - create two pipes per job, so that stdout and stderr stay separate. - make job token printing a debug option. - always use the parallel job-runner to `execute' commands, even if we just print them out. - store list of errors encountered during parallel make running, and print them on exit, so that we know what went wrong. - add a dirty hack to targ.c to deal with paths produced by gccmakedep.
2007-10-27fix indentationMarc Espie
2007-10-24fix logic of command line/ MAKEFLAGS parsing.Marc Espie
Forces make to see the -j4 in MAKEFLAGS and to actually pass it to submakes
2007-10-23Fix CLEANFILESMiod Vallat
2007-10-14allows node to be run twice, by not destroying the cmdnode contents.Marc Espie
This way, you can run `make .BEGIN'. Okay, this will run .BEGIN twice.
2007-10-09factor out identical codeMarc Espie
2007-10-09cut up JobStart, prepare the job to be run in a separate functionMarc Espie
2007-10-09don't bother returning anything from JobStart, we don't look at it anywaysMarc Espie
2007-10-09minor refactor: introduce function start_queued_job, to make it more apparentMarc Espie
JobStart and JobRestart often do the same thing. Move JobMakeArgv call around for similar reasons. Introduce new list (queuedJobs) we don't use yet.
2007-10-09rename jobs to more descriptive runningJobs (and easier to grep)Marc Espie
2007-10-09just-in-time signal handling: do not setup the handlers until we need them.Marc Espie
2007-10-09rename functions for clarity.Marc Espie
Add a global `got_signals' to quick-path thru handle_all_signals. remove most of the #ifdef USE_PGRP cruft: always be ready to handle those signals, just do not define a handler for them yet.