home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 144.lha / Leach_v1.3 / makefile < prev    next >
Encoding:
Makefile  |  1986-11-21  |  3.2 KB  |  107 lines

  1. # This makefile for Aztec C requires that the compiler (named cc) the
  2. # assembler (named assm) and the linker (named ln) reside in a directory
  3. # that has been assigned to CC:
  4. #
  5. # It makes and uses a precompiled header file, "headers.p", which it locates
  6. # in RAM: All the "#include" statements from all source files should be, but
  7. # don't have to be, in a file called "headers.inc", in the current directory.
  8. # The .inc file must exist even if you don't put #include statements in it.
  9. # It will build "headers.pre" from "headers.inc", if necessary, and move
  10. # it to "ram:headers.p".
  11. #
  12. # This file will use libraries located in RAM:, loading them there from disk
  13. # only if they don't already exist.
  14.  
  15.  
  16. # List all object files here.
  17.  
  18. ALL=main.o event.o menu.o mousepointer.o octant.o ruler.o
  19.  
  20. # List all .c files here but with .arc extentions.
  21.  
  22. ARC=archive/main.arc archive/event.arc archive/menu.arc archive/gad.arc \
  23.     archive/globals.arc archive/mousepointer.arc archive/makefile.arc \
  24.     archive/octant.arc archive/ruler.arc
  25.  
  26. # Custom compile rule for my directory layout, using RAM: to hold intermediate
  27. # files and the precompiled header option.
  28.  
  29. .c.o:
  30.     CC:cc +Iram:headers.p -a -o ram:cctemp $*.c
  31.     CC:assm -o $@ ram:cctemp
  32.     del ram:cctemp
  33.  
  34. # Rule for making precompiled header file.
  35.  
  36. .inc.pre:
  37.     cc:cc +H$@ $*.inc
  38.  
  39. # This is the driving dependency. "make leach" brings everything up to date.
  40. # The .p file is first in line so it is made current before the objects.
  41. # Note that existence of the RAM: based libraries is a dependency.
  42. # The data calculations in event.c use asine() and sqrt() which require a
  43. # floating point  math library. The +cd flag in ln cmd means that intialized
  44. # data segment will be forced in to CHIP ram.
  45.  
  46. leach:  ram:headers.p ram:c.lib ram:m.lib $(ALL)
  47.    cc:ln -o RAM:leach +cd $(ALL) ram:m.lib ram:c.lib
  48.    copy RAM:leach leach
  49.    copy RAM:leach VD0:c
  50.    del RAM:leach
  51.  
  52. # All object files depend on the precompiled header file.
  53.  
  54. $(ALL): headers.pre
  55.  
  56. # Precompiled header depends on the application's list of .h files. Note that
  57. # touching header.inc will force a complete recompile.
  58.  
  59. headers.pre: headers.inc
  60.  
  61. # Copy the precompiled header file to RAM: if it's not already there.
  62.  
  63. ram:headers.p: headers.pre
  64.    copy headers.pre ram:headers.p
  65.  
  66. # Copy the linking libraries to RAM: if they aren't already there.
  67.  
  68. ram:c.lib: sys:lib/c.lib
  69.    copy SYS:lib/c.lib ram:
  70.  
  71. ram:m.lib: sys:lib/m.lib
  72.    copy sys:lib/m.lib ram:
  73.  
  74.  
  75. # archiving is a separate operation from compilation. These are all separate
  76. # rules to avoid conflict with the general compile rule for .c files. This is
  77. # really crude but what the Hell.
  78.  
  79. archive:  $(ARC)
  80.  
  81. archive/main.arc: main.c
  82.    copy main.c archive/main.arc
  83.  
  84. archive/event.arc: event.c
  85.    copy event.c archive/event.arc
  86.  
  87. archive/menu.arc: menu.c
  88.    copy menu.c archive/menu.arc
  89.  
  90. archive/octant.arc: octant.c
  91.    copy octant.c archive/octant.arc
  92.  
  93. archive/mousepointer.arc: mousepointer.c
  94.    copy mousepointer.c archive/mousepointer.arc
  95.  
  96. archive/ruler.arc: ruler.c
  97.     copy ruler.c archive/mousepointer.arc
  98.  
  99. archive/gad.arc: gad.h
  100.    copy gad.h archive/gad.arc
  101.  
  102. archive/globals.arc: globals.h
  103.    copy globals.h archive/globals.arc
  104.  
  105. archive/makefile.arc: makefile
  106.    copy makefile archive/makefile.arc
  107.