home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 48
/
Amiga_Dream_48.iso
/
Atari
/
c
/
sozobon-v2
/
scdoc20.lzh
/
MAKE.DOC
< prev
next >
Wrap
Text File
|
1991-03-03
|
11KB
|
315 lines
This is a public domain 'make' program adapted for use with the Sozobon
C compiler by Tony Andrews. Several new features have been added, and
the default rules are set appropriately for use with the Sozobon compiler.
The documentation for the original program is included at the end of
this file.
The new features are:
* Make will attempt to use its internal rules if no makefile exists, but
a target was given on the command line. This means that simple programs
in a single file can be made without a makefile by typing:
make file.ttp
where 'file.c' is the name of the source file.
* Make now uses the PATH variable to find executables automatically and
looks for all standard suffixes (.tos, .ttp, .prg). Commands in makefiles
can be given without pathnames and without any suffix.
* The environment is now read, and macros corresponding to the variables
found are initialized within make. This means that setting the "PATH"
env. variable causes make to set the macro "PATH" to the value found
and use that for command searches as described above.
Macros are normally set in the following order:
internal defaults
environment variables
makefile assignments
If the -e option is given on the command line, the environment overrides
assignments in the makefile and the order becomes:
internal defaults
makefile assignments
environment variables
* To provide better support for nested makefiles, a '-c' option is provided
to tell make to change its current directory before running. Upper level
makefiles can invoke make with -c as in:
make -c subdir1 -f sub1.mk install
In this case, make would 'cd' to 'subdir1' before doing anything.
* The default rules should be what you'd expect. To help with running
'make' from GEM, the PATH macro is initialized by default to something
reasonable. The complete set of defaults is:
.SUFFIXES: .prg .tos .ttp .o .bin .s .c .pas
PATH = \bin,\sozobon\bin
CC = cc
CFLAGS =
.c.o:
$(CC) -c $(CFLAGS) $<
.s.o:
$(CC) -c $(CFLAGS) $<
.c.s:
$(CC) -S $(CFLAGS) $<
.c.prg:
$(CC) $(CFLAGS) $< -o $*.prg
.c.tos:
$(CC) $(CFLAGS) $< -o $*.tos
.c.ttp:
$(CC) $(CFLAGS) $< -o $*.ttp
What follows is the documentation for the program as I received it.
---------------------------------------------------------------------------
A full featured Public Domain Make for the Atari STs.
Adapted from mod.sources posting (Volume 7, Issue 71, 1986-12-03)
by Neil Russell and from Jwahar Bammi's port of Neil Russell's
original net.sources posting.
Thanks to both of them, they did most of the work and should
get all the credit they deserve.
This is not a manual how to use make. For that please refer to any
UNIX manual, and/or look at the sources and example makefile.
First Neil Russell's read.me from the mod.sources posting.
---------------------------------------------------------------------------
Following is a repost of the public domain 'make' that I posted
to net.sources a couple of months ago. I have fixed a few bugs, and
added some more features, and the resulting changes amounted to
about as much text as the whole program (hence the repost).
For those that missed the net.sources posting, this is a public domain
re-implementation of the UNIX make program. There is no manual included;
for documentation, refer to a UNIX manual, or the source.
Here is a list of the changes made:
i) If '-' (ignore) or '@' (silent) where used at the start
of a command, their effect was not turned off for the following
commands.
ii) A special target (.SUFFIXES, .PRECIOUS) or a rule (.c.o, .a.o),
if first in the file would be taken as the default target.
This resulted in error messages like "Don't know how to
make .c", because things like .SUFFIXES were being made.
This was further complicated by ---
iii) Special target lines with no dependents (ie. .SUFFIXES:\n)
were not clearing out the existing dependents like
they should.
iv) Default rules could not be redefined because of the error
checking for commands being defined twice. Now you are
allowed to define a target beinging with '.', having
no dependents with commands.
v) The -q option didn't do the time comparison correctly,
or clear the variable used to keep track of this. Thus
it didn't work very well.
vi) The syntax ${..} for macro's supported by UNIX make was
not supported.
vii) There wuz a couple of spelling errors.
viii) When make checked for implicit rules on targets without
a suffix, there were problems. (Note: The ~ feature of
UNIX make wasn't and still isn't supported)
ix) The -n option did not print @ lines like it was supposed to.
x) :: added. (See UNIX manual)
xi) $? added. (see UNIX manual)
---------------------------------------------------------------------------
Sources:
astat.h h.h main.c rules.c
check.c gemstart.s input.c make.c
ststuff.c decl.h macro.c reader.c
touch.c
Alcyon C compile scripts (you only need these the first time around!):
compile.sh
link.sh
lnk
Makefile for make and touch:
makefile - Alcyon C flavor
Touch:
compiling & linking touch.c will result in a touch program. Touch
updates the mod. time of a file to present.
Usage: touch file file ......
#define the symbol MEGAMAX at the top of touch.c is you are
going to compile touch using the Megamax C compiler.
(Not tested by me)
Atari ST Specific Information:
ATARI SPECIAL MACROS:
Since the Atari ST does not have any standard shell, Jwahar built in
three macros that are useful:
$(RM) - removes one or more files, wild cards allowed
$(CP) - copies one file to another. NO directories allowed,
will only accept two arguments, both of which
must be files. If the destination file exists, it
will be overwritten.
$(ECHO) - echo's its arguments.
All Atari special commands internally begin with the character '%'
and are handled by routines in ststuff.c. It should be trivial to
add other Atari Special commands if you so desire. All other
commands are executed using the Pexec gemdos command, so complete
path names must be used.
CONTINUATION LINES:
The line continuation character is '\'. Back slashes may appear in
pathname, but NOT at the end of a line, as it will be taken as a
continuation backslash, and not as a part of the pathname. This should
not create any big problem as far as i can see.
DEFAULT RULES:
See the file RULES.C. Jwahar built in default rules for '.c.o'
for both Alcyon C and Megamax C. But since both use the same '.o' suffix,
only one may be built into the version of make that you compile. Which
version gets built into make depends on the preprocessor symbol
'MEGRULES'. If this symbol is defined (see H.H) then Megamax rules get
built in. If it is not, then Alcyon rules get built in. All the rules
are based on values of macros defined in RULES.C. These macros may be
redefined in a makefile, and when the default rule is expanded by make
at runtime, the new redefined values will be used instead.
Default rules may be redefined in a makefile. This was not possible
in the original version. An other way to redefine the default rules is
to edit RULES.C and recompile and link. The values I have used in
RULES.C are relevant for my setup. (1 Mb 520 ST+, 2 double sided
floppies, no hard disk). You will probably want to edit them for
your setup.
The default rules in RULES.C are as follows:
.SUFFIXES: .prg .68k .o .bin .s .c .pas
Alcyon C default rules (if MEGRULES is not defined):
# Path to the Alcyon C executables
CPATH = a:\bin
# C preprocessor
CP68 = "cp68.prg"
# C preprocessor flags
CPFLAGS = -i a:\include\
# Pass 1 of the C compiler
C068 = c068.prg
# Pass 1 flags
C0FLAGS = -f # change to "" if you want to use IEEE
# floating point and libm instead of libf
# by Default. Otherwise simply redefine
# C0FLAGS in your makefile to get the
# IEEE floating option.
# Pass 2 of the C compiler
C168 = c168.prg
# Pass 2 flags
C1FLAGS = # not defined
# Assembler
AS = as68.prg
# Assembler flags
ASFLAGS = -l -u -s a:\
.c.o:
$(CPATH)\$(CP68) $(CPFLAGS) $< $*.i
$(CPATH)\$(C068) $*.i $*.1 $*.2 $*.3 $(C0FLAGS)
$(RM) $*.i
$(CPATH)\$(C168) $*.1 $*.2 $*.s $(C1FLAGS)
$(RM) $*.1 $*.2
$(CPATH)\$(AS) $(ASFLAGS) $*.s
$(RM) $*.s
.s.o:
$(CPATH)\$(AS) $(ASFLAGS) $<
# Linker of choice
LINKER = a:\link68.prg
# Relmod
RELMOD = a:\relmod.prg
Megamax C default rules (if MEGRULES is defined):
# Megamax C Rules default
# Path to the Megamax C executables */
CPATH = a:
# C Compiler
MMCC = mmcc.ttp
# Code Optimizer
MMIMP = mmimp.ttp
.c.o:
$(CPATH)\$(MMCC) $<
$(CPATH)\$(MMIMP) $*.o
# Linker of choice
LINKER = $(CPATH)\mmlink.ttp
Jwahar did not define any default '.pas.bin' rule for OSS Pascal, but
that should be easy to add.
How to Compile Make:
Edit the file H.H. If you want to use the Megamax C compiler
uncomment the line /* #define MEGAMAX */ to define the symbol 'MEGAMAX'.
You probably have to edit all the sources to define the symbol 'ATARIST'.
I do not know how to tell mmcc that a preprocessor symbol is defined.
If you are using the Alcyon C compiler, leave the line commented out.
Edit the file RULES.C and the symbol 'MEGRULES' in H.H for your taste.
If you have the Beckemeyer C shell you may use the shell scripts
compile.sh and link.sh for Alcyon C
If you don't have the microCshell, then you will have to use these scripts
as guideline.
Once make.prg is made, you can safely throw away all the shell scripts!!
If you intend to use make from the desktop, rename it to make.ttp.
This program is fully in the Public Domain, and you are encouraged
to distribute copies of the program. Your comments/criticisms/fixes etc.
will be very much appreciated. I am however not responsible for any bugs
and/or correctness of behavior of the program. No part of this
distribution may be used for commercial gains.
Send your comments to:
Ton van Overbeek
Earn/Bitnet: tpc862@estec
Usenet: .....!{ucbvax|mcvax}!tpc862%estec.bitnet
Arpa: tpc862%estec.bitnet@wiscvm.wisc.edu
CompuServe: 71450,3537