summaryrefslogtreecommitdiffstats
path: root/usr.bin/make
Commit message (Collapse)AuthorAgeFilesLines
* Style: remove spaces before tabs.harti2005-05-101-31/+31
| | | | | Patch: 7.207 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move the remaining two prototypes from nonints.h to make.h andharti2005-05-105-53/+3
| | | | | | | remove nonints.h. Patch: 7.204 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Make shellPath and shellName static - they're used in job.c only.harti2005-05-104-12/+10
| | | | | | | Move definition of parsing error levels from make.h into parse.h. Patches: 7.202,7.203 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Make the three versions of fork() more uniform.harti2005-05-101-63/+63
| | | | | Patch: 7.201 (idea taken, but done differently) Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move the defines for TMPPAT and KQUEUE from the public job.h into job.charti2005-05-102-12/+12
| | | | | | | since they are used only there. Patch: 7.200 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Merge compat.c into job.c. There is a lot in common between theseharti2005-05-106-820/+709
| | | | | | | files and we are going to factor this out. Patch: 7.199 (slightly changed) Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move Cmd_Exec() from main.c to job.c and fix its prototype. Thisharti2005-05-105-110/+114
| | | | | | | results in a warning that will go away soon. Patch: 7.198 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Var_SubstOnly() is only used to subsitute a variable from the globalharti2005-05-103-4/+4
| | | | | | | | context (and only in one place to substitute the .for variable). Therefor there is no need to pass the context as a parameter. Patch: 7.197 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move the declaration of VAR_CMD and VAR_GLOBAL from globals.h to var.hharti2005-05-102-6/+6
| | | | | Patch: 7.196 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Clean up comments. No code changes.harti2005-05-101-194/+128
| | | | | Patch: 7.195 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Merge var_modify.c into var.c and move types and function declarationsharti2005-05-104-691/+602
| | | | | | | that are now used only in var.c from var.h to var.c Patches: 7.193,7.194 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Move some debugging code from targ.c to var.c where it actually belongs.harti2005-05-103-10/+14
| | | | | Patch: 7.192 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Make make a little bit more POSIXish with regard to option parsing:harti2005-05-103-12/+64
| | | | | | | | | | | | | | | 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>
* Split Var_Subst() into two functions: Var_SubstOnly() which substitutesharti2005-05-099-163/+174
| | | | | | | | | | only one variable and Var_Subst() which substitutes all. Split out the test whether a variable should not be expanded into match_var(). Make access to the input string consistently using str[]. Remove two unused functions: Var_GetTail() and Var_GetHead(). Patches: 7.184-7.189 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Introduce a new pseudo-target .EXPORTVAR which allows to put aharti2005-05-065-94/+119
| | | | | | | | | | | | | | | | | | make macro into the environment of programs executed by make. This has approximately the same function as gmake's export directive. The form of a pseudo target was deliberately choosen to minimize work for POSIX compatibility (Makefiles are not allowed to use any targets starting with a dot and consisting only of uppercase letters except those specified in the standard when they want POSIX compatible behaviour, so such a Makefile can never contain .EXPORTVAR.) Change the handling of macros coming from the environment: instead of asking the environment for each variable we could not find otherwise put all the environment variables in a special variable environment just at start up. This has been tested on the ports cluster by kris. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Rename the directive_hash.[ch] files to hash_tables.[ch] nowharti2005-04-294-11/+10
| | | | | | | that there are more than one hash table in them. There is no history to preserve here, so go without a repo-copy. Asked for by: Max Okumoto <okumoto@ucsd.edu>
* Implement a pseudo-target .WARN that allows toggeling the warning flagsharti2005-04-296-32/+109
| | | | | for the current make. This does not override flags specified on the command line and these settings are not passed to sub-makes.
* Introduce a flag to enable extended warnings (-x) and make them offharti2005-04-284-8/+31
| | | | | by default. This should fix the problem of getting lots of errors when building with an up-to-date make and old *.mk files.
* Use a minimal perfect hash for the special sources/targets too. Addharti2005-04-284-49/+114
| | | | the corresponding magic to create the hash function to the Makefile.
* Fix the $$FreeBSD$$ that should be written verbatim to directive_hash.charti2005-04-282-2/+2
| | | | so that it doesn't get replaced with the Makefile's revision.
* Move the hash function for directives into its own file and addharti2005-04-284-67/+160
| | | | | | | | | a Makefile target to re-created this file. Note, that there is no explicite dependency to automatically re-create the file, because this is needed only when the directive table changes and it requires the (yet to come) devel/mph port. Submitted by: Max Okumoto <okumoto@ucsd.edu> (first version)
* Split VarFind() into a series of functions tailored for the different setsharti2005-04-131-70/+94
| | | | | | | | | of flags originally passed to VarFind(). This eliminates the code by removing a bunch of tests. Patch: 7.173 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Parse_Init() is gone so remove comments that mention it.harti2005-04-111-11/+0
|
* Remove an unneccesary forward declaration for MainParseArgs().harti2005-04-111-20/+34
| | | | | | | | | | getopt() may be called several times - make sure to set optreset to reset it. Cleanup handling of non-option arguments. Remove some misleading comments. Patch: 7.171 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Remove the call to Parse_Init() - there is no need to initializeharti2005-04-111-2/+0
| | | | | a static variable to NULL. Forgot this in the previous commit to parse.[ch].
* Rework the directive parsing code. Instead of using a lot of strcmp()sharti2005-04-116-599/+673
| | | | | | | | | | | | on every line that starts with a dot use a minimal perfect hash function and a single strcmp() on the first word after the dot to find out whether it is really a directive call and, if yes, which one. Then directly dispatch to a handler function for that directive (or fall through to the dependency handling code). This makes the directive parse a little bit more strict about the syntax: the directive word must be followed by a character that is not alphanumerical and not an underline (making .undefFOO illegal); .endif and .else can only be followed by comments.
* Move the code for parsing .for and .if statements to the place where theharti2005-04-081-56/+42
| | | | other directives are handled.
* When Parse_Error is called after the top-level Makefile is closed weharti2005-04-071-3/+7
| | | | | | | have no CURFILE anymore so we cannot print a file name or line number. When ParseSkipLine() returns NULL (it does this when it has detected an EOF in an .if block) try to pop the input stack and process the next line
* Handle popping of the input stack in ParseReadLine() instead ofharti2005-04-071-341/+329
| | | | | | Parse_File(). Remove a comment and a piece of code comming from ancient times when the if-directive read like #if and not .if. Correctly analyze the first character of a line.
* Mostly stylistic changes: remove the noPLen field from the Shellharti2005-04-071-64/+67
| | | | | | structure - it is just the strlen() of noPrint. Inline JobCondPassSig() in the only function JobPassSig() using it. Fix the argument types of JobPrintCommand(). Better parsing for the .SHELL target keywords.
* There is not much sense in having an else after Punt() and _exit() whichharti2005-04-051-48/+56
| | | | never return. Also use pid_t for variables holding PIDs.
* Put parantheses into 'if (foo && bar & flag)'. While they are not strictlyharti2005-04-051-2/+2
| | | | needed, they are useful for the human reader.
* Remove lots if irritating parantheses and fix two comments.harti2005-04-051-28/+28
| | | | Checked by: md5
* Remove the definition for STATIC and just use static.harti2005-04-051-10/+8
|
* Remove unneccessary local prototypes.harti2005-04-051-7/+0
|
* The static tfile is used only in one single function so move it into thatharti2005-04-051-6/+1
| | | | function.
* The tfile field of struct Job isn't used anymore since revision 1.22 soharti2005-04-051-3/+0
| | | | remove it now.
* Use a type-safe intrusive list to put jobs on the jobs or stoppedJobs listharti2005-04-011-40/+36
| | | | instead of the generic Lst.
* Remove a forward declaration that isn't needed anymore.harti2005-04-011-1/+0
|
* Both struct Job and struct Shell are only used inside job.c so there isharti2005-04-012-171/+172
| | | | | no need to have them in a header file that is included by other modules. Move them both into the c-file.
* Style: fix indentation.harti2005-04-011-357/+349
|
* Style: fix indentation.harti2005-04-011-63/+51
|
* Style: indentation.harti2005-04-011-475/+473
|
* Style: Indentation.harti2005-04-011-133/+133
|
* Style: fix indentation.harti2005-04-011-886/+875
|
* Style: fix indentation.harti2005-04-011-202/+179
|
* Style: fix indentation.harti2005-04-011-307/+268
|
* Style: fix indentation.harti2005-04-011-1882/+1818
|
* Document the new -A flag for ignoring archive errors.harti2005-03-311-2/+5
|
* Almost complete rewrite of the archive code (except for the Makefile parsingharti2005-03-313-431/+500
| | | | | | | | | | | | | | | | | | | | part). Archive handling was broken at least since the move from BSD ar/ranlib to GNU binutils because of the different archive format. This rewrite fixes this by making make to carry around the defines for all formats (it supports) so it can support all of them independent of the actually used one. The supported formats are: traditional BSD (this seems to come from V7 at least, short names only and __.SYMDEF), BSD4.4 (long names with #1/ and __.SYMDEF) and SysV (extra name table and //). The only format not supported are broken traditional archives where the member names are truncated to 15 characters. Errors in the archive are not ignored anymore, but cause make to stop with an error message. The command line option -A causes these errors to become non-fatal. This is almost compatible with previous usage except for the error message printed in any case. Use a type-safe intrusive list for the archive cache. Reviewed by: Max Okumoto <okumoto@ucsd.edu> (without new error handling)
OpenPOWER on IntegriCloud