Fix some documentation gitches.

Fix an uninitialized variable.
Add builtin rules for Objective C.
Add a new debug line that shows where the commands that are about to be run
were defined.
This commit is contained in:
Paul Smith 2007-05-11 20:57:21 +00:00
parent 52ebc531ce
commit eda0e24ccd
6 changed files with 76 additions and 46 deletions

View File

@ -1,3 +1,19 @@
2007-05-11 Paul Smith <psmith@gnu.org>
* job.c (new_job): Add debug info to specify where make found the
command script it is running to build a target.
Fixes Savannah bug #18617.
* default.c (default_suffixes,default_suffix_rules,default_variables):
Add support for Objective C. Fixes Savannah bug #16389.
Based on a patch provided by Peter O'Gorman <peter@pogma.com>.
* function.c (func_lastword): Initialize p.
* doc/make.texi (Eval Function, Implicit Variables, Special Targets):
Doc fixes noticed by Bob <twobanjobob@sbcglobal.net>. Patch from
Dave Korn <dave.korn@artimi.com>
2007-05-08 Paul Smith <psmith@gnu.org> 2007-05-08 Paul Smith <psmith@gnu.org>
Fix Savannah bug #19656: Fix Savannah bug #19656:

View File

@ -41,11 +41,11 @@ static char default_suffixes[]
.s .ss .i .ii .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \ .s .ss .i .ii .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .cweb .web .com .sh .elc .el"; .w .ch .cweb .web .com .sh .elc .el";
#elif defined(__EMX__) #elif defined(__EMX__)
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \ = ".out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S \
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \ .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .web .sh .elc .el .obj .exe .dll .lib"; .w .ch .web .sh .elc .el .obj .exe .dll .lib";
#else #else
= ".out .a .ln .o .c .cc .C .cpp .p .f .F .r .y .l .s .S \ = ".out .a .ln .o .c .cc .C .cpp .p .f .F .m .r .y .l .ym .yl .s .S \
.mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \ .mod .sym .def .h .info .dvi .tex .texinfo .texi .txinfo \
.w .ch .web .sh .elc .el"; .w .ch .web .sh .elc .el";
#endif #endif
@ -192,6 +192,8 @@ static char *default_suffix_rules[] =
"$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@", "$(LINK.cpp) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".f", ".f",
"$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@", "$(LINK.f) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".m",
"$(LINK.m) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".p", ".p",
"$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@", "$(LINK.p) $^ $(LOADLIBES) $(LDLIBS) -o $@",
".F", ".F",
@ -221,6 +223,8 @@ static char *default_suffix_rules[] =
"$(COMPILE.cpp) $(OUTPUT_OPTION) $<", "$(COMPILE.cpp) $(OUTPUT_OPTION) $<",
".f.o", ".f.o",
"$(COMPILE.f) $(OUTPUT_OPTION) $<", "$(COMPILE.f) $(OUTPUT_OPTION) $<",
".m.o",
"$(COMPILE.m) $(OUTPUT_OPTION) $<",
".p.o", ".p.o",
"$(COMPILE.p) $(OUTPUT_OPTION) $<", "$(COMPILE.p) $(OUTPUT_OPTION) $<",
".F.o", ".F.o",
@ -249,15 +253,18 @@ static char *default_suffix_rules[] =
#endif #endif
".l.c", ".l.c",
"@$(RM) $@ \n $(LEX.l) $< > $@", "@$(RM) $@ \n $(LEX.l) $< > $@",
".ym.m",
"$(YACC.m) $< \n mv -f y.tab.c $@",
".lm.m",
"@$(RM) $@ \n $(LEX.m) $< > $@",
".F.f", ".F.f",
"$(PREPROCESS.F) $(OUTPUT_OPTION) $<", "$(PREPROCESS.F) $(OUTPUT_OPTION) $<",
".r.f", ".r.f",
"$(PREPROCESS.r) $(OUTPUT_OPTION) $<", "$(PREPROCESS.r) $(OUTPUT_OPTION) $<",
/* This might actually make lex.yy.c if there's no %R% /* This might actually make lex.yy.c if there's no %R% directive in $*.l,
directive in $*.l, but in that case why were you but in that case why were you trying to make $*.r anyway? */
trying to make $*.r anyway? */
".l.r", ".l.r",
"$(LEX.l) $< > $@ \n mv -f lex.yy.r $@", "$(LEX.l) $< > $@ \n mv -f lex.yy.r $@",
@ -398,9 +405,11 @@ static const char *default_variables[] =
# else # else
"CXX", "gcc", "CXX", "gcc",
# endif /* __MSDOS__ */ # endif /* __MSDOS__ */
"OBJC", "gcc",
#else #else
"CC", "cc", "CC", "cc",
"CXX", "g++", "CXX", "g++",
"OBJC", "cc",
#endif #endif
/* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist, /* This expands to $(CO) $(COFLAGS) $< $@ if $@ does not exist,
@ -468,6 +477,8 @@ static const char *default_variables[] =
"LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)", "LINK.o", "$(CC) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", "COMPILE.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)", "LINK.c", "$(CC) $(CFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"LINK.m", "$(OBJC) $(OBJCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", "COMPILE.cc", "$(CXX) $(CXXFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",
"COMPILE.C", "$(COMPILE.cc)", "COMPILE.C", "$(COMPILE.cc)",
"COMPILE.cpp", "$(COMPILE.cc)", "COMPILE.cpp", "$(COMPILE.cc)",
@ -476,6 +487,8 @@ static const char *default_variables[] =
"LINK.cpp", "$(LINK.cc)", "LINK.cpp", "$(LINK.cc)",
"YACC.y", "$(YACC) $(YFLAGS)", "YACC.y", "$(YACC) $(YFLAGS)",
"LEX.l", "$(LEX) $(LFLAGS) -t", "LEX.l", "$(LEX) $(LFLAGS) -t",
"YACC.m", "$(YACC) $(YFLAGS)",
"LEX.m", "$(LEX) $(LFLAGS) -t",
"COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c", "COMPILE.f", "$(FC) $(FFLAGS) $(TARGET_ARCH) -c",
"LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)", "LINK.f", "$(FC) $(FFLAGS) $(LDFLAGS) $(TARGET_ARCH)",
"COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c", "COMPILE.F", "$(FC) $(FFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c",

View File

@ -2940,10 +2940,6 @@ makefile, then all prerequisite lists defined @emph{after} it appears
will be expanded a second time after all makefiles have been read in. will be expanded a second time after all makefiles have been read in.
@xref{Secondary Expansion, ,Secondary Expansion}. @xref{Secondary Expansion, ,Secondary Expansion}.
The prerequisites of the special target @code{.SUFFIXES} are the list
of suffixes to be used in checking for suffix rules.
@xref{Suffix Rules, , Old-Fashioned Suffix Rules}.
@findex .DELETE_ON_ERROR @findex .DELETE_ON_ERROR
@item .DELETE_ON_ERROR @item .DELETE_ON_ERROR
@cindex removing targets on failure @cindex removing targets on failure
@ -8390,17 +8386,18 @@ implemented in @code{make} as suffix rules, so which ones will be
defined depends on the @dfn{suffix list} (the list of prerequisites of defined depends on the @dfn{suffix list} (the list of prerequisites of
the special target @code{.SUFFIXES}). The default suffix list is: the special target @code{.SUFFIXES}). The default suffix list is:
@code{.out}, @code{.a}, @code{.ln}, @code{.o}, @code{.c}, @code{.cc}, @code{.out}, @code{.a}, @code{.ln}, @code{.o}, @code{.c}, @code{.cc},
@code{.C}, @code{.cpp}, @code{.p}, @code{.f}, @code{.F}, @code{.r}, @code{.y}, @code{.C}, @code{.cpp}, @code{.p}, @code{.f}, @code{.F}, @code{.m},
@code{.l}, @code{.s}, @code{.S}, @code{.mod}, @code{.sym}, @code{.def}, @code{.r}, @code{.y}, @code{.l}, @code{.ym}, @code{.lm}, @code{.s},
@code{.h}, @code{.info}, @code{.dvi}, @code{.tex}, @code{.texinfo}, @code{.S}, @code{.mod}, @code{.sym}, @code{.def}, @code{.h},
@code{.texi}, @code{.txinfo}, @code{.w}, @code{.ch} @code{.web}, @code{.info}, @code{.dvi}, @code{.tex}, @code{.texinfo}, @code{.texi},
@code{.sh}, @code{.elc}, @code{.el}. All of the implicit rules @code{.txinfo}, @code{.w}, @code{.ch} @code{.web}, @code{.sh},
described below whose prerequisites have one of these suffixes are @code{.elc}, @code{.el}. All of the implicit rules described below
actually suffix rules. If you modify the suffix list, the only whose prerequisites have one of these suffixes are actually suffix
predefined suffix rules in effect will be those named by one or two of rules. If you modify the suffix list, the only predefined suffix
the suffixes that are on the list you specify; rules whose suffixes fail rules in effect will be those named by one or two of the suffixes that
to be on the list are disabled. @xref{Suffix Rules, ,Old-Fashioned are on the list you specify; rules whose suffixes fail to be on the
Suffix Rules}, for full details on suffix rules. list are disabled. @xref{Suffix Rules, ,Old-Fashioned Suffix Rules},
for full details on suffix rules.
@table @asis @table @asis
@item Compiling C programs @item Compiling C programs
@ -8731,21 +8728,11 @@ Program for compiling assembly files; default @samp{as}.
Program for compiling C programs; default @samp{cc}. Program for compiling C programs; default @samp{cc}.
@pindex cc @pindex cc
@item CO
@vindex CO
Program for checking out files from RCS; default @samp{co}.
@pindex cc
@item CXX @item CXX
@vindex CXX @vindex CXX
Program for compiling C++ programs; default @samp{g++}. Program for compiling C++ programs; default @samp{g++}.
@pindex g++ @pindex g++
@item CO
@vindex CO
Program for extracting a file from RCS; default @samp{co}.
@pindex co
@item CPP @item CPP
@vindex CPP @vindex CPP
Program for running the C preprocessor, with results to standard output; Program for running the C preprocessor, with results to standard output;
@ -8757,6 +8744,21 @@ Program for compiling or preprocessing Fortran and Ratfor programs;
default @samp{f77}. default @samp{f77}.
@pindex f77 @pindex f77
@item M2C
@vindex M2C
Program to use to compile Modula-2 source code; default @samp{m2c}.
@pindex m2c
@item PC
@vindex PC
Program for compiling Pascal programs; default @samp{pc}.
@pindex pc
@item CO
@vindex CO
Program for extracting a file from RCS; default @samp{co}.
@pindex co
@item GET @item GET
@vindex GET @vindex GET
Program for extracting a file from SCCS; default @samp{get}. Program for extracting a file from SCCS; default @samp{get}.
@ -8777,16 +8779,6 @@ Program to use to turn Yacc grammars into source code; default @samp{yacc}.
Program to use to run lint on source code; default @samp{lint}. Program to use to run lint on source code; default @samp{lint}.
@pindex lint @pindex lint
@item M2C
@vindex M2C
Program to use to compile Modula-2 source code; default @samp{m2c}.
@pindex m2c
@item PC
@vindex PC
Program for compiling Pascal programs; default @samp{pc}.
@pindex pc
@item MAKEINFO @item MAKEINFO
@vindex MAKEINFO @vindex MAKEINFO
Program to convert a Texinfo source file into an Info file; default Program to convert a Texinfo source file into an Info file; default

View File

@ -693,7 +693,7 @@ func_lastword (char *o, char **argv, const char *funcname UNUSED)
{ {
unsigned int i; unsigned int i;
const char *words = argv[0]; /* Use a temp variable for find_next_token */ const char *words = argv[0]; /* Use a temp variable for find_next_token */
const char *p; const char *p = NULL;
const char *t; const char *t;
while ((t = find_next_token (&words, &i))) while ((t = find_next_token (&words, &i)))

