home *** CD-ROM | disk | FTP | other *** search
- 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
-
-