home *** CD-ROM | disk | FTP | other *** search
- This program is the public domain Make program which appeared on
- mod.sources, Volume 7, number 91. I have ported it to the Amiga under
- Manx Aztec C version 3.40a. This short document assumes you know
- Make, and simply points out the Amiga specific features of the
- program. The supported switches are listed in the comment block at
- the beginning of module main.c. I offer no apologies for the fact that
- I ran the code through "indent -i4 -nfc1" on the 4.3BSD system at work
- before I started working on it.
- The program has been compiled under Manx Aztec C Version 3.40.
- It uses Manx's fexecv() function to execute commands and get
- their return value, and the Manx dos_packet() function to send an
- AmigaDOS packet to the file system for touch'ing purposes. Lattice
- recompilers need to change these (at least). Peculiar features
- of the Amiga version are:
-
- (1) The Amiga-specific sections of the code are #ifdef'd on the symbol
- amiga (note the lower case). I endorse Fred Fish's effort to
- have system and compiler-supplied #define's in lower case to
- ensure no collisions with user-supplied ones.
- (2) The file rules.c, routine makerules(), contains the definitions of
- the default built-in rules. For the Amiga, these are equivalent to
- the Makefile:
-
- CC = cc
- CFLAGS =
- AS = as
-
- .c.o:
- $(CC) $(CFLAGS) $<
- .asm.o:
- $(AS) -o $@ $<
-
- (indented for clarity only). Thus, one could conceivably do:
- make CC=lc CFLAGS= AS=asm
- to run this make under Lattice C.
- (3) If the file S:builtins.make exists, its contents are read in
- instead of the built-in rules defined in makerules(). Thus, you
- can use different default rules on different disks and change
- the default rules without recompiling make.
- (4) A Control-D typed during execution of a command by make will cause
- an abort with exit status 1 AFTER the completion of that command.
- Control-C is an immediate abort, as you might expect.
- (5) Not really Amiga specific, but worth mentioning, is that characters
- special both to the local operating system (such as : in AmigaDOS) and
- to make may be used in the makefile by preceding them with \
- to temporarily override their special meaning. For example, to tell
- make that RAM:foo depends on AC:foo.c, write:
-
- RAM\:foo : AC\:foo.c
-
- (6) The Aztec fexecv() function, which is used by make to execute its
- commands, only works on programs in directories stored along the
- AmigaDOS PATH, so make sure your PATH includes the appropriate
- directories.
-
- Finally, I added one new feature in the non-machine-specific code:
- the name of the makefile can be a single dash "-", in which case a
- makefile is read from the standard input.
- About the only feature of "real" make missing here is the
- semicolon construct which allows a pair of lines such as the .c.o:
- rule and command above to be written as one line, viz:
- .c.o: ; $(CC) $(CFLAGS) $<
-
- Enjoy! Bug reports in the Amiga-specific stuff should be directed to
- me; others should go to caret@fairlight.OZ, the author of the rest of it.
- By the way, this code is superior to the Manx-supplied make--more switches
- and a better parser; in fact, this make will handle the Makefile for
- MicroGnuEmacs while Manx make chokes on the ln command.
-
- Steve Walton
- ametek!walton@csvax.caltech.edu (ARPA)
- WALTON@CALTECH (BITNET)
- ...!ucbvax!sun!megatest!ametek!walton
-
-