Commit Graph

225 Commits

Author SHA1 Message Date
christos ff08129ca5 strftime is not needed for svr4 machines; also fix the prototype footprint. 1998-10-18 14:24:16 +00:00
christos 3b7c5b4ed8 Only define const and volatile when __STDC__ is not defined (for BOOTSTRAP) 1998-10-18 14:23:48 +00:00
wsanchez 65b6624a6d Include sys/types.h 1998-10-13 17:09:16 +00:00
wsanchez 8a6084908f Use __ARCHITECTURE__, if defined, as MACHINE_ARCH 1998-10-13 17:08:34 +00:00
christos 82ee767393 Fix conditional variable expression parsing (reported by cgd) 1998-09-18 20:35:11 +00:00
christos 1b24c735a6 PR/6162: Greg A. Woods: pmake does not add suffix rules if gnodes have children.
This is traditional make behavior (Solaris make does the same), but
	 GNU does not. Lets see what breaks.
1998-09-18 20:20:52 +00:00
christos aed39ca72c PR/6174: ITOH Yasufumi: Purify bug and a compile error in utility code. 1998-09-18 20:15:36 +00:00
christos 8bd03e9aab - Add {.,}[s-]include for silent include file failures
- Make traditional include statement include more than one file if present
  on the line.

Keeping up with the other's :-)
1998-08-06 13:42:22 +00:00
christos ea21627e65 Fix access to freed memory; pointed out by Todd Miller. 1998-07-04 21:53:11 +00:00
christos 076a184bb0 PR/5690: Wolfgang Rupprecht: deleting a suffix that has 0 source references
causes core-dump. Fix: when an unused suffix gets removed, delete
	 it from the suffix list.
1998-07-02 23:30:18 +00:00
tv f0dcde8323 Make a MAKE_BOOTSTRAP case work on NetBSD, too, for cross-compile cases 1998-05-21 17:19:46 +00:00
cgd b374e69f29 in Var_Parse(), set delim in a couple of other paths into cleanup 1998-04-03 04:07:15 +00:00
kleink fb7502608a Need <time.h> for time() prototype. 1998-04-02 10:33:17 +00:00
christos 84e525a801 Add conditional variable evaluation from Alistair Crooks. 1998-04-01 14:18:10 +00:00
christos d611392726 PR/5225: Jason Thorpe: make with -j 4 and subdirs core-dumps.
This revealed another long standing problem with pmake's port to bsd.
.MAKE was not set as the manual page states. Set it and remove another
typo in my last commit.
1998-03-28 22:29:04 +00:00
christos f46f2d693e PR/5210: Hauke Fath: make core dumps with .SHELL
Unfortunately this revealed a deeper problem with the brk_string code.
To fix it:
	- remove sharing of the buffer between brk_string invocations
	- change the semantics of brk_string so that the argument array
	  starts with 0, and return the buffer where the strings are
	  stored
1998-03-26 19:20:36 +00:00
fair 78f41cb540 patch from PR#3573 to rename a variable "main" to "mainList" 1998-03-23 08:52:48 +00:00
hubertf 51dc9a9405 Fix typos from PR 5055 by NAKAJIMA Yoshihiro <nakayosh@kcn.or.jp>. 1998-02-24 18:34:31 +00:00
christos 79400c03dd Y2K fixes: use strftime(), and add a fake strftime() for systems that do
not have it.
1998-02-04 14:47:39 +00:00
thorpej f04b8efed3 Change an exit() to _exit(), so that it's safe for vfork(). 1997-12-31 06:06:12 +00:00
lukem 8640f5d0af getopt returns -1 not EOF, use memmove instead of bcopy 1997-11-08 09:33:15 +00:00
lukem 8ba07ab0b3 use CPPFLAGS instead of CFLAGS 1997-10-24 09:00:17 +00:00
lukem 6d1c625f54 fix up .Nm usage 1997-10-19 05:05:24 +00:00
lukem 00c29d5afe don't define WARNS=1 here 1997-10-19 04:23:02 +00:00
mikel d9c915fd1a add missing .Nm argument 1997-10-12 05:51:47 +00:00
mycroft e96e918e60 Use bsd.subdir.mk as appropriate. 1997-10-11 09:34:07 +00:00
thorpej 75b410b331 If printing a u_long, use the %lu format. 1997-10-03 17:58:00 +00:00
enami 5a3584034e Make this compile on NetBSD/alpha; use %ld and cast to u_long to print
a variable of type size_t.
1997-10-03 16:06:26 +00:00
lukem 2ba9e97765 wrap #include <sys/cdefs.h>, __RCSID(...) stuff in #ifndef MAKE_BOOTSTRAP 1997-09-28 03:30:58 +00:00
christos a004ae7f41 PR/4140: David A. Holland: use svr4 style archives for ELF environments 1997-09-26 13:29:05 +00:00
fair 7eaeaff5f2 fix some ints that should be "time_t" per PR#4139 1997-09-23 21:15:07 +00:00
christos 7b8cd5e6e3 Expand variables within variables correctly; eg.
foo.123=abc
bar=123
all:
	echo ${foo.${bar}}
