1 SYSTEM := $(shell uname -s)
6 RANLIB := $(CROSS)-ranlib
8 CP := cp -p --remove-destination
11 CFLAGS := -fno-stack-protector $(OPTIMIZE) -Wall -Wno-pointer-sign -Iinclude -Iinclude/aros -Idms -DCATCOMP_NUMBERS -DMIN_OS_VERSION=39
12 DEVICE_FLAGS := -Idevice/include -DDEVICE
13 PLUGIN_FLAGS := -D__NOLIBBASE__
14 GUI_FLAGS := -Izune_gui/include -DGUI
15 LINK := $(OPTIMIZE) -s
19 TARGET := diskimage.device
22 SFD := sfd/diskimage_lib.sfd sfd/expat_lib.sfd sfd/z_lib.sfd sfd/bz2_lib.sfd
23 PROTO := $(patsubst sfd/%_lib.sfd,include/aros/proto/%.h,$(SFD))
24 CLIB := $(patsubst sfd/%_lib.sfd,include/aros/clib/%_protos.h,$(SFD))
25 DEFINES := $(patsubst sfd/%_lib.sfd,include/aros/defines/%.h,$(SFD))
26 INCLUDE := $(PROTO) $(CLIB) $(DEFINES)
28 SUPPORT_OBJS := support/aros/asprintf.o support/aros/asprintfpooled.o support/checkbptr.o \
29 support/checklib.o support/copystringbstrtoc.o support/deletelibrary.o support/dos64.o \
30 support/envvar.o support/getcurrentdir.o support/hooks.o support/lists.o support/messages.o \
31 support/mutexes.o support/paths.o support/ports.o support/semaphores.o support/strlcpy.o \
32 support/swab2.o support/tooltypes.o support/istext.o support/trimstr.o support/diskimagedevice.o \
33 support/localeinfo.o support/translatefuncs.o support/reallocbuf.o support/setprocwindow.o
34 PREFS_OBJS := prefs/prefs.o prefs/readprefs.o prefs/writeprefs.o
35 DEVICE_OBJS := device/stub_x86.o device/init.o device/io.o device/unit.o device/scsicmd.o \
36 device/locale.o device/plugins.o device/tempfile.o device/progress.o device/password.o \
37 device/main_vectors.o device/plugin_vectors.o plugins/generic.o plugins/adf.o plugins/d64.o \
39 PLUGIN_OBJS := $(patsubst %.c,%.o,$(wildcard plugins/*.c) $(wildcard plugins/cue/*.c) \
40 $(wildcard plugins/dmg/*.c) $(wildcard plugins/fdi/*.c))
41 CUE_OBJS := plugins/cue/cue.o plugins/cue/flac.o plugins/cue/wavpack.o audio/aiff.o audio/flac.o \
42 audio/mp3_mpg123.o audio/vorbis.o audio/wave.o audio/wavpack.o plugins/cue/malloc.o \
43 plugins/cue/fdio.o plugins/cue/string.o plugins/cue/stdio.o plugins/cue/select.o
44 DMS_OBJS := dms/crc_csum.o dms/getbits.o dms/tables.o dms/maketbl.o dms/u_init.o \
45 dms/u_deep.o dms/u_heavy.o dms/u_medium.o dms/u_quick.o dms/u_rle.o
46 GUI_OBJS := zune_gui/locale.o zune_gui/main.o zune_gui/gui.o zune_gui/drivelist.o \
47 zune_gui/pluginlist.o zune_gui/driveops.o zune_gui/requesters.o zune_gui/images.o
48 ALL_OBJS := lib/libsupport.a support/*.o support/aros/*.o lib/libprefs.a prefs/*.o \
49 device/*.o plugins/*.o plugins/cue/*.o plugins/dmg/*.o plugins/fdi/*.o dms/*.o \
50 audio/*.o cmd/*.o zune_gui/*.o
51 PLUGINS := plugins/CCD plugins/CISO plugins/CPC plugins/cue/CUE plugins/DAA plugins/DAX plugins/dmg/DMG \
52 plugins/DMS plugins/fdi/FDI plugins/GI plugins/NRG plugins/MDS plugins/UIF
53 RELEASEDIR := ../release/x86-aros/diskimage_device
55 # -------------------------------------------------------------
57 all: $(INCLUDE) lib/libsupport.a device/$(TARGET) $(PLUGINS) z_library bz2_library \
58 expat_library cmd/MountDiskImage cmd/MountHDF zune_gui/DiskImageGUI
60 include/aros/proto/%.h: sfd/%_lib.sfd
61 sfdc --target=i386-aros --mode=proto --output=$@ $<
63 include/aros/clib/%_protos.h: sfd/%_lib.sfd
64 sfdc --target=i386-aros --mode=clib --output=$@ $<
66 include/aros/defines/%.h: sfd/%_lib.sfd
67 sfdc --target=i386-aros --mode=macros --output=$@ $<
69 lib/libsupport.a: $(SUPPORT_OBJS)
73 lib/libprefs.a: $(PREFS_OBJS)
77 $(DEVICE_OBJS): CFLAGS += $(DEVICE_FLAGS)
79 device/$(TARGET): $(DEVICE_OBJS) lib/libprefs.a lib/libsupport.a
80 $(CC) -nostartfiles $(LINK) -o $@ $^ $(LIBS)
82 device/init.o: include/rev/$(TARGET)_rev.h
83 device/locale.o: include/device_locale.h
85 include/device_locale.h: device/catalogs/diskimagedevice.cd
86 ifeq ($(SYSTEM),AmigaOS)
87 catcomp $< NOCODE CFILE $@
92 plugins/cue/cue.o plugins/cue/flac.o plugins/cue/wavpack.o: CFLAGS += -DUSE_FLAC -DUSE_MPG123 -DUSE_VORBIS -DUSE_WAVPACK
94 $(PLUGIN_OBJS): include/rev/$(TARGET)_rev.h
95 $(PLUGIN_OBJS): CFLAGS += $(PLUGIN_FLAGS)
97 plugins/CCD: plugins/stub_x86.o plugins/ccd.o lib/libsupport.a
98 $(CC) -nostartfiles $(LINK) -o $@ $^
100 plugins/CISO: plugins/stub_x86.o plugins/ciso.o lib/libsupport.a
101 $(CC) -nostartfiles $(LINK) -o $@ $^
103 plugins/CPC: plugins/stub_x86.o plugins/cpc.o lib/libsupport.a
104 $(CC) -nostartfiles $(LINK) -o $@ $^
106 plugins/cue/CUE: plugins/stub_x86.o $(CUE_OBJS) lib/libsupport.a
107 $(CC) -nostartfiles $(LINK) -o $@ $^ -lmpg123 -lFLAC -lwavpack -lvorbisfile -lvorbis -logg -lm
109 plugins/DAA: plugins/stub_x86.o plugins/daa.o lib/libsupport.a
110 $(CC) -nostartfiles $(LINK) -o $@ $^
112 plugins/DAX: plugins/stub_x86.o plugins/dax.o lib/libsupport.a
113 $(CC) -nostartfiles $(LINK) -o $@ $^
115 plugins/dmg/DMG: plugins/stub_x86.o plugins/dmg/dmg.o plugins/dmg/base64.o plugins/dmg/adc.o lib/libsupport.a
116 $(CC) -nostartfiles $(LINK) -o $@ $^
118 plugins/DMS: plugins/stub_x86.o plugins/dms.o $(DMS_OBJS) lib/libsupport.a
119 $(CC) -nostartfiles $(LINK) -o $@ $^
121 plugins/fdi/FDI: plugins/stub_x86.o plugins/fdi/fdi.o plugins/fdi/fdi2raw.o
122 $(CC) -nostartfiles $(LINK) -o $@ $^
124 plugins/GI: plugins/stub_x86.o plugins/gi.o lib/libsupport.a
125 $(CC) -nostartfiles $(LINK) -o $@ $^
127 plugins/MDS: plugins/stub_x86.o plugins/mds.o lib/libsupport.a
128 $(CC) -nostartfiles $(LINK) -o $@ $^
130 plugins/NRG: plugins/stub_x86.o plugins/nrg.o lib/libsupport.a
131 $(CC) -nostartfiles $(LINK) -o $@ $^
133 plugins/UIF: plugins/stub_x86.o plugins/uif.o lib/libsupport.a
134 $(CC) -nostartfiles $(LINK) -o $@ $^
136 plugins/XAD: plugins/stub_x86.o plugins/xad.o lib/libsupport.a
137 $(CC) -nostartfiles $(LINK) -o $@ $^
139 plugins/XPK: plugins/stub_x86.o plugins/xpk.o lib/libsupport.a
140 $(CC) -nostartfiles $(LINK) -o $@ $^
142 cmd/MountDiskImage: cmd/mountdiskimage.o lib/libsupport.a
143 $(CC) $(LINK) -o $@ $^ -lmui
145 cmd/mountdiskimage.o: include/rev/MountDiskImage_rev.h
147 cmd/MountHDF: cmd/mounthdf.o lib/libsupport.a
148 $(CC) $(LINK) -o $@ $^ -lmui
150 cmd/mounthdf.o: include/rev/MountHDF_rev.h
152 $(GUI_OBJS): CFLAGS += $(GUI_FLAGS)
154 zune_gui/DiskImageGUI: $(GUI_OBJS) lib/libsupport.a
155 $(CC) $(LINK) -o $@ $^ $(GUI_LIBS)
157 zune_gui/main.o zune_gui/gui.o: include/rev/DiskImageGUI_rev.h
158 zune_gui/locale.o: zune_gui/include/locale.h
160 zune_gui/include/locale.h: zune_gui/catalogs/diskimagegui.cd
161 ifeq ($(SYSTEM),AmigaOS)
162 catcomp $< NOCODE CFILE $@
164 catcomp $< --cfile $@
167 .PHONY: z_library bz2_library expat_library
169 z_library bz2_library expat_library:
170 $(MAKE) -C $@ -f Makefile.x86-aros
175 $(CP) device/$(TARGET) $(RELEASEDIR)/Devs/
176 $(CP) $(PLUGINS) $(RELEASEDIR)/Devs/DiskImage/
177 $(CP) z_library/z.library $(RELEASEDIR)/Libs/
178 $(CP) bz2_library/bz2.library $(RELEASEDIR)/Libs/
179 $(CP) expat_library/expat.library $(RELEASEDIR)/Libs/
180 $(CP) cmd/MountDiskImage cmd/MountHDF $(RELEASEDIR)/C/
181 $(CP) zune_gui/DiskImageGUI $(RELEASEDIR)/
182 # $(CP) device/catalogs/*.cd $(RELEASEDIR)/Catalogs/
183 # $(CP) zune_gui/catalogs/*.cd $(RELEASEDIR)/Catalogs/
187 $(MAKE) -C z_library -f Makefile.x86-aros clean
188 $(MAKE) -C bz2_library -f Makefile.x86-aros clean
189 $(MAKE) -C expat_library -f Makefile.x86-aros clean