xref: /minix/external/mit/expat/dist/amiga/Makefile (revision e3b78ef1)
1#
2# Makefile for AmigaOS
3#
4
5.PHONY: help all check clean package
6.PHONY: clib2 newlib library so
7
8vpath %.c ../lib ../examples ../xmlwf ../tests ../tests/benchmark
9vpath %.h ../lib ../tests
10
11#############################################################################
12
13help:
14	@echo "Requires:"
15	@echo " AmigaOS 4.x"
16	@echo " SDK 53.13"
17	@echo ""
18	@echo "Targets:"
19	@echo " all     - make libraries, xmlwf, examples and runs tests"
20	@echo " install - install expat libraries and tools into SDK"
21	@echo " clean   - clean object files"
22	@echo " check   - run all the tests"
23	@echo " package - prepare distribution archive"
24
25all: clib2 newlib library so check
26
27clib2: clib2/libexpat.a clib2/xmlwf clib2/elements clib2/outline clib2/runtests clib2/benchmark
28
29newlib: newlib/libexpat.a newlib/xmlwf newlib/elements newlib/outline newlib/runtests newlib/benchmark
30
31library: libs/expat.library libs/xmlwf libs/elements libs/outline libs/runtests libs/benchmark
32
33so: so/libexpat.so so/xmlwf so/elements so/outline so/runtests so/benchmark
34
35check: clib2/runtests newlib/runtests libs/runtests so/runtests
36	clib2/runtests
37	newlib/runtests
38	libs/runtests
39	so/runtests
40
41clean:
42	-delete clib2/#?.o quiet
43	-delete newlib/#?.o quiet
44	-delete libs/#?.o quiet
45	-delete so/#?.o quiet
46
47package:
48	$(MAKE) all
49	-delete T:expat all force quiet
50	makedir all T:expat/Workbench/Libs
51	copy clone libs/expat.library T:expat/Workbench/Libs
52	makedir all T:expat/Workbench/SObjs
53	copy clone so/libexpat.so T:expat/Workbench/SObjs
54	makedir all T:expat/SDK/Local/C
55	copy clone libs/xmlwf T:expat/SDK/Local/C
56	makedir all T:expat/SDK/Local/clib2/lib
57	copy clone clib2/libexpat.a T:expat/SDK/Local/clib2/lib
58	makedir all T:expat/SDK/Local/newlib/lib
59	copy clone newlib/libexpat.a T:expat/SDK/Local/newlib/lib
60	makedir all T:expat/SDK/Local/common/include
61	copy clone /lib/expat.h /lib/expat_external.h T:expat/SDK/Local/common/include
62	makedir all T:expat/SDK/Include/include_h/inline4
63	copy clone include/inline4/expat.h T:expat/SDK/Include/include_h/inline4
64	makedir all T:expat/SDK/Include/include_h/interfaces
65	copy clone include/interfaces/expat.h T:expat/SDK/Include/include_h/interfaces
66	makedir all T:expat/SDK/Include/include_h/libraries
67	copy clone include/libraries/expat.h T:expat/SDK/Include/include_h/libraries
68	makedir all T:expat/SDK/Include/include_h/proto
69	copy clone include/proto/expat.h T:expat/SDK/Include/include_h/proto
70	makedir all T:expat/SDK/Documentation/Libs/Expat
71	copy clone /COPYING T:expat/SDK/Documentation/Libs/Expat
72	copy clone /README T:expat/SDK/Documentation/Libs/Expat
73	copy clone README.txt T:expat/SDK/Documentation/Libs/Expat/README.AmigaOS
74	-delete expat.lha
75	lha -r a expat.lha T:expat
76
77#############################################################################
78
79CC         := gcc
80LIBTOOL    := ar
81STRIP      := strip
82
83CFLAGS     := -DNDEBUG -O3
84LTFLAGS    := -crs
85STRIPFLAGS := -R.comment
86
87#############################################################################
88
89clib2/libexpat.a: clib2/xmlparse.o clib2/xmltok.o clib2/xmlrole.o
90	$(LIBTOOL) $(LTFLAGS) $@ $^
91	protect $@ -e
92
93clib2/xmlparse.o: xmlparse.c expat.h xmlrole.h xmltok.h \
94	expat_external.h internal.h amigaconfig.h
95
96clib2/xmlrole.o: xmlrole.c ascii.h xmlrole.h expat_external.h \
97	internal.h amigaconfig.h
98
99clib2/xmltok.o: xmltok.c xmltok_impl.c xmltok_ns.c ascii.h asciitab.h \
100	iasciitab.h latin1tab.h nametab.h utf8tab.h xmltok.h xmltok_impl.h \
101	expat_external.h internal.h amigaconfig.h
102
103#############################################################################
104
105clib2/xmlwf: clib2/xmlwf.o clib2/xmlfile.o clib2/codepage.o clib2/readfilemap.o
106	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a
107	$(STRIP) $(STRIPFLAGS) $@
108
109clib2/xmlwf.o: xmlwf.c
110
111clib2/xmlfile.o: xmlfile.c
112
113clib2/codepage.o: codepage.c
114
115clib2/readfilemap.o: readfilemap.c
116
117#############################################################################
118
119clib2/elements: clib2/elements.o
120	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a
121	$(STRIP) $(STRIPFLAGS) $@
122
123clib2/elements.o: elements.c
124
125#############################################################################
126
127clib2/outline: clib2/outline.o
128	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a
129	$(STRIP) $(STRIPFLAGS) $@
130
131clib2/outline.o: outline.c
132
133#############################################################################
134
135clib2/runtests: clib2/runtests.o clib2/chardata.o clib2/minicheck.o
136	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a
137
138clib2/chardata.o: chardata.c chardata.h
139
140clib2/minicheck.o: minicheck.c minicheck.h
141
142clib2/runtests.o: runtests.c chardata.h
143
144#############################################################################
145
146clib2/benchmark: clib2/benchmark.o
147	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a -lm
148
149clib2/benchmark.o: benchmark.c
150
151#############################################################################
152
153newlib/libexpat.a: newlib/xmlparse.o newlib/xmltok.o newlib/xmlrole.o
154	$(LIBTOOL) $(LTFLAGS) $@ $^
155	protect $@ -e
156
157newlib/xmlparse.o: xmlparse.c expat.h xmlrole.h xmltok.h \
158	expat_external.h internal.h amigaconfig.h
159
160newlib/xmlrole.o: xmlrole.c ascii.h xmlrole.h expat_external.h \
161	internal.h amigaconfig.h
162
163newlib/xmltok.o: xmltok.c xmltok_impl.c xmltok_ns.c ascii.h asciitab.h \
164	iasciitab.h latin1tab.h nametab.h utf8tab.h xmltok.h xmltok_impl.h \
165	expat_external.h internal.h amigaconfig.h
166
167#############################################################################
168
169newlib/xmlwf: newlib/xmlwf.o newlib/xmlfile.o newlib/codepage.o newlib/readfilemap.o
170	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
171	$(STRIP) $(STRIPFLAGS) $@
172
173newlib/xmlwf.o: xmlwf.c
174
175newlib/xmlfile.o: xmlfile.c
176
177newlib/codepage.o: codepage.c
178
179newlib/readfilemap.o: readfilemap.c
180
181#############################################################################
182
183newlib/elements: newlib/elements.o
184	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
185	$(STRIP) $(STRIPFLAGS) $@
186
187newlib/elements.o: elements.c
188
189#############################################################################
190
191newlib/outline: newlib/outline.o
192	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
193	$(STRIP) $(STRIPFLAGS) $@
194
195newlib/outline.o: outline.c
196
197#############################################################################
198
199newlib/runtests: newlib/runtests.o newlib/chardata.o newlib/minicheck.o
200	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
201
202newlib/chardata.o: chardata.c chardata.h
203
204newlib/minicheck.o: minicheck.c minicheck.h
205
206newlib/runtests.o: runtests.c chardata.h
207
208#############################################################################
209
210newlib/benchmark: newlib/benchmark.o
211	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
212
213newlib/benchmark.o: benchmark.c
214
215#############################################################################
216
217libs/expat.library: libs/expat_lib.o libs/expat_68k.o libs/expat_68k_handler_stubs.o libs/expat_vectors.o newlib/libexpat.a
218	$(CC) -mcrt=newlib -nostartfiles $^ -o $@ newlib/libexpat.a -Wl,--cref,-M,-Map=$@.map
219	protect $@ -e
220	$(STRIP) $(STRIPFLAGS) $@
221
222libs/expat_lib.o: expat_lib.c expat_base.h
223
224libs/expat_68k.o: expat_68k.c expat_68k.h expat_base.h
225
226libs/expat_68k_handler_stubs.o: expat_68k_handler_stubs.c expat_68k.h
227
228libs/expat_vectors.o: expat_vectors.c
229
230libs/launch.o: launch.c
231
232#############################################################################
233
234libs/xmlwf: libs/xmlwf.o libs/xmlfile.o libs/codepage.o libs/readfilemap.o libs/launch.o
235	$(CC) -mcrt=newlib $^ -o $@
236	$(STRIP) $(STRIPFLAGS) $@
237
238libs/xmlwf.o: xmlwf.c
239
240libs/xmlfile.o: xmlfile.c
241
242libs/codepage.o: codepage.c
243
244libs/readfilemap.o: readfilemap.c
245
246#############################################################################
247
248libs/elements: libs/elements.o libs/launch.o
249	$(CC) -mcrt=newlib $^ -o $@
250	$(STRIP) $(STRIPFLAGS) $@
251
252libs/elements.o: elements.c
253
254#############################################################################
255
256libs/outline: libs/outline.o libs/launch.o
257	$(CC) -mcrt=newlib $^ -o $@
258	$(STRIP) $(STRIPFLAGS) $@
259
260libs/outline.o: outline.c
261
262#############################################################################
263
264libs/runtests: libs/runtests.o libs/chardata.o libs/minicheck.o libs/launch.o
265	$(CC) -mcrt=newlib $^ -o $@
266
267libs/chardata.o: chardata.c chardata.h
268
269libs/minicheck.o: minicheck.c minicheck.h
270
271libs/runtests.o: runtests.c chardata.h
272
273#############################################################################
274
275libs/benchmark: libs/benchmark.o libs/launch.o
276	$(CC) -mcrt=newlib $^ -o $@
277
278libs/benchmark.o: benchmark.c
279
280#############################################################################
281
282so/libexpat.so: so/xmlparse.o so/xmltok.o so/xmlrole.o
283	$(CC) -mcrt=newlib -shared -o $@ $^
284	protect $@ -e
285
286so/xmlparse.o: xmlparse.c expat.h xmlrole.h xmltok.h \
287	expat_external.h internal.h amigaconfig.h
288
289so/xmlrole.o: xmlrole.c ascii.h xmlrole.h expat_external.h \
290	internal.h amigaconfig.h
291
292so/xmltok.o: xmltok.c xmltok_impl.c xmltok_ns.c ascii.h asciitab.h \
293	iasciitab.h latin1tab.h nametab.h utf8tab.h xmltok.h xmltok_impl.h \
294	expat_external.h internal.h amigaconfig.h
295
296#############################################################################
297
298so/xmlwf: newlib/xmlwf.o newlib/xmlfile.o newlib/codepage.o newlib/readfilemap.o
299	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
300	$(STRIP) $(STRIPFLAGS) $@
301
302#############################################################################
303
304so/elements: newlib/elements.o
305	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
306	$(STRIP) $(STRIPFLAGS) $@
307
308#############################################################################
309
310so/outline: newlib/outline.o
311	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
312	$(STRIP) $(STRIPFLAGS) $@
313
314#############################################################################
315
316so/runtests: newlib/runtests.o newlib/chardata.o newlib/minicheck.o
317	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
318
319#############################################################################
320
321so/benchmark: newlib/benchmark.o
322	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
323
324#############################################################################
325
326clib2/%.o: %.c
327	$(CC) -mcrt=clib2 $(CFLAGS) -I../lib -c $< -o $@
328
329newlib/%.o: %.c
330	$(CC) -mcrt=newlib $(CFLAGS) -I../lib -c $< -o $@
331
332libs/%.o: %.c
333	$(CC) -mcrt=newlib $(CFLAGS) -D__USE_INLINE__ -I. -Iinclude -Iinclude/libraries -I../lib -c $< -o $@
334
335so/%.o: %.c
336	$(CC) -mcrt=newlib $(CFLAGS) -fPIC -I../lib -c $< -o $@
337