aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/arch.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old fmake. It wasn't built by default for some time. Users thatWarner Losh2015-06-161-1224/+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
* Spelling fixes for usr.bin/Ulrich Spörlein2011-12-301-5/+5
| | | | Notes: svn path=/head/; revision=228992
* - 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-1/+0
| | | | | | | Reviewed by: rodrigc Notes: svn path=/head/; revision=200417
* Catch up with r144020's /Dir_FindFile/Path_FindFile/David E. O'Brien2009-11-171-1/+1
| | | | Notes: svn path=/head/; revision=199419
* Use strlcpy() instead of manually setting the last byte of the array to \0.Xin LI2009-06-231-8/+4
| | | | Notes: svn path=/head/; revision=194797
* <limits.h> is necessary for using INT_MIN, so included it hereWarner Losh2008-03-041-0/+1
| | | | | | | | | | | explicitly rather than relying on name space pollution to pull it in for us. NB: The usage of INT_MIN is somewhat bogus and suspect to my eye, but this commit doesn't address that issue. Notes: svn path=/head/; revision=176799
* Get rid of the third argument to Var_Value() the pointer it pointedHartmut Brandt2005-05-241-10/+4
| | | | | | | | | to has always been set to NULL for some time now. Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=146580
* Fix a 64-bit warning by casting an int64_t to intmax_t and printing itHartmut Brandt2005-05-241-1/+2
| | | | | | | with %jd. Notes: svn path=/head/; revision=146577
* Get rid of the ReturnStatus obscuration that was anyway used onlyHartmut Brandt2005-05-181-14/+14
| | | | | | | | | | in two places. While here don't bother returning anything from Lst_Replace - nobody ever checks the return code. Suggested by: jmallet Notes: svn path=/head/; revision=146338
* 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
* Split Var_Subst() into two functions: Var_SubstOnly() which substitutesHartmut Brandt2005-05-091-2/+2
| | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=146027
* Almost complete rewrite of the archive code (except for the Makefile parsingHartmut Brandt2005-03-311-426/+489
| | | | | | | | | | | | | | | | | | | | | | | 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) Notes: svn path=/head/; revision=144387
* Make paths an explicite datatype instead of using the generic Lst.Hartmut Brandt2005-03-231-3/+3
| | | | | | | | | A Path is now a TAILQ of PathElements each of which just points to a reference counted directory. Rename all functions dealing with Paths from the Dir_ prefix to a Path_ prefix. Notes: svn path=/head/; revision=144020
* Remove the last two instances of Lst_Find() calls.Hartmut Brandt2005-03-221-23/+4
| | | | Notes: svn path=/head/; revision=143975
* Simplify buffer access by using Buf_Data() and Buf_Peel() whereHartmut Brandt2005-03-221-6/+2
| | | | | | | | | | | appropriate. Patch: 7.147-7.151 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=143959
* Ups. Revert the last commits. These have been committed by accident.Hartmut Brandt2005-03-151-450/+428
| | | | Notes: svn path=/head/; revision=143657
* modifier_M: instead of going through the string twice to compute theHartmut Brandt2005-03-151-428/+450
| | | | | | | | | | | size of the buffer we need, just allocate the possible maximum. Patch: 7.117 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=143656
* Style: remove unneeded parantheses in conditionals.Hartmut Brandt2005-03-031-8/+8
| | | | Notes: svn path=/head/; revision=143105
* Fix parsing of archives: in System V archive format the member namesHartmut Brandt2005-03-031-2/+4
| | | | | | | | | is terminated with a slash. Although we are not System V, ar has been configured to put that slash in. This format allows filenames with trailing spaces. Notes: svn path=/head/; revision=143102
* Make sure the length variable is initialized to 0 before passingHartmut Brandt2005-03-011-2/+2
| | | | | | | | | | | it to Var_Parse(). Patch: 7.85 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=142937
* Change the return value of Var_Subst to return a Buffer insteadHartmut Brandt2005-02-251-8/+18
| | | | | | | | | | | of a char *. Patch: 7.49 Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=142457
* Fix the indendation of some multi-line comments.Hartmut Brandt2005-02-231-22/+22
| | | | | | | Noted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=142297
* Style: fix indendation to be 8 and use tabulators. Fix lines longer thanHartmut Brandt2005-02-211-664/+688
| | | | | | | | 80 characters and slightly reorder functions to get rid of static prototypes. Notes: svn path=/head/; revision=142173
* Fix a bug in handling archive members: when a member was not foundHartmut Brandt2005-02-211-15/+11
| | | | | | | | | | | when looking into an already hashed archive, the code tried to use the name shortened to the maximum length allowed for the archive. Unfortunately it passed a buffer of junk to the hashing routine when the name actually wasn't too long. Theoretically this could lead to a false positive. Notes: svn path=/head/; revision=142165
* Fix spacing by converting mixes of space and tab to tab. Also add a numberHartmut Brandt2005-02-101-4/+4
| | | | | | | | | of empty lines in appropriate places. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141648
* General whitespace cleanup: remove mixes of tabs and spaces, removeHartmut Brandt2005-02-041-65/+64
| | | | | | | | | space after function names, remove spaces on emtpy lines. Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141270
* Replace space, tab mixes by tabs.Hartmut Brandt2005-02-041-5/+5
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141259
* Some more easy constification.Hartmut Brandt2005-02-041-5/+7
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141252
* Clean up include files and file including. Split nonints.h into piecesHartmut Brandt2005-02-011-16/+23
| | | | | | | | | | | | | | | | 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
* Remove all the cleanup functions. There is no reason to free memoryHartmut Brandt2004-12-171-55/+0
| | | | | | | | just before exiting (especially given the number of memory leaks) - it just costs time. Notes: svn path=/head/; revision=138972
* Instead of dynamically allocating list heads allocated them staticallyHartmut Brandt2004-12-161-16/+12
| | | | | | | | | | | 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-8/+1
| | | | | | | | | | | 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
* Constify the arguments to the list compare function. This temporarilyHartmut Brandt2004-12-081-3/+3
| | | | | | | | | | | requires to make a copy of the filename in ReadMakefile and to duplicate two small functions in suff.c. This hopefully will go away when everything is constified. Submitted by: Max Okumoto <okumoto@ucsd.edu> (partly) Notes: svn path=/head/; revision=138561
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofHartmut Brandt2004-12-071-6/+6
| | | | | | | | | 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-2/+2
| | | | Notes: svn path=/head/; revision=138510
* Fix breakage introduced on 64-bit platforms with my last commit. NeedHartmut Brandt2004-12-031-3/+3
| | | | | | | to change to size_t in a couple of other places too. Notes: svn path=/head/; revision=138346
* Style: remove a lot of unnecessary casts, add some and spell the nullHartmut Brandt2004-12-011-18/+19
| | | | | | | | | 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-125/+121
| | | | | | | | | | | 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
* Fix a bug that would truncate the full name of an archive member ifHartmut Brandt2004-11-291-2/+5
| | | | | | | | | | | the length of happens to be larger than MAXPATHLEN. PR: bin/74368 Submitted by: Max Okumoto <okumoto@ucsd.edu> Obtained from: DragonFlyBSD Notes: svn path=/head/; revision=138196
* Remove efree(), it isn't used consistently enough to even pretend that itJuli Mallett2002-10-231-6/+6
| | | | | | | | | 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-48/+28
| | | | | | | | | | | | | | 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
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichJuli Mallett2002-09-181-7/+7
| | | | | | | | 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-20/+15
| | | | | | | | | | | | 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
* #define<space> -> #define<tab>Juli Mallett2002-09-171-4/+4
| | | | Notes: svn path=/head/; revision=103503
* Use %zu to print size_t.Juli Mallett2002-07-151-2/+2
| | | | Notes: svn path=/head/; revision=100036
* Expand a buffer to reduce diffs to NetBSD.Juli Mallett2002-06-201-2/+2
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=98501
* Diff reduction for great justice against NetBSD, cast to unsigned char whenJuli Mallett2002-06-201-3/+3
| | | | | | | passing an argument to isspace(3). Notes: svn path=/head/; revision=98500
* String lengths and sizeof()s are size_t not int. Mark an unused parameterJuli Mallett2002-06-121-2/+2
| | | | | | | | | of ReadMakefile as __unused, it's there because this function is used by the abstracted list interface which normally deals with item handlers which take two arguments. Add a missing static prototype. Notes: svn path=/head/; revision=98138
* Update SCM ID method.David E. O'Brien2002-04-131-3/+1
| | | | Notes: svn path=/head/; revision=94587