1997-09-22 17:11:12 +00:00
kleink 66105c37fc Lseek(2) usage cleanup: the use of L_SET/L_INCR/L_XTND is deprecated,
use SEEK_SET/SEEK_CUR/SEEK_END instead.
1997-08-25 19:31:43 +00:00
christos 87d111ebee #if __STDC__ -> #ifdef __STDC__ 1997-07-11 20:17:37 +00:00
christos 4507c82bcc sprintf -> vsprintf 1997-07-11 20:16:01 +00:00
christos 487628a792 Fix memory corruption that was caused by debugging code leftovers. 1997-07-10 00:54:44 +00:00
christos e2d4e7ccc8 PR/3825: David A. Holland: global regexp handling gets stuck in infinite loop.
Actually there were two bugs:
	- Add REG_NOTBOL after the first substitution.
	- Handle the rm_so == rm_eo == 0 case, where in a substitution such
	  as 's/bzzzt/z*/g' the first time z* matches nothing.
1997-07-07 19:06:17 +00:00
christos 254d64f064 Add WARNS=1
RCSID police
1997-07-01 21:17:00 +00:00
christos 9981dd99c2 Apparently, using _doprnt(_IOREAD) to emulate vsnprintf() on SVR4 *sometimes*
core-dumps; use sprintf()+strlen() for now.
1997-06-07 16:42:31 +00:00
christos 702a3f7097 Deal with archive.a(member.o) nodes when expanding .USE dependencies or
adding children to .OODATE.
1997-06-07 16:41:09 +00:00
christos fab62ec0e9 Don't confuse `member' with `target' 1997-06-07 16:39:45 +00:00
pk 3552d54978 Erase spurious character. 1997-05-26 23:07:31 +00:00
pk 7abb0d066d Minor formatting glitch. 1997-05-26 21:04:28 +00:00
mycroft c19bda7d4c Check the .PHONY attribute... 1997-05-20 22:53:30 +00:00
christos 041c0c5158 Change the way curdir is handled [this started at the previous version]...
Instead of adding it in .PATH, handle it specially the same way as "." is
handled.
1997-05-09 17:05:59 +00:00
mycroft f88245a571 Make sure to propagate OP_PHONY to all cohorts that already existed. 1997-05-09 04:08:26 +00:00
mycroft 8aed472136 Fix description of .NOPATH. 1997-05-08 22:34:34 +00:00
gwr bf6930a26c Add the new .NOPATH feature which can be used to disable .PATH search
for particular targets, i.e. .depend, objects, etc.  (from Christos).
1997-05-08 21:24:41 +00:00
gwr 10e180cc49 Back out the .PATH.c changes. The .depend problem (and others)
will be fixed using the new .NOPATH make feature instead.
1997-05-08 21:11:01 +00:00
cjs 90423c173a If the -m option is used, make will check for the existence of the
directory specified, and add it to sysIncPath only if it exists.
However, afterwards make tested for the presence of a -m option by
checking to see if sysIncPath was an empty list, and assumed that
the -m option was not used if it was empty. This obviously breaks
if -m specified a non-existent directory. So I have added a flag
that is set if the -m option is used, and I test that instead.
1997-05-08 05:19:46 +00:00
mycroft 01925a4fb0 Copy the .PHONY attribute to the cohorts of a double dependency. 1997-05-07 13:12:33 +00:00
mycroft a66a01875e Ignore `-t' when the .MAKE attribute is set. 1997-05-07 07:31:37 +00:00
mycroft 755bc65362 Make sure `-n' is actually disabled for targets with the .MAKE attribute. 1997-05-06 23:51:29 +00:00
mycroft b160845c38 Document .PHONY better. 1997-05-06 22:29:43 +00:00
mycroft 5be8dcf32a Don't do a suffix search for a .PHONY target. 1997-05-06 22:06:58 +00:00
mycroft bcc725c5e3 Don't do a VPATH or .PATH search for .PHONY targets. (From Christos.) 1997-05-06 20:59:42 +00:00
mycroft 0997556292 Don't touch .PHONY targets. 1997-05-06 20:57:47 +00:00
gwr 012e528f2e Use .PATH.c: ... 1997-05-06 20:44:56 +00:00
christos 193e8d1b7d - Target searching addition:
Make used to only use the search path for nodes that were pure
	sources (not targets of other sources). This has been corrected
	and now gnu-autoconf generated Makefiles work in directories other
	than the source one.

- Suffix transformation rescanning:
	Suffix transformations (.c.o:; cc ...) were only recognized in
	the past when both suffixes were members of the suffix list.
	Thus a sequence like:
		.z.b:
			echo ${.TARGET}
		.SUFFIXES: .z
	would cause .z.b: to be inserted as a regular target (and the main
	target in this case). Other make programs always add rules that
	start with a period in the transformation list and never consider
	them as targets. We cannot do that (consider .depend files) so we
	resort to scanning the list of the current targets every time a
	suffix gets added, and we mutate existing targets that are now
	valid transformation rules into transformation rules. If the
	transformed target was also the main target, we set the main target
	to be the next target in the targets list.
1997-05-02 14:24:27 +00:00
christos 6cfa2388a9 Make used to add every directory where it found files in the search path.
I.e. if you had a line in your Makefile:
	../foo.o: foo.c
`..' would be added in the search path. The addition of such paths has
been now disabled. If a pathname contains a slash, then the directory
where such a file is found is not added to the search path. Of course
this eliminates most (all?) use of this function.
1997-05-02 14:23:51 +00:00
mellon 64b4faf663 Don't look at archive information on platforms that run ELF binaries 1997-04-26 07:11:14 +00:00
christos e5c746f479 Don't disable wildcards completely; they are used by other Makefiles. 1997-03-29 16:51:26 +00:00
christos bdae19cbd2 Make sure that the children of nodes that are marked .MADE, are marked
UPTODATE and their timestamps are consistent.
1997-03-28 22:31:21 +00:00
christos b4fe701a22 - Disable globbing for targets/dependencies when POSIX is defined.
- Fix globbing so that patterns that don't have a matching number of [] or {}
  don't get expanded. (before the [ case got expanded to nothing!) This is
  disabled.
