Removed DESCRIPTION statement - only valid when compiling 16bit
[mirror-ossqm-expat.git] / amiga / Makefile
blobd4681a15d074f436e246650f5740452a9195233d
2 # Makefile for AmigaOS
5 .PHONY: help all staticlib sharedlib check clean install
7 vpath %.c ../lib ../examples ../xmlwf ../tests
8 vpath %.h ../lib ../tests
12 # Set these for SDK installation.
14 tooldir = SDK:Local/C
15 staticlibdir = SDK:Local/clib2/lib
16 staticincludedir = SDK:Local/clib2/include
17 sharedlibdir = SDK:Local/Libs
18 sharedincludedir = SDK:Local/common/include
21 ifeq ($(MAKECMDGOALS), staticlib)
22 DESTDIR = lib
23 else
24 DESTDIR = libs
25 endif
27 STATICLIB = $(DESTDIR)/libexpat.a
28 SHAREDLIB = $(DESTDIR)/expat.library
30 XMLWF = $(DESTDIR)/xmlwf
31 ELEMENTS = $(DESTDIR)/elements
32 OUTLINE = $(DESTDIR)/outline
33 RUNTESTS = $(DESTDIR)/runtests
34 BENCHMARK = $(DESTDIR)/benchmark
37 help:
38 @echo "Requires:"
39 @echo " AmigaOS 4.0"
40 @echo " SDK 51.15"
41 @echo " clib2 1.198"
42 @echo ""
43 @echo "Targets:"
44 @echo " all - make expat libraries, xmlwf, examples and run test suite"
45 @echo " install - install expat libraries and tools into SDK"
47 all:
48 -makedir lib libs
49 $(MAKE) staticlib
50 $(MAKE) sharedlib
52 staticlib: $(STATICLIB) $(XMLWF) $(ELEMENTS) $(OUTLINE) $(RUNTESTS) $(BENCHMARK) check
53 @echo done
55 sharedlib: $(SHAREDLIB) $(XMLWF) $(ELEMENTS) $(OUTLINE) $(RUNTESTS) $(BENCHMARK) check
56 @echo done
58 check:
59 $(RUNTESTS)
61 clean:
62 -delete lib/#?.o quiet
63 -delete libs/#?.o quiet
65 install:
66 copy lib/xmlwf $(tooldir) quiet
67 copy /lib/expat.h /lib/expat_external.h $(staticincludedir) quiet
68 copy lib/libexpat.a $(staticlibdir) quiet
69 copy libs/expat.library $(sharedlibdir) quiet
70 copy include $(sharedincludedir) quiet all
73 CC = gcc
74 LIBTOOL = ar
75 STRIP = strip
77 LDFLAGS =
78 LIBS =
79 CFLAGS = -DNDEBUG -O2
80 LTFLAGS = -crs
81 STRIPFLAGS = -R.comment
82 LAUNCH =
84 ifeq ($(MAKECMDGOALS), staticlib)
85 LIBS += $(STATICLIB)
86 INCLUDES = -I../lib
87 endif
89 ifeq ($(MAKECMDGOALS), sharedlib)
90 CFLAGS += -DAMIGA_SHARED_LIB -D__USE_INLINE__
91 INCLUDES = -I. -Iinclude -Iinclude/libraries -I../lib
92 LAUNCH = $(DESTDIR)/launch.o
93 endif
96 COMPILE = $(CC) $(CFLAGS) $(INCLUDES) -c
98 LINK = $(CC) $(LDFLAGS) -o $@
101 $(STATICLIB): $(DESTDIR)/xmlparse.o $(DESTDIR)/xmltok.o $(DESTDIR)/xmlrole.o
102 $(LIBTOOL) $(LTFLAGS) $@ $^
104 $(DESTDIR)/xmlparse.o: xmlparse.c expat.h xmlrole.h xmltok.h \
105 expat_external.h internal.h amigaconfig.h
106 $(COMPILE) $< -o $@
108 $(DESTDIR)/xmlrole.o: xmlrole.c ascii.h xmlrole.h expat_external.h \
109 internal.h amigaconfig.h
110 $(COMPILE) $< -o $@
112 $(DESTDIR)/xmltok.o: xmltok.c xmltok_impl.c xmltok_ns.c ascii.h asciitab.h \
113 iasciitab.h latin1tab.h nametab.h utf8tab.h xmltok.h xmltok_impl.h \
114 expat_external.h internal.h amigaconfig.h
115 $(COMPILE) $< -o $@
118 $(SHAREDLIB): $(DESTDIR)/expat_lib.o $(DESTDIR)/expat_vectors.o $(DESTDIR)/stdlib.o lib/libexpat.a
119 $(LINK) -nostartfiles -nostdlib -o $@ $^
121 $(DESTDIR)/expat_lib.o: expat_lib.c
122 $(COMPILE) $< -o $@
124 $(DESTDIR)/expat_vectors.o: expat_vectors.c
125 $(COMPILE) $< -o $@
127 $(DESTDIR)/stdlib.o: stdlib.c
128 $(COMPILE) $< -o $@
130 $(LAUNCH): launch.c
131 $(COMPILE) $< -o $@
134 $(XMLWF): $(DESTDIR)/xmlwf.o $(DESTDIR)/xmlfile.o $(DESTDIR)/codepage.o $(DESTDIR)/readfilemap.o $(LAUNCH)
135 $(LINK) $^ $(LIBS)
136 $(STRIP) $(STRIPFLAGS) $@
138 $(DESTDIR)/xmlwf.o: xmlwf.c
139 $(COMPILE) $< -o $@
141 $(DESTDIR)/xmlfile.o: xmlfile.c
142 $(COMPILE) $< -o $@
144 $(DESTDIR)/codepage.o: codepage.c
145 $(COMPILE) $< -o $@
147 $(DESTDIR)/readfilemap.o: readfilemap.c
148 $(COMPILE) $< -o $@
151 $(ELEMENTS): $(DESTDIR)/elements.o $(LAUNCH)
152 $(LINK) $^ $(LIBS)
153 $(STRIP) $(STRIPFLAGS) $@
155 $(DESTDIR)/elements.o: elements.c
156 $(COMPILE) $< -o $@
159 $(OUTLINE): $(DESTDIR)/outline.o $(LAUNCH)
160 $(LINK) $^ $(LIBS)
161 $(STRIP) $(STRIPFLAGS) $@
163 $(DESTDIR)/outline.o: outline.c
164 $(COMPILE) $< -o $@
167 $(RUNTESTS): $(DESTDIR)/runtests.o $(DESTDIR)/chardata.o $(DESTDIR)/minicheck.o $(LAUNCH)
168 $(LINK) $^ $(LIBS)
170 $(DESTDIR)/chardata.o: chardata.c chardata.h
171 $(COMPILE) $< -o $@
173 $(DESTDIR)/minicheck.o: minicheck.c minicheck.h
174 $(COMPILE) $< -o $@
176 $(DESTDIR)/runtests.o: runtests.c chardata.h
177 $(COMPILE) $< -o $@
180 $(BENCHMARK): $(DESTDIR)/benchmark.o $(LAUNCH)
181 $(LINK) $^ $(LIBS) -lm
183 $(DESTDIR)/benchmark.o: benchmark/benchmark.c
184 $(COMPILE) $< -o $@