chiark / gitweb /
Initial revision
[ssr] / StraySrc / Utilities / Makefile,fe1
1 #
2 # Makefile
3 #
4 # © 1998 Straylight/Edgeware
5 #
6
7 #----- Licensing note -------------------------------------------------------
8 #
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)
12 # any later version.
13 #
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.
18 #
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.
22
23 #----- Compilation flags ----------------------------------------------------
24
25 # --- Uncomment to use the C4 tools ---
26
27 # OLD = o-
28
29 # --- C compilation ---
30
31 CC = $(OLD)cc -c -o $@
32 CFLAGS = -depend !Depend -throwback -ffah -Ilibs: -IC:
33 COMPILE = $(CC) $(CFLAGS)
34
35 # --- Assembling ---
36
37 AS = $(OLD)objasm -quit -to $@
38 ASFLAGS = -stamp -depend !Depend -throwback
39 ASSEMBLE = $(AS) $(ASFLAGS) -from
40
41 BAS = basasm
42
43 # --- Linking ---
44
45 LD = $(OLD)link -o $@
46 LD_APP = $(LD) -aif
47 LD_UTIL = $(LD) -bin -base 0
48 LD_MOD = $(LD) -bin -base 0
49 LD_BIN = $(LD) -bin -base 0
50 LD_DLL = $(LD) -rmf
51 LD_AOF = $(LD) -aof
52
53 # --- Making libraries ---
54
55 AR = $(OLD)libfile -o
56
57 CDLL = cdll
58
59 # --- Setting file types ---
60
61 SET_APP = SetType $@ FF8
62 SET_MOD = SetType $@ FFA
63 SET_UTIL = SetType $@ FFC
64 SET_DLL = SetType $@ FFD
65
66 # --- Other maintenance things ---
67
68 RM = ssrclean
69 INSTALL = inst
70 SETDATE = setdate
71 SQUEEZE = squeeze $@
72 DATE = %zdy %mo %ce%yr
73 MODDATE = %dy %m3 %ce%yr
74 CRIGHT = © %ce%yr Straylight
75 FIXLINK = fixlink $@
76
77 #----- Default rules --------------------------------------------------------
78
79 .SUFFIXES: .o .c .s .bs
80 .c.o:
81         $(COMPILE) $<
82 .s.o:
83         $(ASSEMBLE) $<
84 .bs.o:
85         $(BAS) $< $@
86
87 #----- Object files ---------------------------------------------------------
88
89 PROGS = \
90         enumerate hour pathutil test \
91         each inst setdate setslot ssrclean submake \
92         chdrgen headergen \
93         buildstub fixlink msgaof resgen templaof
94
95 CULIB = o.culib
96
97 LIBS = $(CULIB) libs:aof.o.aof libs:o.astubs libs:o.swiv
98
99 #----- Compiling things -----------------------------------------------------
100
101 all: $(PROGS)
102
103 # --- Assembler utilities ---
104
105 ENUM_OBJ = o.enumerate
106 ENUM_VER = 1.03
107 enumerate: $(ENUM_OBJ)
108         $(SETDATE) o.ver-enum version="$(ENUM_VER) [$(DATE)] ($(CRIGHT))"
109         $(LD_UTIL) $(ENUM_OBJ) o.ver-enum
110         $(SET_UTIL)
111
112 HOUR_OBJ = o.hour
113 HOUR_VER = 1.00
114 hour: $(HOUR_OBJ)
115         $(SETDATE) o.ver-hour version="$(HOUR_VER) [$(DATE)] ($(CRIGHT))"
116         $(LD_UTIL) $(HOUR_OBJ) o.ver-hour
117         $(SET_UTIL)
118
119 PATH_OBJ = o.path_util o.pathutil
120 PATH_VER = 1.10
121 pathutil: $(PATH_OBJ)
122         $(SETDATE) o.ver-path version="$(PATH_VER) [$(DATE)] ($(CRIGHT))"
123         $(LD_UTIL) $(PATH_OBJ) o.ver-path
124         $(SET_UTIL)
125
126 SLOT_OBJ = o.setslot
127 SLOT_VER = 1.00
128 setslot: $(SLOT_OBJ)
129         $(SETDATE) o.ver-slot version="$(SLOT_VER) [$(DATE)] ($(CRIGHT))"
130         $(LD_UTIL) $(SLOT_OBJ) o.ver-slot
131         $(SET_UTIL)
132
133 TEST_OBJ = o.test
134 TEST_VER = 1.00
135 test: $(TEST_OBJ)
136         $(SETDATE) o.ver-test version="$(TEST_VER) [$(DATE)] ($(CRIGHT))"
137         $(LD_UTIL) $(TEST_OBJ) o.ver-test
138         $(SET_UTIL)
139
140 # --- Various C programs ---
141
142 EACH_OBJ = o.each $(LIBS)
143 each: $(EACH_OBJ)
144         $(LD_APP) $(EACH_OBJ)
145         $(SQUEEZE)
146         $(SET_APP)
147
148 INST_OBJ = o.inst $(LIBS)
149 inst: $(INST_OBJ)
150         $(LD_APP) $(INST_OBJ)
151         $(SQUEEZE)
152         $(SET_APP)
153
154 SDATE_OBJ = o.setdate $(LIBS)
155 SDATE_VER = 1.00
156 setdate: $(SDATE_OBJ)
157         $(SETDATE) o.ver-sdate _time="$(SDATE_VER) [$(DATE)] ($(CRIGHT))"
158         $(LD_APP) $(SDATE_OBJ) o.ver-sdate
159         $(SQUEEZE)
160         $(SET_APP)
161
162 SSRC_OBJ = o.ssrclean $(LIBS)
163 ssrclean: $(SSRC_OBJ)
164         $(LD_APP) $(SSRC_OBJ)
165         $(SQUEEZE)
166         $(SET_APP)
167
168 SUBMAKE_OBJ = o.submake $(LIBS)
169 submake: $(SUBMAKE_OBJ)
170         $(LD_APP) $(SUBMAKE_OBJ)
171         $(SQUEEZE)
172         $(SET_APP)
173
174 # --- Sapphire header creation tools ---
175
176 HGEN_OBJ = o.headergen $(LIBS)
177 headergen: $(HGEN_OBJ)
178         $(LD_APP) $(HGEN_OBJ)
179         $(SQUEEZE)
180         $(SET_APP)
181
182 CHGEN_OBJ = o.chdrgen $(LIBS)
183 chdrgen: $(CHGEN_OBJ)
184         $(LD_APP) $(CHGEN_OBJ)
185         $(SQUEEZE)
186         $(SET_APP)
187
188 # --- Basic tools ---
189
190 buildstub: b.buildstub ex.buildstub
191         ccrunch -0 -xlibs:bas.exports -xex.buildstub b.buildstub buildstub
192
193 fixlink: b.fixlink
194         ccrunch -0 b.fixlink fixlink
195
196 msgaof: b.msgaof ex.msgaof
197         ccrunch -0 -xlibs:bas.exports -xex.msgaof b.msgaof msgaof
198
199 resgen: b.resgen ex.resgen
200         ccrunch -0 -xlibs:bas.exports -xex.resgen b.resgen resgen
201
202 templaof: b.templaof ex.templaof
203         ccrunch -0 -xlibs:bas.exports -xex.templaof b.templaof templaof
204
205 # --- The common library ---
206
207 LIBOBJS = o.alloc o.cmdr o.gf o.glob
208 o.culib: $(LIBOBJS)
209         $(AR) -c $(CULIB) $(LIBOBJS)
210
211 # --- Standard targets ---
212
213 install: $(PROGS)
214         $(INSTALL) $(PROGS) <SSR$BinDir>
215         $(INSTALL) enumerate hour pathutil <SSR$DLLDir>
216
217 clean:
218         -$(RM) o.* $(PROGS)
219
220 #----- Dynamic dependencies -------------------------------------------------
221
222 # Dynamic dependencies:
223 setslot: s.setslot
224 setslot: libs:header
225 setslot: libs:swis
226 setslot: libs:stream
227 test: s.test
228 test: libs:header
229 test: libs:swis
230 test: libs:stream
231 o.enumerate: s.enumerate
232 o.enumerate: libs:swis
233 o.enumerate: libs:header
234 o.hour: s.hour
235 o.hour: libs:header
236 o.hour: libs:swis
237 o.hour: libs:stream
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
245 o.test: s.test
246 o.test: libs:header
247 o.test: libs:swis
248 o.test: libs:stream
249 o.inst: c.inst
250 o.inst: libs:h.swis
251 o.inst: libs:h.swiv
252 o.inst: c:h.kernel
253 o.inst: h.cmdr
254 o.setdate:      c.setdate
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
260 o.setslot: s.setslot
261 o.setslot: libs:header
262 o.setslot: libs:swis
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
268 o.ssrclean:     h.cmdr
269 o.chdrgen:      c.chdrgen
270 o.chdrgen:      c:h.kernel
271 o.alloc:        c.alloc
272 o.alloc:        h.alloc
273 o.cmdr: c.cmdr
274 o.cmdr: libs:h.swis
275 o.cmdr: libs:h.swiv
276 o.cmdr: c:h.kernel
277 o.cmdr: h.alloc
278 o.cmdr: h.cmdr
279 o.cmdr: h.gf
280 o.cmdr: h.glob
281 o.glob: c.glob
282 o.glob: libs:h.swis
283 o.glob: libs:h.swiv
284 o.glob: c:h.kernel
285 o.glob: h.alloc
286 o.glob: h.gf
287 o.glob: h.glob
288 o.submake:      c.submake
289 o.submake:      libs:h.swis
290 o.submake:      libs:h.swiv
291 o.submake:      c:h.kernel
292 o.submake:      h.alloc
293 o.submake:      h.glob
294 o.headergen:    c.headergen
295 o.headergen:    c:h.kernel
296 o.headergen:    libs:h.swis
297 o.gf:   c.gf
298 o.gf:   libs:h.swis
299 o.gf:   libs:h.swiv
300 o.gf:   c:h.kernel
301 o.gf:   h.gf
302 each:   c.each
303 each:   libs:h.swis
304 each:   libs:h.swiv
305 each:   c:h.kernel
306 each:   h.glob
307 o.each: c.each
308 o.each: c:h.kernel
309 o.each: libs:h.swis
310 o.each: libs:h.swiv
311 o.each: h.glob