* Removed built-in .? -> .s suffix rules.

* Misc cleanup, etc.
This commit is contained in:
Roland McGrath 1988-05-26 17:55:55 +00:00
parent af31731365
commit 15c5b63713

View file

@ -6,7 +6,11 @@
$Header$ $Header$
$Log$ $Log$
Revision 1.50 1988/05/22 14:49:44 mcgrath Revision 1.51 1988/05/26 17:55:55 mcgrath
* Removed built-in .? -> .s suffix rules.
* Misc cleanup, etc.
Revision 1.50 88/05/22 14:49:44 mcgrath
Major Beta release before release 2.0. Major Beta release before release 2.0.
Revision 1.24 88/05/22 13:39:08 mcgrath Revision 1.24 88/05/22 13:39:08 mcgrath
@ -2801,15 +2805,14 @@ produces the result @samp{foo}.
@item $(wildcard @var{pattern}) @item $(wildcard @var{pattern})
@findex wildcard @findex wildcard
The argument @var{pattern} is a file name pattern, typically The argument @var{pattern} is a file name pattern, typically containing
containing wildcards characters. The result of @code{wildcard} is a wildcard characters. The result of @code{wildcard} is a space-separated
space-separated list of the names of existing files that match the list of the names of existing files that match the pattern.
pattern.
Wildcard are expanded automatically in rules (@pxref{Wildcards}). But Wildcards are expanded automatically in rules (@pxref{Wildcards}).
it does not normally take place when a variable is set, or inside the But they are not normally expanded when a variable is set, or inside the
arguments of other functions. Those occasions are when the arguments of other functions. Those occasions are when the @code{wildcard}
@code{wildcard} function is useful. function is useful.
@end table @end table
@node Running, Implicit, Functions, Top @node Running, Implicit, Functions, Top
@ -2890,6 +2893,7 @@ file that you wish to remake. For example, consider a directory containing
a several programs, with a makefile that starts like this: a several programs, with a makefile that starts like this:
@example @example
.PHONY: all
all: size nm ld ar as all: size nm ld ar as
@end example @end example
@ -2909,9 +2913,17 @@ request it explicitly with @samp{make clean}. Here is a list of typical
phony and empty target names: phony and empty target names:
@table @file @table @file
@item all
Make all the top-level targets the makefile knows about.
@item clean @item clean
Delete all files that the makefile could remake. Delete all files that the makefile could remake.
@item clobber
Delete absolutely everything the makefile could remake (whereas
@samp{make clean} often leaves intact some files that might take a
long time to remake).
@item install @item install
Copy the executable file into a directory that users typically search for Copy the executable file into a directory that users typically search for
commands. commands.
@ -2921,6 +2933,9 @@ Print listings of the source files that have changed.
@item tar @item tar
Create a tar file of the source files. Create a tar file of the source files.
@item shar
Create a shell archive (shar file) of the source files.
@end table @end table
@node Avoid Compilation, Instead of Execution, Goals, Running @node Avoid Compilation, Instead of Execution, Goals, Running
@ -3055,8 +3070,8 @@ you can enclose spaces and other special characters in the value of a
variable when you override it.) variable when you override it.)
The variable @code{CFLAGS} is only one of many standard variables that The variable @code{CFLAGS} is only one of many standard variables that
exist just so that you can change them this way. @xref{Implicit exist just so that you can change them this way.
Variables}, for a complete list. @xref{Implicit Variables}, for a complete list.
You can also program the makefile to look at additional variables of your You can also program the makefile to look at additional variables of your
own, giving the user ability to control other aspects of how the makefile own, giving the user ability to control other aspects of how the makefile
@ -3118,8 +3133,7 @@ Here is a table of all the options @code{make} understands:
@table @samp @table @samp
@item -b @item -b
This option is ignored for compatibility with other versions of This option is ignored for compatibility with other versions of @code{make}.
@code{make}.
@item -c @var{dir} @item -c @var{dir}
Change to directory @var{dir} before executing the rules. If multiple Change to directory @var{dir} before executing the rules. If multiple
@ -3376,38 +3390,29 @@ running the linker @code{ld} via the C compiler. The precise command
used is @samp{$(CC) $(LDFLAGS) @dots{} $(LOADLIBES)}.@refill used is @samp{$(CC) $(LDFLAGS) @dots{} $(LOADLIBES)}.@refill
This rule does the right thing for a simple program with only one source This rule does the right thing for a simple program with only one source
file. In more complicated cases, you must write an explicit command for file. It will also do the right thing if there are multiple object files
linking. (presumably coming from various other source files), the first of which has
a name matching that of the executable file. Thus,
@item Compiling C into assembler code @example
@file{@var{n}.s} will be made automatically from @file{@var{n}.c} x: y.o z.o
with the command @samp{$(CC) -S $(CFLAGS)}.@refill @end example
It would be possible for @code{make} to convert @file{@var{n}.c} into @noindent
@file{@var{n}.o} by way of @file{@var{n}.s}, using this rule and the when @file{x.c}, @file{y.c} and @file{z.c} all exist will execute:
rule for running the assembler. But that is not what @code{make}
does, because the rule for compiling @file{@var{n}.c} into
@file{@var{n}.o} directly comes earlier in the order of rules. The
upshot is that the file @file{@var{n}.s} is not created or changed
when @file{@var{n}.o} is being remade. This rule is used only if you
explicitly specify @file{@var{n}.s} as a goal or needed dependency.
This is a deliberate decision, for the sake of compatibility with Unix @example
@code{make}.@refill cc -c x.c -o x.o
cc -c y.c -o y.o
cc -c z.c -o z.o
cc x.o y.o z.o -o x
rm -f x.o
rm -f y.o
rm -f z.o
@end example
If you want @code{make} update @file{@var{n}.s} on the way to updating @noindent
@file{@var{n}.o}, you can request this by canceling the other rule In more complicated cases, you must write an explicit command for linking.
that allows direct compilation. @xref{Canceling Rules}.@refill
@item Compiling Pascal, Fortran, EFL or Ratfor into assembler code
@file{@var{n}.s} will be made automatically from @file{@var{n}.p},
@file{@var{n}.e}, @file{@var{n}.r}, @file{@var{n}.F} or @file{@var{n}.F}
by running the appropriate compiler with the @samp{-S} flag
instead of the @samp{-c} flag.@refill
For compatibility with Unix @code{make}, these rules apply only if you
expressly request @code{make} to update @file{@var{n}.s}. See the
information immediately above.
@item Yacc for C programs @item Yacc for C programs
@file{@var{n}.c} will be made automatically from @file{@var{n}.y} by @file{@var{n}.c} will be made automatically from @file{@var{n}.y} by
@ -3449,9 +3454,9 @@ Any file @file{@var{n}} will be extracted if necessary from an SCCS
file named either @file{s.@var{n}} or @file{SCCS/s.@var{n}}. The file named either @file{s.@var{n}} or @file{SCCS/s.@var{n}}. The
precise command used is @samp{$(GET) $(GFLAGS)}. precise command used is @samp{$(GET) $(GFLAGS)}.
I recommend that you avoid the use of SCCS. RCS is widely held to be We recommend that you avoid the use of SCCS. RCS is widely held to be
superior, and RCS is also free. By choosing free software in place of superior, and is also free. By choosing free software in place of
comparable proprietary software, you support the free software comparable (or lesser) proprietary software, you support the free software
movement. movement.
@end table @end table
@ -3499,8 +3504,8 @@ Program for extracting a file from RCS; default @samp{co}.
@item FC @item FC
@vindex FC @vindex FC
Program for compiling or preprocessing Fortran programs (or Ratfor or Program for compiling or preprocessing Fortran, Ratfor,
EFL programs); default @samp{f77}. and EFL programs; default @samp{f77}.
@item GET @item GET
@vindex GET @vindex GET
@ -3517,18 +3522,17 @@ Program for compiling Pascal programs; default @samp{pc}.
@item YACC @item YACC
@vindex YACC @vindex YACC
Program to use to turn Yacc grammars into C programs; default Program to use to turn Yacc grammars into C programs; default @samp{yacc}.
@samp{yacc}.
@item YACCR @item YACCR
@vindex YACCR @vindex YACCR
Program to use to turn Yacc grammars into Ratfor programs; default Program to use to turn Yacc grammars into Ratfor
@samp{yacc -r}. programs; default @samp{yacc -r}.
@item YACCE @item YACCE
@vindex YACCE @vindex YACCE
Program to use to turn Yacc grammars into EFL programs; default Program to use to turn Yacc grammars into EFL
@samp{yacc -e}. programs; default @samp{yacc -e}.
@item RANLIB @item RANLIB
@vindex RANLIB @vindex RANLIB
@ -3537,48 +3541,46 @@ Program to use to update the symbol-directory of an archive
@end table @end table
Here is a table of variables whose values are additional arguments for the Here is a table of variables whose values are additional arguments for the
programs above: programs above. The default values for all of these is the empty string.
@table @code @table @code
@item ASFLAGS @item ASFLAGS
@vindex ASFLAGS @vindex ASFLAGS
Extra flags to give to the assembler (when explicitly invoked Extra flags to give to the assembler (when explicitly
on a @samp{.s} file). invoked on a @samp{.s} file).
@item CFLAGS @item CFLAGS
@vindex CFLAGS @vindex CFLAGS
Extra flags to give to the C compiler; default is empty. Extra flags to give to the C compiler.
@item EFLAGS @item EFLAGS
@vindex EFLAGS @vindex EFLAGS
Extra flags to give to the Fortran compiler for EFL programs; default Extra flags to give to the Fortran compiler for EFL programs.
is empty.
@item FFLAGS @item FFLAGS
@vindex FFLAGS @vindex FFLAGS
Extra flags to give to the Fortran compiler; default is empty. Extra flags to give to the Fortran compiler.
@item LFLAGS @item LFLAGS
@vindex LFLAGS @vindex LFLAGS
Extra flags to give to Lex; default is empty. Extra flags to give to Lex.
@item LDFLAGS @item LDFLAGS
@vindex LDFLAGS @vindex LDFLAGS
Extra flags to give to compilers when they are supposed to invoke the Extra flags to give to compilers when they are supposed to invoke the
linker, @samp{ld}; default is empty. linker, @samp{ld} (actually the value of the variable @code{LD}).
@item PFLAGS @item PFLAGS
@vindex PFLAGS @vindex PFLAGS
Extra flags to give to the Pascal compiler; default is empty. Extra flags to give to the Pascal compiler.
@item RFLAGS @item RFLAGS
@vindex RFLAGS @vindex RFLAGS
Extra flags to give to the Fortran compiler for Ratfor programs; Extra flags to give to the Fortran compiler for Ratfor programs.
default is empty.
@item YFLAGS @item YFLAGS
@vindex YFLAGS @vindex YFLAGS
Extra flags to give to Yacc; default is empty. Extra flags to give to Yacc.
@end table @end table
@node Chained Rules, Pattern Rules, Implicit Variables, Implicit @node Chained Rules, Pattern Rules, Implicit Variables, Implicit