home *** CD-ROM | disk | FTP | other *** search
-
- MAKE(1) AMIGA Programmer's Manual MAKE(1)
-
-
-
- 1mNAME
- 0mmake - maintain program groups
-
- 1mSYNTAX
- 0mmake [ -f makefile ] [ option ] ... file ...
-
- 1mDESCRIPTION
- 0m3mMake 0mexecutes commands in 3mmakefile 0mto update one or more
- target 3mnames. Name 0mis typically a program. If no -f option
- is present, `makefile' and `Makefile' are tried in order.
- If 3mmakefile 0mis `-', the standard input is taken. More than
- one -f option may appear.
-
- 3mMake 0mupdates a target if it depends on prerequisite files
- that have been modified since the target was last modified,
- or if the target does not exist.
-
- 3mMakefile 0mcontains a sequence of entries that specify
- dependencies. The first line of an entry is a
- blank-separated list of targets, then a colon, then a list
- of prerequisite files. Text following a semicolon, and all
- following lines that begin with a tab, are shell commands to
- be executed to update the target. If a name appears on the
- left of more than one `colon' line, then it depends on all
- of the names on the right of the colon on those lines, but
- only one command sequence may be specified for it. If a
- name appears on a line with a double colon :: then the
- command sequence following that line is performed only if
- the name is out of date with respect to the names to the
- right of the double colon, and is not affected by other
- double colon lines on which that name may appear.
-
- Two special forms of a name are recognized. A name like
- 3ma(b) 0mmeans the file named 3mb 0mstored in the archive named 3ma.
- 0mA name like 3ma((b)) 0mmeans the file stored in archive a
- containing the entry point 3mb.
-
- 0mSharp and newline surround comments.
-
- The following makefile says that `pgm' depends on two files
- `a.o' and `b.o', and that they in turn depend on `.c' files
- and a common file `incl'.
-
- pgm: a.o b.o
- cc a.o b.o -lm -o pgm
- a.o: incl a.c
- cc -c a.c
- b.o: incl b.c
- cc -c b.c
-
- 3mMakefile 0mentries of the form
-
- string1 = string2
-
- are macro definitions. Subsequent appearances of 3m$(string1)
- 0mor 3m${string1} 0mare replaced by 3mstring2. 0mIf 3mstring1 0mis a
- single character, the parentheses or braces are optional.
-
-
- -1-
-
-
- MAKE(1) AMIGA Programmer's Manual MAKE(1)
-
-
-
- 3mMake 0minfers prerequisites for files for which 3mmakefile 0mgives
- no construction commands. For example, a `.c' file may be
- inferred as prerequisite for a `.o' file and be compiled to
- produce the `.o' file. Thus the preceding example can be
- done more briefly:
-
- pgm: a.o b.o
- cc a.o b.o -lm -o pgm
- a.o b.o: incl
-
- Prerequisites are inferred according to selected suffixes
- listed as the `prerequisites' for the special name
- `.SUFFIXES'; multiple lists accumulate; an empty list clears
- what came before. Order is significant; the first possible
- name for which both a file and a rule as described in the
- next paragraph exist is inferred. The default list is
-
- .SUFFIXES: .out .o .c .e .r .f .y .l .s .p
-
- The rule to create a file with suffix 3ms2 0mthat depends on a
- similarly named file with suffix 3ms1 0mis specified as an entry
- for the `target' 3ms1s2. 0mIn such an entry, the special macro
- $* stands for the target name with suffix deleted, $@ for
- the full target name, $< for the complete list of
- prerequisites, and $? for the list of prerequisites that
- are out of date. For example, a rule for making optimized
- `.o' files from `.c' files is
-
- .c.o: ; cc -c -O -o $@ $*.c
-
- Certain macros are used by the default inference rules to
- communicate optional arguments to any resulting
- compilations. In particular, `CFLAGS' is used for 3mcc(1)
- 0moptions, `FFLAGS' for 3mf77(1) 0moptions, `PFLAGS' for 3mpc(1)
- 0moptions, and `LFLAGS' and `YFLAGS' for 3mlex 0mand 3myacc(1)
- 0moptions. In addition, the macro `MFLAGS' is filled in with
- the initial command line options supplied to 3mmake. 0mThis
- simplifies maintaining a hierarchy of makefiles as one may
- then invoke 3mmake 0mon makefiles in subdirectories and pass
- along useful options such as -k.
-
- Command lines are executed one at a time, each by its own
- shell. A line is printed when it is executed unless the
- special target `.SILENT' is in 3mmakefile, 0mor the first
- character of the command is `@'.
-
- Commands returning nonzero status (see 3mintro(1)) 0mcause 3mmake
- 0mto terminate unless the special target `.IGNORE' is in
- 3mmakefile 0mor the command begins with <tab><hyphen>.
-
- Interrupt and quit cause the target to be deleted unless the
- target is a directory or depends on the special name
- `.PRECIOUS'.
-
- Other options:
-
- -i Equivalent to the special entry `.IGNORE:'.
-
-
- -2-
-
-
- MAKE(1) AMIGA Programmer's Manual MAKE(1)
-
-
-
- -k When a command returns nonzero status, abandon work on
- the current entry, but continue on branches that do not
- depend on the current entry.
-
- -n Trace and print, but do not execute the commands needed
- to update the targets.
-
- -t Touch, i.e. update the modified date of targets,
- without executing any commands.
-
- -r Equivalent to an initial special entry `.SUFFIXES:'
- with no list.
-
- -s Equivalent to the special entry `.SILENT:'.
-
- -q Question up-to-dateness of target. Return exit status
- 1 if not; otherwise, return 0.
-
- -r Don't use built-in rules.
-
- 1mFILES
- 0mmakefile, Makefile
-
- 1mSEE ALSO
- 0msh(1), touch(1), f77(1), pc(1)
- S. I. Feldman 3mMake - A Program for Maintaining Computer
- Programs
-
- 0m1mBUGS
- 0mSome commands return nonzero status inappropriately. Use -i
- to overcome the difficulty. Commands that are directly
- executed by the shell, notably 3mcd(1), 0mare ineffectual across
- newlines in 3mmake.
-
- 0m1mAMIGA VERSION
- 0mNot all of the above applies to the Amiga version of 3mmake.
- 0mIn particular, the default rules and suffixes are
- different.
-
- Omissions:
- Libraries and the related notation are not implemented.
- The -k option is not supported.
- The `;' construct is not implemented.
- The remarks related to 3mMFLAGS, lex(1), yacc(1), f77(1) 0mand
- 3mpc(1) 0mdo not apply.
- $< and $? are not exactly as specified: $< is ONE
- prerequisite that is out of date (including path name), and
- $? is ALL prerequisites (without path names).
-
- Additions:
- If a file 3ms:builtins.make 0mexists, this file is used instead
- of the built-in rules.
- Filenames are not case-significant. Unfortunately, this
- also applies to the special target names .PRECIOUS, .IGNORE
- and .SILENT. These can also be specified as .Precious, or
- .iGnOrE.
- 3mCd 0mcommands are effective.
-
-
- -3-
-
-
- MAKE(1) AMIGA Programmer's Manual MAKE(1)
-
-
- Comment characters (#) may be escaped with a backslash (\).
- At most 1 colon is allowed in a target file name (for
- including device names). In that case, the trailing colon
- must follow the target name immediately, without any
- intervening white space. Spaces in the names are not
- allowed.
- A new special target name has been added: 3m.PATH. 0mAny
- prerequisite names for 3m.PATH 0mare used for finding source
- files for implicit rules. You name one or more directories,
- and if the source file for an implicit rule cannot be found
- in the current directory, each of the the given pathnames is
- prepended (in the order given) to the source name, until the
- file is found.
-
- For instance, the Makefile
-
- .PATH: src/ include/ src/old
-
- pgm: pgm.o
-
- will look (according to the .c.o rule) for pgm.c, src/pgm.c,
- include/pgm.c and src/oldpgm.c, in that order. Of course,
- due to other implicit rules, other files (with other
- suffixes) may be tried as well.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -4-
-
-