aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/main.c
diff options
context:
space:
mode:
authorHartmut Brandt <harti@FreeBSD.org>2005-03-31 11:35:56 +0000
committerHartmut Brandt <harti@FreeBSD.org>2005-03-31 11:35:56 +0000
commit5e0a7a4450451bda66e317850c184b73d4541420 (patch)
tree00483b8a6fa6456801e4dbcabddb39b1a6cfb3d8 /usr.bin/make/main.c
parentae6bff540a123c63b06decd39688b650e832dc7e (diff)
downloadsrc-5e0a7a4450451bda66e317850c184b73d4541420.tar.gz
src-5e0a7a4450451bda66e317850c184b73d4541420.zip
Almost complete rewrite of the archive code (except for the Makefile parsing
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
Notes: svn path=/head/; revision=144387
Diffstat (limited to 'usr.bin/make/main.c')
-rw-r--r--usr.bin/make/main.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/make/main.c b/usr.bin/make/main.c
index b2c33797c163..6e0ac8c2c514 100644
--- a/usr.bin/make/main.c
+++ b/usr.bin/make/main.c
@@ -188,9 +188,14 @@ MainParseArgs(int argc, char **argv)
int c;
optind = 1; /* since we're called more than once */
-#define OPTFLAGS "BC:D:E:I:PSV:Xd:ef:ij:km:nqrstv"
+#define OPTFLAGS "ABC:D:E:I:PSV:Xd:ef:ij:km:nqrstv"
rearg: while((c = getopt(argc, argv, OPTFLAGS)) != -1) {
switch(c) {
+
+ case 'A':
+ arch_fatal = FALSE;
+ MFLAGS_append("-A", NULL);
+ break;
case 'C':
if (chdir(optarg) == -1)
err(1, "chdir %s", optarg);
@@ -718,10 +723,9 @@ main(int argc, char **argv)
compatMake = TRUE;
/*
- * Initialize archive, target and suffix modules in preparation for
+ * Initialize target and suffix modules in preparation for
* parsing the makefile(s)
*/
- Arch_Init();
Targ_Init();
Suff_Init();