Roland Ver. 4.5 Technical Information Seite 65

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 212
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 64
Chapter 5: Writing Recipes in Rules 55
--warn-undefined-variables’). MFLAGS was traditionally used explicitly in the recursive
make command, like this:
subsystem:
cd subdir && $(MAKE) $(MFLAGS)
but now MAKEFLAGS makes this usage redundant. If you want your makefiles to be compat-
ible with old make programs, use this technique; it will work fine with more modern make
versions too.
The MAKEFLAGS variable can also be useful if you want to have certain options, such as
-k (see Section 9.7 [Summary of Options], page 104), set each time you run make. You
simply put a value for MAKEFLAGS in your environment. You can also set MAKEFLAGS in a
makefile, to specify additional flags that should also be in effect for that makefile. (Note
that you cannot use MFLAGS this way. That variable is set only for compatibility; make does
not interpret a value you set for it in any way.)
When make interprets the value of MAKEFLAGS (either from the environment or from a
makefile), it first prepends a hyphen if the value does not already begin with one. Then
it chops the value into words separated by blanks, and parses these words as if they were
options given on the command line (except that -C’, -f’, -h’, -o’, -W’, and their long-
named versions are ignored; and there is no error for an invalid option).
If you do put MAKEFLAGS in your environment, you should be sure not to include any
options that will drastically affect the actions of make and undermine the purpose of make-
files and of make itself. For instance, the -t’, -n’, and -q options, if put in one of these
variables, could have disastrous consequences and would certainly have at least surprising
and probably annoying effects.
If you’d like to run other implementations of make in addition to GNU make, and hence
do not want to add GNU make-specific flags to the MAKEFLAGS variable, you can add them
to the GNUMAKEFLAGS variable instead. This variable is parsed just before MAKEFLAGS, in
the same way as MAKEFLAGS. When make constructs MAKEFLAGS to pass to a recursive make
it will include all flags, even those taken from GNUMAKEFLAGS. As a result, after parsing
GNUMAKEFLAGS GNU make sets this variable to the empty string to avoid duplicating flags
during recursion.
It’s best to use GNUMAKEFLAGS only with flags which won’t materially change the be-
havior of your makefiles. If your makefiles require GNU make anyway then simply use
MAKEFLAGS. Flags such as --no-print-directory or --output-sync may be appropri-
ate for GNUMAKEFLAGS.
5.7.4 The --print-directory Option
If you use several levels of recursive make invocations, the -w or --print-directory
option can make the output a lot easier to understand by showing each directory as make
starts processing it and as make finishes processing it. For example, if make -w is run in
the directory /u/gnu/make, make will print a line of the form:
make: Entering directory ‘/u/gnu/make’.
before doing anything else, and a line of the form:
make: Leaving directory ‘/u/gnu/make’.
when processing is completed.
Seitenansicht 64
1 2 ... 60 61 62 63 64 65 66 67 68 69 70 ... 211 212

Kommentare zu diesen Handbüchern

Keine Kommentare