17
job.c
View File

@ -1482,10 +1482,10 @@ start_waiting_job (struct child *c)
void void
new_job (struct file *file) new_job (struct file *file)
{ {
register struct commands *cmds = file->cmds; struct commands *cmds = file->cmds;
register struct child *c; struct child *c;
char **lines; char **lines;
register unsigned int i; unsigned int i;
/* Let any previously decided-upon jobs that are waiting /* Let any previously decided-upon jobs that are waiting
for the load to go down start before this new one. */ for the load to go down start before this new one. */
@ -1723,7 +1723,16 @@ new_job (struct file *file)
/* The job is now primed. Start it running. /* The job is now primed. Start it running.
(This will notice if there are in fact no commands.) */ (This will notice if there are in fact no commands.) */
(void) start_waiting_job (c); if (cmds->fileinfo.filenm)
DB (DB_BASIC, (_("Invoking commands from %s:%lu to update target `%s'.\n"),
cmds->fileinfo.filenm, cmds->fileinfo.lineno,
c->file->name));
else
DB (DB_BASIC, (_("Invoking builtin commands to update target `%s'.\n"),
c->file->name));
start_waiting_job (c);
if (job_slots == 1 || not_parallel) if (job_slots == 1 || not_parallel)
/* Since there is only one job slot, make things run linearly. /* Since there is only one job slot, make things run linearly.

View File

@ -803,7 +803,7 @@ notice_finished_file (struct file *file)
if (touch_flag if (touch_flag
/* The update status will be: /* The update status will be:
-1 if this target was not remade; -1 if this target was not remade;
0 if 0 or more commands (+ or ${MAKE}) were run and won; 0 if 0 or more commands (+ or ${MAKE}) were run and won;
1 if some commands were run and lost. 1 if some commands were run and lost.
We touch the target if it has commands which either were not run We touch the target if it has commands which either were not run