4 # © 1998 Straylight/Edgeware
7 #----- Licensing note -------------------------------------------------------
9 # This makefile is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This makefile is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this makefile. If not, write to the Free Software Foundation,
21 # 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
23 #----- Compilation flags ----------------------------------------------------
25 # --- Uncomment to use the C4 tools ---
29 # --- C compilation ---
31 CC = $(OLD)cc -c -o $@
32 CFLAGS = -depend !Depend -throwback -ffah -Ilibs: -IC:
33 COMPILE = $(CC) $(CFLAGS)
37 AS = $(OLD)objasm -quit -to $@
38 ASFLAGS = -stamp -depend !Depend -throwback
39 ASSEMBLE = $(AS) $(ASFLAGS) -from
47 LD_UTIL = $(LD) -bin -base 0
48 LD_MOD = $(LD) -bin -base 0
49 LD_BIN = $(LD) -bin -base 0
53 # --- Making libraries ---
59 # --- Setting file types ---
61 SET_APP = SetType $@ FF8
62 SET_MOD = SetType $@ FFA
63 SET_UTIL = SetType $@ FFC
64 SET_DLL = SetType $@ FFD
66 # --- Other maintenance things ---
72 DATE = %zdy %mo %ce%yr
73 MODDATE = %dy %m3 %ce%yr
74 CRIGHT = © %ce%yr Straylight
77 #----- Default rules --------------------------------------------------------
79 .SUFFIXES: .o .c .s .bs
87 #----- Object files ---------------------------------------------------------
90 enumerate hour pathutil test \
91 each inst setdate setslot ssrclean submake \
93 buildstub fixlink msgaof resgen templaof
97 LIBS = $(CULIB) libs:aof.o.aof libs:o.astubs libs:o.swiv
99 #----- Compiling things -----------------------------------------------------
103 # --- Assembler utilities ---
105 ENUM_OBJ = o.enumerate
107 enumerate: $(ENUM_OBJ)
108 $(SETDATE) o.ver-enum version="$(ENUM_VER) [$(DATE)] ($(CRIGHT))"
109 $(LD_UTIL) $(ENUM_OBJ) o.ver-enum
115 $(SETDATE) o.ver-hour version="$(HOUR_VER) [$(DATE)] ($(CRIGHT))"
116 $(LD_UTIL) $(HOUR_OBJ) o.ver-hour
119 PATH_OBJ = o.path_util o.pathutil
121 pathutil: $(PATH_OBJ)
122 $(SETDATE) o.ver-path version="$(PATH_VER) [$(DATE)] ($(CRIGHT))"
123 $(LD_UTIL) $(PATH_OBJ) o.ver-path
129 $(SETDATE) o.ver-slot version="$(SLOT_VER) [$(DATE)] ($(CRIGHT))"
130 $(LD_UTIL) $(SLOT_OBJ) o.ver-slot
136 $(SETDATE) o.ver-test version="$(TEST_VER) [$(DATE)] ($(CRIGHT))"
137 $(LD_UTIL) $(TEST_OBJ) o.ver-test
140 # --- Various C programs ---
142 EACH_OBJ = o.each $(LIBS)
144 $(LD_APP) $(EACH_OBJ)
148 INST_OBJ = o.inst $(LIBS)
150 $(LD_APP) $(INST_OBJ)
154 SDATE_OBJ = o.setdate $(LIBS)
156 setdate: $(SDATE_OBJ)
157 $(SETDATE) o.ver-sdate _time="$(SDATE_VER) [$(DATE)] ($(CRIGHT))"
158 $(LD_APP) $(SDATE_OBJ) o.ver-sdate
162 SSRC_OBJ = o.ssrclean $(LIBS)
163 ssrclean: $(SSRC_OBJ)
164 $(LD_APP) $(SSRC_OBJ)
168 SUBMAKE_OBJ = o.submake $(LIBS)
169 submake: $(SUBMAKE_OBJ)
170 $(LD_APP) $(SUBMAKE_OBJ)
174 # --- Sapphire header creation tools ---
176 HGEN_OBJ = o.headergen $(LIBS)
177 headergen: $(HGEN_OBJ)
178 $(LD_APP) $(HGEN_OBJ)
182 CHGEN_OBJ = o.chdrgen $(LIBS)
183 chdrgen: $(CHGEN_OBJ)
184 $(LD_APP) $(CHGEN_OBJ)
188 # --- Basic tools ---
190 buildstub: b.buildstub ex.buildstub
191 ccrunch -0 -xlibs:bas.exports -xex.buildstub b.buildstub buildstub
194 ccrunch -0 b.fixlink fixlink
196 msgaof: b.msgaof ex.msgaof
197 ccrunch -0 -xlibs:bas.exports -xex.msgaof b.msgaof msgaof
199 resgen: b.resgen ex.resgen
200 ccrunch -0 -xlibs:bas.exports -xex.resgen b.resgen resgen
202 templaof: b.templaof ex.templaof
203 ccrunch -0 -xlibs:bas.exports -xex.templaof b.templaof templaof
205 # --- The common library ---
207 LIBOBJS = o.alloc o.cmdr o.gf o.glob
209 $(AR) -c $(CULIB) $(LIBOBJS)
211 # --- Standard targets ---
214 $(INSTALL) $(PROGS) <SSR$BinDir>
215 $(INSTALL) enumerate hour pathutil <SSR$DLLDir>
220 #----- Dynamic dependencies -------------------------------------------------
222 # Dynamic dependencies:
231 o.enumerate: s.enumerate
232 o.enumerate: libs:swis
233 o.enumerate: libs:header
238 o.path_util: s.path_util
239 o.path_util: libs:header
240 o.path_util: libs:swis
241 o.path_util: sh.pathUtil
242 o.pathutil: s.pathutil
243 o.pathutil: libs:header
244 o.pathutil: libs:swis
255 o.setdate: libs:h.swis
256 o.setdate: c:h.kernel
257 o.setdate: libs:aof.h.aof
258 o.setdate: libs:aof.h.chunk
259 o.setdate: libs:h._time
261 o.setslot: libs:header
263 o.setslot: libs:stream
264 o.ssrclean: c.ssrclean
265 o.ssrclean: libs:h.swis
266 o.ssrclean: libs:h.swiv
267 o.ssrclean: c:h.kernel
270 o.chdrgen: c:h.kernel
289 o.submake: libs:h.swis
290 o.submake: libs:h.swiv
291 o.submake: c:h.kernel
294 o.headergen: c.headergen
295 o.headergen: c:h.kernel
296 o.headergen: libs:h.swis