1 |
# Windows Makefile for Basilisk II |
2 |
|
3 |
## System specific configuration |
4 |
|
5 |
SHELL = /bin/sh |
6 |
|
7 |
prefix = @prefix@ |
8 |
exec_prefix = @exec_prefix@ |
9 |
bindir = @bindir@ |
10 |
datadir = @datadir@ |
11 |
mandir = @mandir@ |
12 |
man1dir = $(mandir)/man1 |
13 |
|
14 |
KEYCODES = ../SDL/keycodes |
15 |
|
16 |
DESTDIR = |
17 |
|
18 |
SDL_CFLAGS = @SDL_CFLAGS@ |
19 |
SDL_LIBS = @SDL_LIBS@ |
20 |
WANT_GTK = @WANT_GTK@ |
21 |
GTK_CFLAGS = @GTK_CFLAGS@ |
22 |
GTK_LIBS = @GTK_LIBS@ |
23 |
|
24 |
LN_S = @LN_S@ |
25 |
WINDRES = @WINDRES@ |
26 |
CC = @CC@ |
27 |
CXX = @CXX@ |
28 |
CFLAGS = @CFLAGS@ $(SDL_CFLAGS) |
29 |
CXXFLAGS = @CXXFLAGS@ $(SDL_CFLAGS) |
30 |
CPPFLAGS = @CPPFLAGS@ -I../include -I. @CPUINCLUDES@ |
31 |
DEFS = @DEFS@ @DEFINES@ |
32 |
LDFLAGS = @LDFLAGS@ |
33 |
LIBS = @LIBS@ |
34 |
CPUSRCS = @CPUSRCS@ |
35 |
|
36 |
HOST_CC = gcc |
37 |
HOST_CXX = g++ |
38 |
HOST_CFLAGS = -O2 |
39 |
HOST_CXXFLAGS = -O2 |
40 |
HOST_LDFLAGS = |
41 |
|
42 |
## Files |
43 |
UNIXSRCS = vm_alloc.cpp vm_alloc.h sigsegv.cpp sigsegv.h video_vosf.h video_blit.cpp video_blit.h |
44 |
|
45 |
CDENABLESRCS = cdenable/cache.cpp cdenable/eject_nt.cpp cdenable/ntcd.cpp |
46 |
|
47 |
ROUTERSRCS = router/arp.cpp router/dump.cpp router/dynsockets.cpp router/ftp.cpp \ |
48 |
router/icmp.cpp router/mib/interfaces.cpp router/iphelp.cpp router/ipsocket.cpp \ |
49 |
router/mib/mibaccess.cpp router/router.cpp router/tcp.cpp router/udp.cpp b2ether/packet32.cpp |
50 |
|
51 |
SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_windows.cpp \ |
52 |
sys_windows.cpp ../rom_patches.cpp ../slot_rom.cpp ../rsrc_patches.cpp \ |
53 |
../emul_op.cpp ../macos_util.cpp ../xpram.cpp xpram_windows.cpp ../timer.cpp \ |
54 |
timer_windows.cpp ../adb.cpp ../serial.cpp serial_windows.cpp \ |
55 |
../ether.cpp ether_windows.cpp ../sony.cpp ../disk.cpp ../cdrom.cpp \ |
56 |
../scsi.cpp ../dummy/scsi_dummy.cpp ../video.cpp ../SDL/video_sdl.cpp \ |
57 |
video_blit.cpp ../audio.cpp ../SDL/audio_sdl.cpp clip_windows.cpp \ |
58 |
../extfs.cpp extfs_windows.cpp ../user_strings.cpp user_strings_windows.cpp \ |
59 |
vm_alloc.cpp sigsegv.cpp posix_emu.cpp util_windows.cpp kernel_windows.cpp \ |
60 |
../dummy/prefs_editor_dummy.cpp BasiliskII.rc \ |
61 |
$(CDENABLESRCS) $(ROUTERSRCS) $(CPUSRCS) |
62 |
|
63 |
UI_SRCS = ../prefs.cpp prefs_windows.cpp prefs_editor_gtk.cpp xpram_windows.cpp \ |
64 |
../prefs_items.cpp ../user_strings.cpp user_strings_windows.cpp b2ether/Packet32.cpp BasiliskIIGUI.rc |
65 |
|
66 |
UI_APP = BasiliskIIGUI.exe |
67 |
|
68 |
APP = BasiliskII.exe |
69 |
|
70 |
PROGS = $(APP) |
71 |
|
72 |
ifeq ($(WANT_GTK),yes) |
73 |
PROGS += $(UI_APP) |
74 |
endif |
75 |
|
76 |
## Rules |
77 |
.PHONY: modules install installdirs uninstall mostlyclean clean distclean depend dep |
78 |
.SUFFIXES: |
79 |
.SUFFIXES: .c .cpp .s .o .h |
80 |
|
81 |
all: $(PROGS) |
82 |
|
83 |
$(UNIXSRCS): %: ../Unix/% |
84 |
$(LN_S) $< $@ |
85 |
|
86 |
OBJ_DIR = obj |
87 |
$(OBJ_DIR):: |
88 |
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
89 |
|
90 |
define SRCS_LIST_TO_OBJS |
91 |
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ |
92 |
$(basename $(notdir $(file)))))) |
93 |
endef |
94 |
OBJS = $(SRCS_LIST_TO_OBJS) |
95 |
|
96 |
define UI_SRCS_LIST_TO_OBJS |
97 |
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(UI_SRCS), \ |
98 |
$(basename $(notdir $(file)))))) |
99 |
endef |
100 |
UI_OBJS = $(UI_SRCS_LIST_TO_OBJS) |
101 |
|
102 |
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
103 |
VPATH := |
104 |
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
105 |
|
106 |
$(APP): $(UNIXSRCS) $(OBJ_DIR) $(OBJS) |
107 |
$(CXX) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) $(SDL_LIBS) |
108 |
|
109 |
$(UI_APP): $(UNIXSRCS) $(OBJ_DIR) $(UI_OBJS) |
110 |
$(CXX) -o $@ $(LDFLAGS) $(UI_OBJS) $(LIBS) $(GTK_LIBS) -mwindows -mno-cygwin |
111 |
|
112 |
mostlyclean: |
113 |
rm -f $(APP) $(UI_APP) $(OBJ_DIR)/* core* *.core *~ *.bak |
114 |
|
115 |
clean: mostlyclean |
116 |
rm -f $(UNIXSRCS) |
117 |
rm -f cpuemu.cpp cpudefs.cpp cputmp*.s cpufast*.s cpustbl.cpp cputbl.h compemu.cpp compstbl.cpp comptbl.h |
118 |
|
119 |
distclean: clean |
120 |
rm -rf $(OBJ_DIR) |
121 |
rm -rf autom4te.cache |
122 |
rm -f Makefile |
123 |
rm -f config.cache config.log config.status config.h |
124 |
|
125 |
depend dep: |
126 |
makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null |
127 |
|
128 |
$(OBJ_DIR)/%.ho : %.c |
129 |
$(HOST_CC) $(CPPFLAGS) $(DEFS) $(HOST_CFLAGS) -c $< -o $@ |
130 |
$(OBJ_DIR)/%.ho : %.cpp |
131 |
$(HOST_CXX) $(CPPFLAGS) $(DEFS) $(HOST_CXXFLAGS) -c $< -o $@ |
132 |
$(OBJ_DIR)/%.o : %.c |
133 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
134 |
$(OBJ_DIR)/%.o : %.cpp |
135 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
136 |
$(OBJ_DIR)/%.o : %.s |
137 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
138 |
$(OBJ_DIR)/prefs_editor_gtk.o: prefs_editor_gtk.cpp |
139 |
$(CXX) -O2 -mno-cygwin -mms-bitfields $(CPPFLAGS) $(DEFS) $(GTK_CFLAGS) -c $< -o $@ |
140 |
|
141 |
# Windows resources |
142 |
$(OBJ_DIR)/%.o: %.rc |
143 |
$(WINDRES) --include-dir ../Windows -i $< -o $@ |
144 |
$(OBJ_DIR)/build68k.exe: $(OBJ_DIR)/build68k.ho |
145 |
$(HOST_CC) $(HOST_LDFLAGS) -o $@ $< |
146 |
$(OBJ_DIR)/gencpu.exe: $(OBJ_DIR)/gencpu.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho |
147 |
$(HOST_CXX) $(HOST_LDFLAGS) -o $@ $(OBJ_DIR)/gencpu.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho |
148 |
$(OBJ_DIR)/gencomp.exe: $(OBJ_DIR)/gencomp.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho |
149 |
$(HOST_CXX) $(HOST_LDFLAGS) -o $@ $(OBJ_DIR)/gencomp.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho |
150 |
|
151 |
cpudefs.cpp: $(OBJ_DIR)/build68k.exe ../uae_cpu/table68k |
152 |
$(OBJ_DIR)/build68k.exe ../uae_cpu/table68k >cpudefs.cpp |
153 |
cpustbl.cpp: cpuemu.cpp |
154 |
cpustbl_nf.cpp: cpustbl.cpp |
155 |
compstbl.cpp: compemu.cpp |
156 |
cputbl.h: cpuemu.cpp |
157 |
comptbl.h: compemu.cpp |
158 |
|
159 |
cpuemu.cpp: $(OBJ_DIR)/gencpu.exe |
160 |
$(OBJ_DIR)/gencpu.exe |
161 |
|
162 |
compemu.cpp: $(OBJ_DIR)/gencomp.exe |
163 |
$(OBJ_DIR)/gencomp.exe |
164 |
|
165 |
$(OBJ_DIR)/cpustbl_nf.o: cpustbl.cpp |
166 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DNOFLAGS -c $< -o $@ |
167 |
|
168 |
$(OBJ_DIR)/compemu_support.o: compemu_support.cpp comptbl.h |
169 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
170 |
|
171 |
$(OBJ_DIR)/cpuemu1.o: cpuemu.cpp |
172 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@ |
173 |
$(OBJ_DIR)/cpuemu2.o: cpuemu.cpp |
174 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@ |
175 |
$(OBJ_DIR)/cpuemu3.o: cpuemu.cpp |
176 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@ |
177 |
$(OBJ_DIR)/cpuemu4.o: cpuemu.cpp |
178 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@ |
179 |
$(OBJ_DIR)/cpuemu5.o: cpuemu.cpp |
180 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@ |
181 |
$(OBJ_DIR)/cpuemu6.o: cpuemu.cpp |
182 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@ |
183 |
$(OBJ_DIR)/cpuemu7.o: cpuemu.cpp |
184 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@ |
185 |
$(OBJ_DIR)/cpuemu8.o: cpuemu.cpp |
186 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@ |
187 |
|
188 |
$(OBJ_DIR)/cpuemu1_nf.o: cpuemu.cpp |
189 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
190 |
$(OBJ_DIR)/cpuemu2_nf.o: cpuemu.cpp |
191 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
192 |
$(OBJ_DIR)/cpuemu3_nf.o: cpuemu.cpp |
193 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
194 |
$(OBJ_DIR)/cpuemu4_nf.o: cpuemu.cpp |
195 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
196 |
$(OBJ_DIR)/cpuemu5_nf.o: cpuemu.cpp |
197 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
198 |
$(OBJ_DIR)/cpuemu6_nf.o: cpuemu.cpp |
199 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
200 |
$(OBJ_DIR)/cpuemu7_nf.o: cpuemu.cpp |
201 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
202 |
$(OBJ_DIR)/cpuemu8_nf.o: cpuemu.cpp |
203 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
204 |
|
205 |
$(OBJ_DIR)/compemu1.o: compemu.cpp |
206 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@ |
207 |
$(OBJ_DIR)/compemu2.o: compemu.cpp |
208 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@ |
209 |
$(OBJ_DIR)/compemu3.o: compemu.cpp |
210 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@ |
211 |
$(OBJ_DIR)/compemu4.o: compemu.cpp |
212 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@ |
213 |
$(OBJ_DIR)/compemu5.o: compemu.cpp |
214 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@ |
215 |
$(OBJ_DIR)/compemu6.o: compemu.cpp |
216 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@ |
217 |
$(OBJ_DIR)/compemu7.o: compemu.cpp |
218 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@ |
219 |
$(OBJ_DIR)/compemu8.o: compemu.cpp |
220 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@ |
221 |
|
222 |
#------------------------------------------------------------------------- |
223 |
# DO NOT DELETE THIS LINE -- make depend depends on it. |