Home | History | Annotate | Download | only in amiga
      1 #
      2 # Makefile for AmigaOS
      3 #
      4 
      5 .PHONY: help all check clean package
      6 .PHONY: clib2 newlib library so
      7 
      8 vpath %.c ../lib ../examples ../xmlwf ../tests ../tests/benchmark
      9 vpath %.h ../lib ../tests
     10 
     11 #############################################################################
     12 
     13 help:
     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 
     25 all: clib2 newlib library so check
     26 
     27 clib2: clib2/libexpat.a clib2/xmlwf clib2/elements clib2/outline clib2/runtests clib2/benchmark
     28 
     29 newlib: newlib/libexpat.a newlib/xmlwf newlib/elements newlib/outline newlib/runtests newlib/benchmark
     30 
     31 library: libs/expat.library libs/xmlwf libs/elements libs/outline libs/runtests libs/benchmark
     32 
     33 so: so/libexpat.so so/xmlwf so/elements so/outline so/runtests so/benchmark
     34 
     35 check: clib2/runtests newlib/runtests libs/runtests so/runtests
     36 	clib2/runtests
     37 	newlib/runtests
     38 	libs/runtests
     39 	so/runtests
     40 
     41 clean:
     42 	-delete clib2/#?.o quiet
     43 	-delete newlib/#?.o quiet
     44 	-delete libs/#?.o quiet
     45 	-delete so/#?.o quiet
     46 
     47 package:
     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 
     79 CC         := gcc
     80 LIBTOOL    := ar
     81 STRIP      := strip
     82 
     83 CFLAGS     := -DNDEBUG -O3
     84 LTFLAGS    := -crs
     85 STRIPFLAGS := -R.comment
     86 
     87 #############################################################################
     88 
     89 clib2/libexpat.a: clib2/xmlparse.o clib2/xmltok.o clib2/xmlrole.o
     90 	$(LIBTOOL) $(LTFLAGS) $@ $^
     91 	protect $@ -e
     92 
     93 clib2/xmlparse.o: xmlparse.c expat.h xmlrole.h xmltok.h \
     94 	expat_external.h internal.h amigaconfig.h
     95 
     96 clib2/xmlrole.o: xmlrole.c ascii.h xmlrole.h expat_external.h \
     97 	internal.h amigaconfig.h
     98 
     99 clib2/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 
    105 clib2/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 
    109 clib2/xmlwf.o: xmlwf.c
    110 
    111 clib2/xmlfile.o: xmlfile.c
    112 
    113 clib2/codepage.o: codepage.c
    114 
    115 clib2/readfilemap.o: readfilemap.c
    116 
    117 #############################################################################
    118 
    119 clib2/elements: clib2/elements.o
    120 	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a
    121 	$(STRIP) $(STRIPFLAGS) $@
    122 
    123 clib2/elements.o: elements.c
    124 
    125 #############################################################################
    126 
    127 clib2/outline: clib2/outline.o
    128 	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a
    129 	$(STRIP) $(STRIPFLAGS) $@
    130 
    131 clib2/outline.o: outline.c
    132 
    133 #############################################################################
    134 
    135 clib2/runtests: clib2/runtests.o clib2/chardata.o clib2/minicheck.o
    136 	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a
    137 
    138 clib2/chardata.o: chardata.c chardata.h
    139 
    140 clib2/minicheck.o: minicheck.c minicheck.h
    141 
    142 clib2/runtests.o: runtests.c chardata.h
    143 
    144 #############################################################################
    145 
    146 clib2/benchmark: clib2/benchmark.o
    147 	$(CC) -mcrt=clib2 $^ -o $@ clib2/libexpat.a -lm
    148 
    149 clib2/benchmark.o: benchmark.c
    150 
    151 #############################################################################
    152 
    153 newlib/libexpat.a: newlib/xmlparse.o newlib/xmltok.o newlib/xmlrole.o
    154 	$(LIBTOOL) $(LTFLAGS) $@ $^
    155 	protect $@ -e
    156 
    157 newlib/xmlparse.o: xmlparse.c expat.h xmlrole.h xmltok.h \
    158 	expat_external.h internal.h amigaconfig.h
    159 
    160 newlib/xmlrole.o: xmlrole.c ascii.h xmlrole.h expat_external.h \
    161 	internal.h amigaconfig.h
    162 
    163 newlib/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 
    169 newlib/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 
    173 newlib/xmlwf.o: xmlwf.c
    174 
    175 newlib/xmlfile.o: xmlfile.c
    176 
    177 newlib/codepage.o: codepage.c
    178 
    179 newlib/readfilemap.o: readfilemap.c
    180 
    181 #############################################################################
    182 
    183 newlib/elements: newlib/elements.o
    184 	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
    185 	$(STRIP) $(STRIPFLAGS) $@
    186 
    187 newlib/elements.o: elements.c
    188 
    189 #############################################################################
    190 
    191 newlib/outline: newlib/outline.o
    192 	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
    193 	$(STRIP) $(STRIPFLAGS) $@
    194 
    195 newlib/outline.o: outline.c
    196 
    197 #############################################################################
    198 
    199 newlib/runtests: newlib/runtests.o newlib/chardata.o newlib/minicheck.o
    200 	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
    201 
    202 newlib/chardata.o: chardata.c chardata.h
    203 
    204 newlib/minicheck.o: minicheck.c minicheck.h
    205 
    206 newlib/runtests.o: runtests.c chardata.h
    207 
    208 #############################################################################
    209 
    210 newlib/benchmark: newlib/benchmark.o
    211 	$(CC) -mcrt=newlib $^ -o $@ newlib/libexpat.a
    212 
    213 newlib/benchmark.o: benchmark.c
    214 
    215 #############################################################################
    216 
    217 libs/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 
    222 libs/expat_lib.o: expat_lib.c expat_base.h
    223 
    224 libs/expat_68k.o: expat_68k.c expat_68k.h expat_base.h
    225 
    226 libs/expat_68k_handler_stubs.o: expat_68k_handler_stubs.c expat_68k.h
    227 
    228 libs/expat_vectors.o: expat_vectors.c
    229 
    230 libs/launch.o: launch.c
    231 
    232 #############################################################################
    233 
    234 libs/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 
    238 libs/xmlwf.o: xmlwf.c
    239 
    240 libs/xmlfile.o: xmlfile.c
    241 
    242 libs/codepage.o: codepage.c
    243 
    244 libs/readfilemap.o: readfilemap.c
    245 
    246 #############################################################################
    247 
    248 libs/elements: libs/elements.o libs/launch.o
    249 	$(CC) -mcrt=newlib $^ -o $@
    250 	$(STRIP) $(STRIPFLAGS) $@
    251 
    252 libs/elements.o: elements.c
    253 
    254 #############################################################################
    255 
    256 libs/outline: libs/outline.o libs/launch.o
    257 	$(CC) -mcrt=newlib $^ -o $@
    258 	$(STRIP) $(STRIPFLAGS) $@
    259 
    260 libs/outline.o: outline.c
    261 
    262 #############################################################################
    263 
    264 libs/runtests: libs/runtests.o libs/chardata.o libs/minicheck.o libs/launch.o
    265 	$(CC) -mcrt=newlib $^ -o $@
    266 
    267 libs/chardata.o: chardata.c chardata.h
    268 
    269 libs/minicheck.o: minicheck.c minicheck.h
    270 
    271 libs/runtests.o: runtests.c chardata.h
    272 
    273 #############################################################################
    274 
    275 libs/benchmark: libs/benchmark.o libs/launch.o
    276 	$(CC) -mcrt=newlib $^ -o $@
    277 
    278 libs/benchmark.o: benchmark.c
    279 
    280 #############################################################################
    281 
    282 so/libexpat.so: so/xmlparse.o so/xmltok.o so/xmlrole.o
    283 	$(CC) -mcrt=newlib -shared -o $@ $^
    284 	protect $@ -e
    285 
    286 so/xmlparse.o: xmlparse.c expat.h xmlrole.h xmltok.h \
    287 	expat_external.h internal.h amigaconfig.h
    288 
    289 so/xmlrole.o: xmlrole.c ascii.h xmlrole.h expat_external.h \
    290 	internal.h amigaconfig.h
    291 
    292 so/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 
    298 so/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 
    304 so/elements: newlib/elements.o
    305 	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
    306 	$(STRIP) $(STRIPFLAGS) $@
    307 
    308 #############################################################################
    309 
    310 so/outline: newlib/outline.o
    311 	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
    312 	$(STRIP) $(STRIPFLAGS) $@
    313 
    314 #############################################################################
    315 
    316 so/runtests: newlib/runtests.o newlib/chardata.o newlib/minicheck.o
    317 	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
    318 
    319 #############################################################################
    320 
    321 so/benchmark: newlib/benchmark.o
    322 	$(CC) -mcrt=newlib -use-dynld $^ -o $@ -Lso -lexpat
    323 
    324 #############################################################################
    325 
    326 clib2/%.o: %.c
    327 	$(CC) -mcrt=clib2 $(CFLAGS) -I../lib -c $< -o $@
    328 
    329 newlib/%.o: %.c
    330 	$(CC) -mcrt=newlib $(CFLAGS) -I../lib -c $< -o $@
    331 
    332 libs/%.o: %.c
    333 	$(CC) -mcrt=newlib $(CFLAGS) -D__USE_INLINE__ -I. -Iinclude -Iinclude/libraries -I../lib -c $< -o $@
    334 
    335 so/%.o: %.c
    336 	$(CC) -mcrt=newlib $(CFLAGS) -fPIC -I../lib -c $< -o $@
    337