aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old fmake. It wasn't built by default for some time. Users thatWarner Losh2015-06-161-1339/+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
* Remove fictitious support for 80386-class CPUs from bsd.cpu.mk and make(1).Jung-uk Kim2012-12-031-1/+1
| | | | | | | | | It was removed from head more than 8 years ago (see r137784 and r137785). Reviewed by: imp, delphij, dim Notes: svn path=/head/; revision=243831
* Map foreign architecture names to FreeBSD naming convention.Robert Millan2012-01-201-0/+17
| | | | | | | Approved by: kib (mentor) Notes: svn path=/head/; revision=230392
* Spelling fixes for usr.bin/Ulrich Spörlein2011-12-301-6/+6
| | | | Notes: svn path=/head/; revision=228992
* Remove hack needed by 6.x machines and older machines to run newerWarner Losh2010-10-061-22/+1
| | | | | | | | | makes on FreeBSD/pc98. The need for this hack has passed. If you are one of the rare people that may need this, then you should setenv MACHINE=pc98 as a workaround. Notes: svn path=/head/; revision=213494
* Use more portable errx instead of errc. The latter doesn't buy usWarner Losh2010-10-061-4/+2
| | | | | | | | anyting anyway, since the error EAGAIN's error message doesn't add anything to the error strings that are there now. Notes: svn path=/head/; revision=213493
* Remove yet another vestage of alpha support.Warner Losh2010-04-061-2/+0
| | | | Notes: svn path=/head/; revision=206241
* Add ability to search up the directory hierarchy for the system directory.David E. O'Brien2010-01-041-9/+43
| | | | | | | | | | 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
* Reset UPTODATE gnodes after remaking makefiles when makeMax Khon2009-10-181-15/+21
| | | | | | | | is not going to be restarted: such nodes could be marked UPTODATE without doing rebuild due to remakingMakefiles being TRUE. Notes: svn path=/head/; revision=198199
* Avoid infinite loops when remaking makefiles not onlyMax Khon2009-04-071-35/+3
| | | | | | | for Makefile targets but also for targets they depend on. Notes: svn path=/head/; revision=190821
* Remove duplicate OPTFLAGS definition.Max Khon2009-02-021-1/+0
| | | | Notes: svn path=/head/; revision=188001
* Sort the options, per style(9).Warner Losh2009-02-021-24/+25
| | | | | | | Reviewed by: obrien@ Notes: svn path=/head/; revision=187995
* David doesn't consider the prior -s behavior a bug. Back out thisWarner Losh2009-01-311-1/+0
| | | | | | | change. Notes: svn path=/head/; revision=187968
* Unbreak make -s. There's about a 10% performance improvement with -sWarner Losh2009-01-301-0/+1
| | | | | | | | | in many environments. The recent --- blah --- reintroduction has killed. That output makes almost no sense when all the other output is silenced. Notes: svn path=/head/; revision=187921
* Don't enable -Q by default - I've fixed the rescue build issue.David E. O'Brien2009-01-131-1/+2
| | | | Notes: svn path=/head/; revision=187132
* + Add the -Q be-quiet flag for parallel jobs.David E. O'Brien2009-01-031-1/+7
| | | | | | | | - Enable -Q by default for the moment - there is something weird going on in the rescue build. Notes: svn path=/head/; revision=186713
* 1. Add the ability to tweak the token output before targets in job mode.David E. O'Brien2008-12-291-0/+10
| | | | | | | | | | | | | | | E.g., .MAKE.JOB.PREFIX=${.newline}---[${.MAKE.PID}] would produce ---[1234] target --- 2. Added ${.newline} as a simple means of being able to include '\n' in the assignment of .MAKE.JOB.PREFIX Obtained from: NetBSD Notes: svn path=/head/; revision=186559
* Exit with error code 2 when run with -k (continue if errors) and build failed.Max Khon2008-12-181-5/+8
| | | | Notes: svn path=/head/; revision=186279
* Add POSIX -p flag to make(1).Ed Schouten2008-07-301-3/+9
| | | | | | | | | | | | | | | | | | | This article [1] describes the -p flag for make(1): Write to standard output the complete set of macro definitions and target descriptions. The output format is unspecified. We already support a similar flag (-d g1), but unlike -p, it still executes commands. Our implementation just turns it into -d g1, but also sets flag `printGraphOnly', which will cause make(1) to skip execution. [1] http://www.opengroup.org/onlinepubs/009695399/utilities/make.html Reviewed by: imp PR: standards/99960 Notes: svn path=/head/; revision=181021
* If the special target .MAKEFILEDEPS exists, then enable theDavid E. O'Brien2008-03-121-1/+2
| | | | | | | | "remaking makefiles" feature. Otherwise, follow traditional Pmake behavior. (hash table will be regenerated and committed follow this commit) Notes: svn path=/head/; revision=177101
* The non-POSIX environment variable MAKE was supersededYaroslav Tykhiy2008-03-051-1/+1
| | | | | | | | | by MAKEFLAGS ages ago, so don't mention it in comments. Tested with: cmp(1) Notes: svn path=/head/; revision=176842
* Don't forget to set MAKEFLAGS in the childs' environmentYaroslav Tykhiy2008-03-051-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from the .MAKEFLAGS global variable even if it's empty or unset. This means setting MAKEFLAGS to just an empty string in the latter case. If not doing so, make(1) behaved inconsistently WRT MAKEFLAGS. In particular, it would let a `-f foo' option down to sub-makes if .MAKEFLAGS was unset. E.g., env MAKEFLAGS="-f mymakefile" make would pass `-f mymakefile' down to sub-makes via their environment (unless mymakefile added something to .MAKEFLAGS). But any additional options appearing would change this behaviour to not passing `-f mymakefile' to sub-makes, as in: env MAKEFLAGS="-f mymakefile" make -D DUMMY or env MAKEFLAGS="-f mymakefile -D DUMMY" make (unless mymakefile cleared .MAKEFLAGS). Also make(1) would leave MAKEFLAGS at its initial value if the makefile set .MAKEFLAGS to an empty value. I.e., it was impossible to override MAKEFLAGS with an empty value. (Note well that makefiles are not to touch MAKEFLAGS directly, they alter .MAKEFLAGS instead. So make(1) can filter out things such as -f when copying MAKEFLAGS to .MAKEFLAGS at startup. Direct modifications to MAKEFLAGS just go nowhere.) While the original intentions of the BSD make authors are somewhat unclear here, the bug proves that NOT passing -f options down is the settled behaviour because the opposite behaviour is totally unreliable in the presence of any other options. In addition, not passing down -f's found in the environment is consistent with doing so WRT the command line. Update the manpage accordingly and make the whole description of MAKEFLAGS and .MAKEFLAGS more consistent as this change indeed brings more consistency into the reliable behaviour of make(1). Submitted by: ru (main.c) Tested with: make world Notes: svn path=/head/; revision=176839
* Note 7.0 was the first version that FreeBSD/pc98 had a MACHINE of pc98Warner Losh2008-03-041-8/+7
| | | | | | | instead of i386. Notes: svn path=/head/; revision=176786
* Fix -jX when makefiles are remade.Max Khon2007-11-251-0/+16
| | | | Notes: svn path=/head/; revision=173919
* Change directory back to ${.CURDIR} when remaking Makefiles.Max Khon2007-06-011-1/+9
| | | | | | | Pointed out by: ru Notes: svn path=/head/; revision=170179
* When remaking makefiles check that mtime has actually changed.Max Khon2007-04-201-3/+14
| | | | | | | | | | | | | | | | | | | | This fixes infinite restart in the following case: Makefile: foo foo: bar do-something Unlike GNU make, BSD make considers "Makefile" node as remade even if "foo" is up-to-date and was not actually rebuilt. GNU make does not consider nodes without commands as remade if child nodes were not actually rebuilt. Most probably, more proper fix would be to bring BSD make behaviour in-line with GNU make but this would be more intrusive change. Notes: svn path=/head/; revision=168892
* Implement "Remaking Makefiles" feature:Max Khon2007-03-081-6/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | After reading Makefile and all the files that are included using .include or .sinclude directives (source Makefiles) make considers each source Makefile as a target and tries to rebuild it. Both explicit and implicit rules are checked and all source Makefiles are updated if necessary. If any of the source Makefiles were rebuilt, make restarts from clean state. To prevent infinite loops the following source Makefile targets are ignored: - :: targets that have no prerequisites but have commands - ! targets - targets that have .PHONY or .EXEC attributes - targets without prerequisites and without commands When remaking a source Makefile options -t (touch target), -q (query mode), and -n (no exec) do not take effect, unless source Makefile is specified explicitly as a target in make command line. Additionally, system makefiles and .depend are not considered as a Makefiles that can be rebuilt. Reviewed by: harti Notes: svn path=/head/; revision=167330
* whitespace fixingDavid E. O'Brien2006-07-171-8/+8
| | | | Notes: svn path=/head/; revision=160442
* Prepare for MACHINE and hw.machine switching to "pc98" on FreeBSD/pc98.Ruslan Ermilov2005-12-051-16/+11
| | | | | | | Reviewed by: nyan Notes: svn path=/head/; revision=153115
* Quickly fix brokeness in revision 1.157, that change wasDavid Xu2005-12-011-4/+4
| | | | | | | | free()ing stack memory which causes the program to abort, and I can no longer make buildworld. Notes: svn path=/head/; revision=152982
* - match_var: do not address memory at invalid address (`len' can be greaterMax Khon2005-11-301-2/+4
| | | | | | | | | | | | than strlen(var) + 1) - ReadMakeFile: prevent `fname' memory leak - ReadMakeFile: prevent double free (caused by double fclose) -- ParsePopInput() closes input file Reviewed by: harti Notes: svn path=/head/; revision=152969
* Fix the type of the variable 'debug'. It is used as a bitmap, so theHartmut Brandt2005-09-071-1/+1
| | | | | | | | | | | type should be int rather than Boolean. PR: bin/84528 Submitted by: Max Okumoto <okumoto@ucsd.edu> MFC after: 3 weeks Notes: svn path=/head/; revision=149844
* The caller of Var_Value() should not change the variable value. MakeHartmut Brandt2005-05-241-1/+1
| | | | | | | | | 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-3/+2
| | | | | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146580
* Factor out all the .SHELL parsing related stuff into its own file andHartmut Brandt2005-05-241-0/+1
| | | | | | | | | | rename the function to be consistent with the naming scheme in the rest of make. No functional changes. Obtained from: DragonFlyBSD (idea and most of shell.h) Notes: svn path=/head/; revision=146572
* Before doing any parsing parse the builtin shell specifications andHartmut Brandt2005-05-241-0/+7
| | | | | | | | | | | | | | | | | | | | | | | set the current shell to DEFSHELL. Put all these specifications into a list. Add user specified new shells to this list. If the user just selects one of the already know shells just pick the right one off the list. This let's one do something like: # Full specification of the user's shell. This also selects the shell. .SHELL: name=myshell path=/somewhere/foo echo=loud ... FOO != bar # use myshell here .SHELL: name=sh BAR != baz # use /bin/sh here .SHELL: name=myshell # no need for full spec here. # continue to use the user's special shell. Notes: svn path=/head/; revision=146560
* Get rid of global variables for argument vectors produced by brk_string()Hartmut Brandt2005-05-181-7/+5
| | | | | | | | | | | introduce a struct that holds all the information about an argument vector and pass that around. Author: Max Okumoto <okumoto@ucsd.edu> Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146345
* Make sure machine is initialize before use. Also make two pointers constHartmut Brandt2005-05-121-4/+5
| | | | | | | to get rid of the last two const warnings. Notes: svn path=/head/; revision=146157
* Cleanup. Move initialisation of file and program global variablesHartmut Brandt2005-05-121-56/+56
| | | | | | | | | | to top of main() and sort them. Make chdir_verify_path() static - it is used only here. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.238) Notes: svn path=/head/; revision=146146
* Replace a lot of Var_Set(..., VAR_GLOBAL) by Var_SetGlobal().Hartmut Brandt2005-05-121-18/+18
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.237) Notes: svn path=/head/; revision=146145
* Cleanup main(). Move catching SIGCHLD into job.c. Move unsetenv("ENV")Hartmut Brandt2005-05-121-53/+29
| | | | | | | | | | | into job.c. Move retrieving of environment nearer to the place where it is actually used and invert the preprocessor conditionals to use positive logic. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.236) Notes: svn path=/head/; revision=146144
* Reshuffle functions to get rid of prototypes.Hartmut Brandt2005-05-121-108/+102
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.235) Notes: svn path=/head/; revision=146143
* Move variable printing from main.c to var.cHartmut Brandt2005-05-121-28/+1
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.233) Notes: svn path=/head/; revision=146141
* Fix the fix for bin/72510 applied in job.c:1.70. Actually there haveHartmut Brandt2005-05-121-4/+5
| | | | | | | | | | | | | been two maxJobs variables: one static in job.c and one global used in main.c and parse.c. Makeing one global out of these was the wrong way to fix the problem. Instead rename the global one to jobLimit and keep maxJobs static in job.c. Suggested by: rwatson PR: bin/72510 Notes: svn path=/head/; revision=146140
* Move some global variables to the correct files.Hartmut Brandt2005-05-121-3/+0
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.232) Notes: svn path=/head/; revision=146134
* Path_Expand() expects its first argument to be writeable so put theHartmut Brandt2005-05-101-1/+2
| | | | | | | | | | default system directory into a writeable character array before passing it to Path_Expand(). Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.210) Notes: svn path=/head/; revision=146064
* Move the remaining two prototypes from nonints.h to make.h andHartmut Brandt2005-05-101-1/+0
| | | | | | | | | | remove nonints.h. Patch: 7.204 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=146060
* Merge compat.c into job.c. There is a lot in common between theseHartmut Brandt2005-05-101-1/+0
| | | | | | | | | | files and we are going to factor this out. Patch: 7.199 (slightly changed) Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=146056
* Move Cmd_Exec() from main.c to job.c and fix its prototype. ThisHartmut Brandt2005-05-101-109/+0
| | | | | | | | | | results in a warning that will go away soon. Patch: 7.198 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=146054
* Make make a little bit more POSIXish with regard to option parsing:Hartmut Brandt2005-05-101-4/+18
| | | | | | | | | | | | | | | | | | take everything after -- as either a macro assignment or a target. Note that make still reorders arguments before --: anything starting with a dash is considered an option, anything which contains an equal sign is considered a macro assignment and everything else a target. This still is not POSIX with regard to the options, but it will probably not change because it has been make's behaviour for ages. Add a new function Var_Match() that correctly skips a macro call by just doing the same as Var_Subst() but without producing output. This will help making the parser more robust. Patches: 7.190,7.191 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=146038