1 |
# Unix makefile for Basilisk II |
2 |
|
3 |
## System specific configuration |
4 |
@SET_MAKE@ |
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 = @KEYCODES@ |
15 |
|
16 |
DESTDIR = |
17 |
|
18 |
CC = @CC@ |
19 |
CXX = @CXX@ |
20 |
CFLAGS = @CFLAGS@ |
21 |
CXXFLAGS = @CXXFLAGS@ |
22 |
CPUINCLUDES_FLAGS=@CPUINCLUDES@ |
23 |
CPUINCLUDES_FLAGS:=$(CPUINCLUDES_FLAGS:-I%=-I@top_srcdir@/%) |
24 |
CPPFLAGS = @CPPFLAGS@ -I@top_srcdir@/../include -I@top_srcdir@/. -I. $(CPUINCLUDES_FLAGS) -I@top_srcdir@/../slirp |
25 |
DEFS = @DEFS@ @DEFINES@ -D_REENTRANT -DDATADIR=\"$(datadir)/$(APP)\" |
26 |
LDFLAGS = @LDFLAGS@ |
27 |
LIBS = @LIBS@ |
28 |
SYSSRCS = @SYSSRCS@ |
29 |
CPUSRCS = @CPUSRCS@ |
30 |
BLESS = @BLESS@ |
31 |
EXEEXT = @EXEEXT@ |
32 |
INSTALL = @INSTALL@ |
33 |
INSTALL_PROGRAM = @INSTALL_PROGRAM@ |
34 |
INSTALL_DATA = @INSTALL_DATA@ |
35 |
|
36 |
SLIRP_CFLAGS = @SLIRP_CFLAGS@ |
37 |
SLIRP_SRCS = @SLIRP_SRCS@ |
38 |
SLIRP_OBJS = $(SLIRP_SRCS:../slirp/%.c=obj/%.o) |
39 |
|
40 |
STANDALONE_GUI = @STANDALONE_GUI@ |
41 |
GUI_CFLAGS = @GUI_CFLAGS@ |
42 |
GUI_LIBS = @GUI_LIBS@ |
43 |
GUI_SRCS = ../prefs.cpp prefs_unix.cpp prefs_editor_gtk.cpp ../prefs_items.cpp \ |
44 |
../user_strings.cpp user_strings_unix.cpp xpram_unix.cpp sys_unix.cpp rpc_unix.cpp |
45 |
|
46 |
## Files |
47 |
SRCS = ../main.cpp main_unix.cpp ../prefs.cpp ../prefs_items.cpp prefs_unix.cpp \ |
48 |
sys_unix.cpp ../rom_patches.cpp ../slot_rom.cpp ../rsrc_patches.cpp \ |
49 |
../emul_op.cpp ../macos_util.cpp ../xpram.cpp xpram_unix.cpp ../timer.cpp \ |
50 |
timer_unix.cpp ../adb.cpp ../serial.cpp ../ether.cpp \ |
51 |
../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp ../video.cpp video_blit.cpp \ |
52 |
vm_alloc.cpp sigsegv.cpp ../audio.cpp ../extfs.cpp \ |
53 |
../user_strings.cpp user_strings_unix.cpp sshpty.c strlcpy.c rpc_unix.cpp \ |
54 |
$(SYSSRCS) $(CPUSRCS) $(SLIRP_SRCS) |
55 |
APP_FLAVOR ?= |
56 |
ifneq ($(APP_FLAVOR),) |
57 |
CURR_APP_FLAVOR := -$(APP_FLAVOR) |
58 |
else |
59 |
CURR_APP_FLAVOR := |
60 |
endif |
61 |
APP_BASENAME = BasiliskII |
62 |
APP = $(APP_BASENAME)$(CURR_APP_FLAVOR) |
63 |
APP_APP = $(APP).app |
64 |
|
65 |
PROGS = $(APP)$(EXEEXT) |
66 |
ifeq ($(STANDALONE_GUI),yes) |
67 |
GUI_APP = BasiliskIIGUI |
68 |
GUI_APP_APP = $(GUI_APP).app |
69 |
PROGS += $(GUI_APP)$(EXEEXT) |
70 |
else |
71 |
CXXFLAGS += $(GUI_CFLAGS) |
72 |
LIBS += $(GUI_LIBS) |
73 |
endif |
74 |
|
75 |
## Rules |
76 |
.PHONY: modules install installdirs uninstall mostlyclean clean distclean depend dep |
77 |
.SUFFIXES: |
78 |
.SUFFIXES: .c .cpp .s .o .h |
79 |
|
80 |
all: $(PROGS) |
81 |
|
82 |
OBJ_DIR = obj |
83 |
$(OBJ_DIR):: |
84 |
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
85 |
|
86 |
define SRCS_LIST_TO_OBJS |
87 |
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ |
88 |
$(basename $(notdir $(file)))))) |
89 |
endef |
90 |
OBJS := $(SRCS_LIST_TO_OBJS) |
91 |
SRCS := $(SRCS:%=@top_srcdir@/%) |
92 |
|
93 |
define GUI_SRCS_LIST_TO_OBJS |
94 |
$(addprefix $(OBJ_DIR)/, $(addsuffix .go, $(foreach file, $(GUI_SRCS), \ |
95 |
$(basename $(notdir $(file)))))) |
96 |
endef |
97 |
GUI_OBJS = $(GUI_SRCS_LIST_TO_OBJS) |
98 |
GUI_SRCS := $(GUI_SRCS:%=@top_srcdir@/%) |
99 |
|
100 |
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
101 |
VPATH := |
102 |
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
103 |
|
104 |
$(APP)$(EXEEXT): $(OBJ_DIR) $(OBJS) |
105 |
$(CXX) -o $@ $(LDFLAGS) $(OBJS) $(LIBS) |
106 |
$(BLESS) $(APP)$(EXEEXT) |
107 |
|
108 |
$(GUI_APP)$(EXEEXT): $(OBJ_DIR) $(GUI_OBJS) |
109 |
$(CXX) -o $@ $(LDFLAGS) $(GUI_OBJS) $(GUI_LIBS) |
110 |
|
111 |
$(APP)_app: $(APP) ../MacOSX/Info.plist ../MacOSX/$(APP).icns |
112 |
rm -rf $(APP_APP)/Contents |
113 |
mkdir -p $(APP_APP)/Contents |
114 |
./cpr.sh ../MacOSX/Info.plist $(APP_APP)/Contents/ |
115 |
echo -n 'APPL????' > $(APP_APP)/Contents/PkgInfo |
116 |
mkdir -p $(APP_APP)/Contents/MacOS |
117 |
./cpr.sh $(APP) $(APP_APP)/Contents/MacOS/ |
118 |
strip -x $(APP_APP)/Contents/MacOS/$(APP) |
119 |
mkdir -p $(APP_APP)/Contents/Resources |
120 |
./cpr.sh ../MacOSX/$(APP).icns $(APP_APP)/Contents/Resources/ |
121 |
|
122 |
$(GUI_APP)_app: $(GUI_APP) ../MacOSX/Info.plist ../MacOSX/$(APP).icns |
123 |
rm -rf $(GUI_APP_APP)/Contents |
124 |
mkdir -p $(GUI_APP_APP)/Contents |
125 |
sed -e "s/$(APP)/$(GUI_APP)/" < ../MacOSX/Info.plist > $(GUI_APP_APP)/Contents/Info.plist |
126 |
echo -n 'APPL????' > $(GUI_APP_APP)/Contents/PkgInfo |
127 |
mkdir -p $(GUI_APP_APP)/Contents/MacOS |
128 |
./cpr.sh $(GUI_APP) $(GUI_APP_APP)/Contents/MacOS/ |
129 |
strip -x $(GUI_APP_APP)/Contents/MacOS/$(GUI_APP) |
130 |
mkdir -p $(GUI_APP_APP)/Contents/Resources |
131 |
./cpr.sh ../MacOSX/$(APP).icns $(GUI_APP_APP)/Contents/Resources/$(GUI_APP).icns |
132 |
|
133 |
modules: |
134 |
cd Linux/NetDriver; make |
135 |
|
136 |
install: $(PROGS) installdirs |
137 |
$(INSTALL_PROGRAM) $(APP)$(EXEEXT) $(DESTDIR)$(bindir)/$(APP)$(EXEEXT) |
138 |
if test -f "$(GUI_APP)$(EXEEXT)"; then \ |
139 |
$(INSTALL_PROGRAM) $(GUI_APP)$(EXEEXT) $(DESTDIR)$(bindir)/$(GUI_APP)$(EXEEXT); \ |
140 |
fi |
141 |
-$(INSTALL_DATA) @top_srcdir@/$(APP_BASENAME).1 $(DESTDIR)$(man1dir)/$(APP).1 |
142 |
$(INSTALL_DATA) @top_srcdir@/$(KEYCODES) $(DESTDIR)$(datadir)/$(APP)/keycodes |
143 |
$(INSTALL_DATA) @top_srcdir@/fbdevices $(DESTDIR)$(datadir)/$(APP)/fbdevices |
144 |
$(INSTALL_DATA) @top_srcdir@/tunconfig $(DESTDIR)$(datadir)/$(APP)/tunconfig |
145 |
|
146 |
installdirs: |
147 |
$(SHELL) @top_srcdir@/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(datadir)/$(APP) |
148 |
|
149 |
uninstall: |
150 |
rm -f $(DESTDIR)$(bindir)/$(APP)$(EXEEXT) |
151 |
rm -f $(DESTDIR)$(bindir)/$(GUI_APP)$(EXEEXT) |
152 |
rm -f $(DESTDIR)$(man1dir)/$(APP).1 |
153 |
rm -f $(DESTDIR)$(datadir)/$(APP)/keycodes |
154 |
rm -f $(DESTDIR)$(datadir)/$(APP)/fbdevices |
155 |
rm -f $(DESTDIR)$(datadir)/$(APP)/tunconfig |
156 |
rmdir $(DESTDIR)$(datadir)/$(APP) |
157 |
|
158 |
mostlyclean: |
159 |
rm -f $(PROGS) $(OBJ_DIR)/* core* *.core *~ *.bak |
160 |
|
161 |
clean: mostlyclean |
162 |
rm -f cpuemu.cpp cpudefs.cpp cputmp*.s cpufast*.s cpustbl.cpp cputbl.h compemu.cpp compstbl.cpp comptbl.h |
163 |
|
164 |
distclean: clean |
165 |
rm -rf $(OBJ_DIR) |
166 |
rm -rf autom4te.cache |
167 |
rm -f Makefile |
168 |
rm -f config.cache config.log config.status config.h |
169 |
rm -f Darwin/lowmem Darwin/pagezero |
170 |
|
171 |
depend dep: |
172 |
makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null |
173 |
|
174 |
$(OBJ_DIR)/SDLMain.o : SDLMain.m |
175 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
176 |
$(OBJ_DIR)/%.o : @top_srcdir@/../slirp/%.c |
177 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(SLIRP_CFLAGS) -c $< -o $@ |
178 |
$(OBJ_DIR)/%.o : %.c |
179 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
180 |
$(OBJ_DIR)/%.o : %.cpp |
181 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
182 |
$(OBJ_DIR)/%.o : %.mm |
183 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
184 |
$(OBJ_DIR)/%.o : %.s |
185 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
186 |
$(OBJ_DIR)/%.go : %.cpp |
187 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(GUI_CFLAGS) -DSTANDALONE_GUI -c $< -o $@ |
188 |
|
189 |
# Windows resources |
190 |
$(OBJ_DIR)/%.o: %.rc |
191 |
windres --include-dir ../Windows -i $< -o $@ |
192 |
|
193 |
$(OBJ_DIR)/build68k$(EXEEXT): $(OBJ_DIR)/build68k.o |
194 |
$(CC) $(LDFLAGS) -o $(OBJ_DIR)/build68k$(EXEEXT) $(OBJ_DIR)/build68k.o |
195 |
$(OBJ_DIR)/gencpu$(EXEEXT): $(OBJ_DIR)/gencpu.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
196 |
$(CXX) $(LDFLAGS) -o $(OBJ_DIR)/gencpu$(EXEEXT) $(OBJ_DIR)/gencpu.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
197 |
$(OBJ_DIR)/gencomp$(EXEEXT): $(OBJ_DIR)/gencomp.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
198 |
$(CXX) $(LDFLAGS) -o $(OBJ_DIR)/gencomp$(EXEEXT) $(OBJ_DIR)/gencomp.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
199 |
|
200 |
cpudefs.cpp: $(OBJ_DIR)/build68k$(EXEEXT) @top_srcdir@/../uae_cpu/table68k |
201 |
$(OBJ_DIR)/build68k$(EXEEXT) <@top_srcdir@/../uae_cpu/table68k >cpudefs.cpp |
202 |
cpustbl.cpp: cpuemu.cpp |
203 |
cpustbl_nf.cpp: cpustbl.cpp |
204 |
compstbl.cpp: compemu.cpp |
205 |
cputbl.h: cpuemu.cpp |
206 |
comptbl.h: compemu.cpp |
207 |
|
208 |
cpuemu.cpp: $(OBJ_DIR)/gencpu$(EXEEXT) |
209 |
$(OBJ_DIR)/gencpu$(EXEEXT) |
210 |
|
211 |
compemu.cpp: $(OBJ_DIR)/gencomp$(EXEEXT) |
212 |
$(OBJ_DIR)/gencomp$(EXEEXT) |
213 |
|
214 |
$(OBJ_DIR)/cpustbl_nf.o: cpustbl.cpp |
215 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DNOFLAGS -c $< -o $@ |
216 |
|
217 |
$(OBJ_DIR)/compemu_support.o: compemu_support.cpp comptbl.h |
218 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
219 |
|
220 |
$(OBJ_DIR)/cpuemu1.o: cpuemu.cpp |
221 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@ |
222 |
$(OBJ_DIR)/cpuemu2.o: cpuemu.cpp |
223 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@ |
224 |
$(OBJ_DIR)/cpuemu3.o: cpuemu.cpp |
225 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@ |
226 |
$(OBJ_DIR)/cpuemu4.o: cpuemu.cpp |
227 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@ |
228 |
$(OBJ_DIR)/cpuemu5.o: cpuemu.cpp |
229 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@ |
230 |
$(OBJ_DIR)/cpuemu6.o: cpuemu.cpp |
231 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@ |
232 |
$(OBJ_DIR)/cpuemu7.o: cpuemu.cpp |
233 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@ |
234 |
$(OBJ_DIR)/cpuemu8.o: cpuemu.cpp |
235 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@ |
236 |
|
237 |
$(OBJ_DIR)/cpuemu1_nf.o: cpuemu.cpp |
238 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
239 |
$(OBJ_DIR)/cpuemu2_nf.o: cpuemu.cpp |
240 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
241 |
$(OBJ_DIR)/cpuemu3_nf.o: cpuemu.cpp |
242 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
243 |
$(OBJ_DIR)/cpuemu4_nf.o: cpuemu.cpp |
244 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
245 |
$(OBJ_DIR)/cpuemu5_nf.o: cpuemu.cpp |
246 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
247 |
$(OBJ_DIR)/cpuemu6_nf.o: cpuemu.cpp |
248 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
249 |
$(OBJ_DIR)/cpuemu7_nf.o: cpuemu.cpp |
250 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
251 |
$(OBJ_DIR)/cpuemu8_nf.o: cpuemu.cpp |
252 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 -DNOFLAGS $(CXXFLAGS) -c $< -o $@ |
253 |
|
254 |
$(OBJ_DIR)/compemu1.o: compemu.cpp |
255 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@ |
256 |
$(OBJ_DIR)/compemu2.o: compemu.cpp |
257 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@ |
258 |
$(OBJ_DIR)/compemu3.o: compemu.cpp |
259 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@ |
260 |
$(OBJ_DIR)/compemu4.o: compemu.cpp |
261 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@ |
262 |
$(OBJ_DIR)/compemu5.o: compemu.cpp |
263 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@ |
264 |
$(OBJ_DIR)/compemu6.o: compemu.cpp |
265 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@ |
266 |
$(OBJ_DIR)/compemu7.o: compemu.cpp |
267 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@ |
268 |
$(OBJ_DIR)/compemu8.o: compemu.cpp |
269 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@ |
270 |
|
271 |
#------------------------------------------------------------------------- |
272 |
# DO NOT DELETE THIS LINE -- make depend depends on it. |