1997-03-27 17:20:18 +00:00
gwr f17ca2c65c Do not compile-in ${MACHINE} (as per PR#3386, OK'ed by christos) 1997-03-24 20:56:36 +00:00
christos 69ad8a6988 Locate all the children of a node marked as MADE. 1997-03-23 01:25:28 +00:00
christos 161ba8eea5 Fix problems in the RE substitution error handling. 1997-03-18 19:24:46 +00:00
christos dd0a1d0814 Add a .MADE directive to indicated that the children of a target are
up-to-date, even when they are not. This is to simulate our current
make install behavior with proper dependencies.
1997-03-10 21:19:49 +00:00
christos 4417c4f61f Reported by cgd: fix .USE directive problems:
1. ${.*} variables did not get expanded in dependencies.
    2. expanded ${.*} variables in .USE dependencies can cause tree
       restructuring; handle it.
    3. in compat mode, expand .USE before evaluating the list of targets,
       instead of doing .USE expansions on demand, because they can cause
       tree restructuring.
1997-02-20 16:51:47 +00:00
christos b210ac559b make $MACHINE_ARCH settable from the environment. 1997-01-28 23:58:00 +00:00
christos f73f9b0103 Don't compile the regex code if MAKE_BOOTSTRAP (from gwr) 1996-12-31 18:03:30 +00:00
christos 4442744d56 BSD did not traditionally have <sys/cdefs.h>; use BSD4_4 instead and include
<sys/param.h> to grab it.
1996-12-31 18:02:22 +00:00
christos 59a3352108 implement snprintf() and vsnprintf() for non BSD4_4 systems. 1996-12-31 17:56:04 +00:00
christos e43039b92f add a missing 'static' decl. 1996-12-31 17:55:28 +00:00
christos 9a2fab368e define const and volatile for non __STDC__ 1996-12-31 17:55:02 +00:00
christos 87961728d3 - include <stdlib.h> to get getenv() prototype on SVR4
- if __STDC__ -> ifdef __STDC__ to appease SVR4
1996-12-31 17:54:16 +00:00
christos 9749ddca0f Use only integral types in procedure arguments. 1996-12-31 17:53:21 +00:00
christos 36d9e80aff Use explicit .c.o rule so that the bootstrap process works. 1996-12-31 17:52:23 +00:00
christos 8819044d2a [initial version of the substitution/regexp changes were courtesy of Der Mouse]
- fix the variable substitution code in make [PR/2748]
      1. change s/a/b/ so that it substitutes the first occurance of the
	 pattern on each word, not only the first word.
      2. add flag '1' to the variable substitution so that the substitutions
	 get performed only once.

  ***THIS IS AN INCOMPATIBLE CHANGE!***

  Unfortunately there was no way to make things consistent without
  modifying the current behavior. Fortunately none of our Makefiles
  depended on this.

	    OLD:

		VAR      = aa1 aa2 aa3 aa4

		S/a/b/   = ba1 aa2 aa3 aa4
		S/a/b/g  = bb1 bb2 bb3 bb4

	    NEW:

		VAR      = aa1 aa2 aa3 aa4

		S/a/b/   = ba1 ba2 ba3 ba4
		S/a/b/1  = ba1 aa2 aa3 aa4
		S/a/b/g  = bb1 bb2 bb3 bb4
		S/a/b/1g = bb1 aa2 aa3 aa4

- add regexp variable substitution via 'C/foo/bar/' [PR/2752]

- add variable quoting via the ${VAR:Q} modifier. This is useful when running
  recursive invocations of make(1):

	make VAR=${VAR:Q}

  will always work... (This may prove useful in the kernel builds...) [PR/2981]
1996-12-24 17:36:27 +00:00
christos 2f197a9f4d Fir PR/2930: declare missing variable. 1996-11-11 15:16:10 +00:00
christos aa49881371 - 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.
1996-11-06 17:58:58 +00:00
thorpej dff3ccad44 Fix extra "make:" and newline in error message.
From enami tsugutomo <enami@ba2.so-net.or.jp>, PR #2651.
1996-09-27 02:36:58 +00:00
christos 453e90716c - Fix bug where the first line after a conditionally skipped was not ready
in its entirety if it contained a continuation.
- Print the whole error line, not just the first 20 characters of it.
1996-09-13 04:22:09 +00:00
christos bb97544b1b Fix bug reported by Greg Hudson where leaf (source only) nodes were
referenced only by their basename and not by their full pathname. This
breaks when .PATH or MAKEOBJDIR are used. There might be Makefiles around
that try to work around this bug by prepending ${.CURDIR} to the sources,
and they should be found and fixed. Also a lot of the gunk in suff.c that
was attempting to work around the same problem could be removed.
1996-08-30 23:21:10 +00:00
thorpej bbb4184355 Tidy up some RCS ids a bit. 1996-08-30 17:59:37 +00:00
christos 091b5c0118 Add estrdup(), a checked version of strdup and use it. 1996-08-13 16:42:00 +00:00
christos 22770fe8ea Add strdup() since ultrix is missing it.
From Larry Schwimmer <rosebud@cyclone.Stanford.EDU>
1996-08-13 16:41:15 +00:00
christos ba78477e9d Various cleanups from: Larry Schwimmer <rosebud@cyclone.Stanford.EDU> 1996-08-13 16:40:31 +00:00
christos 1bc899a1ff Protect __P from being multiply defined (for systems that already define it) 1996-08-13 16:39:30 +00:00
christos 15d37e3539 Recognize SVR4 style long filename entries in archives. 1996-06-02 21:09:33 +00:00
christos 62be8b7e25 Fix bug where make will always exit with 0, even when one or more parallel
jobs failed. (Only affects parallel make code)
1996-05-29 15:28:05 +00:00
christos 5c1983c016 - Move -D flags from Makefile to config.h and explain what they do. Add
-Wall -Wno-unused to CFLAGS. Add new define SYSVVARSUB to enable SysV
  style variable substitutions and enable them.
- Add SunOS style command substitutions via SUNSHCMD
- Fix core dump with '{variable = value'
1996-05-28 23:34:35 +00:00
jtc cf957d3a75 Changed to use 1900 + tm_year instead of hardcoding "19" as the century.
From PR #2308 by Stephen J. Roznowski <sjr@zombie.ncsc.mil>.
1996-04-08 18:57:49 +00:00
christos c7f6ddc626 make emalloc and erealloc return void *; closes PR/2276 1996-03-31 21:30:05 +00:00
jtc fea2f4c4ca Added erealloc() function that calls enomem() if the allocation fails
(this is like the existing emalloc() function).  Changed all realloc()
calls to erealloc().
1996-03-29 02:17:13 +00:00
christos 0acf990595 Add PHONY attribute and target. This is the first step to cleanup the
xinstall and xlint crud.
1996-03-15 21:52:32 +00:00
christos 6750270dc6 data and date aren't the same... 1996-03-12 18:04:27 +00:00
christos 57cad0d107 Jonathan Stone's fixes:
main.c:	Remove double include of <sys/resource.h>; if MACHINE is defined, use
	that instead of uname.
Makefile: Add util.c.
1996-03-11 13:45:31 +00:00
christos 9779dee0b1 Fix PR/2118; apply sysincludes patch. 1996-03-06 00:15:17 +00:00
christos 1b11cdf58d if PR/2090, sysvinclude too optimistic, did not check for space after the
include keyword
1996-02-17 13:28:09 +00:00