1 |
+ |
# $Id$ |
2 |
|
# MacOS X makefile for Basilisk II. Slightly based on the Unix one |
3 |
|
|
4 |
|
## System specific configuration |
10 |
|
CXX = @CXX@ |
11 |
|
CFLAGS = @CFLAGS@ |
12 |
|
CXXFLAGS = @CXXFLAGS@ |
13 |
< |
CPPFLAGS = @CPPFLAGS@ -I../include -I. -I../uae_cpu |
13 |
> |
CPPFLAGS = @CPPFLAGS@ -I../include -I. @CPUINCLUDES@ |
14 |
|
DEFS = @DEFS@ @DEFINES@ -D_REENTRANT |
15 |
|
LDFLAGS = @LDFLAGS@ |
16 |
|
LIBS = @LIBS@ |
17 |
+ |
BLESS = @BLESS@ |
18 |
+ |
IDE = @IDE@ |
19 |
+ |
PROJECT = @PROJECT@ |
20 |
+ |
IDEARGS = @IDEARGS@ |
21 |
+ |
SLIRP_SRCS = @SLIRP_SRCS@ |
22 |
|
|
23 |
|
## Files |
24 |
|
OBJ_DIR = build |
28 |
|
GENEMUS = cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp \ |
29 |
|
cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp |
30 |
|
|
31 |
< |
# Symlinks to files in other directories |
32 |
< |
GENLINK = README.txt acconfig.h install-sh \ |
33 |
< |
config.guess config.sub user_strings_unix.h |
31 |
> |
# We compile the emulator source outside of Project Builder/XCode |
32 |
> |
# so that it always picks up appropriate FLAGS from configure. |
33 |
> |
# This is necessary because that code doesn't use config.h |
34 |
> |
EMU_OBJ = $(patsubst %.cpp, build/%.o, $(GENEMUS)) |
35 |
> |
EMU_LIB = libgenemu.a |
36 |
|
|
37 |
< |
GEN = $(GENEMUS) $(GENSRCS) $(GENLINK) |
37 |
> |
|
38 |
> |
# Symlinks to, or copies of, files in other directories |
39 |
> |
GENLINK = README.txt INSTALL.txt install-sh \ |
40 |
> |
Darwin config.guess config.sub semaphore.h \ |
41 |
> |
sys_unix.cpp timer_unix.cpp user_strings_unix.h |
42 |
> |
|
43 |
> |
GEN = $(GENEMUS) $(GENSRCS) |
44 |
|
|
45 |
|
SRCS = BasiliskII.icns Controller.h Controller.mm Credits.html \ |
46 |
|
Emulator.h Emulator.mm EmulatorView.h EmulatorView.mm English.lproj \ |
47 |
|
NNThread.h NNThread.m PrefsEditor.h PrefsEditor.mm \ |
48 |
|
ToDo.html Versions.html \ |
49 |
< |
audio_macosx.cpp extfs_macosx.mm macos_util_macosx.h main_macosx.h \ |
50 |
< |
main_macosx.mm misc_macosx.h misc_macosx.mm prefs_macosx.cpp \ |
51 |
< |
sysdeps.h video_macosx.mm video_macosx.h |
49 |
> |
audio_macosx.mm extfs_macosx.mm macos_util_macosx.h main_macosx.h \ |
50 |
> |
main_macosx.mm misc_macosx.h misc_macosx.mm nowrite.icns \ |
51 |
> |
prefs_macosx.cpp sysdeps.h video_macosx.mm video_macosx.h |
52 |
> |
|
53 |
> |
SLIRP_OBJ = $(patsubst ../slirp/%.c, build/%.o, $(SLIRP_SRCS)) |
54 |
> |
SLIRP_LIB = libslirp.a |
55 |
> |
|
56 |
|
APP = $(OBJ_DIR)/BasiliskII.app |
57 |
|
|
58 |
+ |
DEPS = $(OBJ_DIR) $(GEN) $(EMU_LIB) $(SLIRP_LIB) $(SRCS) |
59 |
+ |
|
60 |
|
## Rules |
61 |
|
|
62 |
|
.PHONY: mostlyclean clean distclean depend dep |
65 |
|
|
66 |
|
all: $(APP) |
67 |
|
|
68 |
< |
ide: $(OBJ_DIR) $(GEN) $(SRCS) |
69 |
< |
open BasiliskII.pbproj |
68 |
> |
ide: $(DEPS) |
69 |
> |
open $(PROJECT) |
70 |
|
|
71 |
|
test: $(APP) |
72 |
|
open $(APP) |
75 |
|
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
76 |
|
|
77 |
|
|
78 |
< |
$(APP): $(OBJ_DIR) $(GENSRCS) $(SRCS) |
79 |
< |
pbxbuild -buildstyle Deployment |
80 |
< |
# pbxbuild |
78 |
> |
$(APP): $(DEPS) |
79 |
> |
$(IDE) -buildstyle Deployment $(IDEARGS) \ |
80 |
> |
&& $(BLESS) $(APP)/Contents/MacOS/BasiliskII \ |
81 |
> |
|| rm -fr $(APP) |
82 |
|
|
83 |
|
BasiliskII.icns : |
84 |
|
touch $@ |
85 |
|
|
86 |
+ |
nowrite.icns : |
87 |
+ |
# ln -sf /System/Library/CoreServices/Finder.app/Contents/Resources/nowrite.icns . |
88 |
+ |
touch $@ |
89 |
+ |
|
90 |
|
mostlyclean: |
91 |
|
rm -fr English.lproj/*~* $(OBJ_DIR)/* core* *.core *~ *.bak |
92 |
+ |
rm -fr autom4te.cache config tests vhook |
93 |
|
|
94 |
|
clean: mostlyclean |
95 |
+ |
rm -f $(SLIRP_LIB) $(EMU_LIB) |
96 |
|
rm -f $(GEN) |
97 |
|
rm -f cpudefs.cpp cputmp*.s cpufast*.s cpustbl.cpp |
98 |
|
|
99 |
|
distclean: clean |
100 |
< |
rm -fr $(OBJ_DIR) |
101 |
< |
rm -f config.cache config.log config.status config.h |
75 |
< |
rm -f configure |
100 |
> |
rm -rf $(OBJ_DIR) |
101 |
> |
rm -rf autom4te.cache |
102 |
|
rm -f Makefile |
103 |
+ |
rm -f config.cache config.log config.status config.h config.h.in |
104 |
+ |
rm -f Darwin/lowmem Darwin/pagezero |
105 |
+ |
rm -f $(GENLINK) |
106 |
+ |
rm -f configure |
107 |
+ |
rm -f .DS_Store |
108 |
|
|
109 |
|
|
110 |
|
|
111 |
|
|
112 |
|
$(OBJ_DIR)/build68k: ../uae_cpu/build68k.c |
113 |
< |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(LDFLAGS) $< -o $@ |
113 |
> |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $< -o $@ |
114 |
|
|
115 |
|
$(OBJ_DIR)/cpuopti: ../uae_cpu/cpuopti.c |
116 |
< |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(LDFLAGS) $< -o $@ |
86 |
< |
|
87 |
< |
#$(OBJ_DIR)/gencpu: cpudefs.cpp ../uae_cpu/gencpu.c ../uae_cpu/readcpu.cpp |
88 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(CXXFLAGS) $(LDFLAGS) $< -o $@ |
89 |
< |
|
90 |
< |
$(OBJ_DIR)/gencpu: $(OBJ_DIR)/gencpu.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
91 |
< |
$(CC) $(LDFLAGS) $^ -o $@ |
92 |
< |
|
93 |
< |
$(OBJ_DIR)/gencpu.o : ../uae_cpu/gencpu.c |
94 |
< |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
116 |
> |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $< -o $@ |
117 |
|
|
118 |
< |
$(OBJ_DIR)/readcpu.o: ../uae_cpu/readcpu.cpp |
119 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
118 |
> |
$(OBJ_DIR)/gencpu: cpudefs.cpp ../uae_cpu/gencpu.c ../uae_cpu/readcpu.cpp |
119 |
> |
$(CXX) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(CXXFLAGS) $^ -o $@ |
120 |
|
|
99 |
– |
$(OBJ_DIR)/cpudefs.o: cpudefs.cpp |
100 |
– |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
121 |
|
|
122 |
|
|
123 |
|
cpudefs.cpp: $(OBJ_DIR)/build68k ../uae_cpu/table68k |
127 |
|
$< |
128 |
|
|
129 |
|
|
130 |
< |
cpuemu1.cpp: cpuemu.cpp |
131 |
< |
echo '#define PART_1' > $@ |
132 |
< |
echo '#include "$<"' >> $@ |
133 |
< |
cpuemu2.cpp: cpuemu.cpp |
134 |
< |
echo '#define PART_2' > $@ |
135 |
< |
echo '#include "$<"' >> $@ |
136 |
< |
cpuemu3.cpp: cpuemu.cpp |
137 |
< |
echo '#define PART_3' > $@ |
138 |
< |
echo '#include "$<"' >> $@ |
139 |
< |
cpuemu4.cpp: cpuemu.cpp |
140 |
< |
echo '#define PART_4' > $@ |
141 |
< |
echo '#include "$<"' >> $@ |
142 |
< |
cpuemu5.cpp: cpuemu.cpp |
143 |
< |
echo '#define PART_5' > $@ |
144 |
< |
echo '#include "$<"' >> $@ |
145 |
< |
cpuemu6.cpp: cpuemu.cpp |
146 |
< |
echo '#define PART_6' > $@ |
147 |
< |
echo '#include "$<"' >> $@ |
148 |
< |
cpuemu7.cpp: cpuemu.cpp |
149 |
< |
echo '#define PART_7' > $@ |
150 |
< |
echo '#include "$<"' >> $@ |
151 |
< |
cpuemu8.cpp: cpuemu.cpp |
152 |
< |
echo '#define PART_8' > $@ |
153 |
< |
echo '#include "$<"' >> $@ |
154 |
< |
|
155 |
< |
#cpuemu1.cpp: cpuemu.cpp |
156 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 -E $< > $@ |
137 |
< |
#cpuemu2.cpp: cpuemu.cpp |
138 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 -E $< > $@ |
139 |
< |
#cpuemu3.cpp: cpuemu.cpp |
140 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 -E $< > $@ |
141 |
< |
#cpuemu4.cpp: cpuemu.cpp |
142 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 -E $< > $@ |
143 |
< |
#cpuemu5.cpp: cpuemu.cpp |
144 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 -E $< > $@ |
145 |
< |
#cpuemu6.cpp: cpuemu.cpp |
146 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 -E $< > $@ |
147 |
< |
#cpuemu7.cpp: cpuemu.cpp |
148 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 -E $< > $@ |
149 |
< |
#cpuemu8.cpp: cpuemu.cpp |
150 |
< |
# $(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 -E $< > $@ |
151 |
< |
|
152 |
< |
|
153 |
< |
cpufast.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
154 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -S $(CXXFLAGS) $< -o cputmp.s |
155 |
< |
$(OBJ_DIR)/cpuopti <cputmp.s >$@ || mv cputmp.s $@ |
156 |
< |
rm -f cputmp.s |
157 |
< |
cpufast1.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
158 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 -S $(CXXFLAGS) $< -o cputmp1.s |
159 |
< |
$(OBJ_DIR)/cpuopti <cputmp1.s >$@ || mv cputmp1.s $@ |
160 |
< |
rm -f cputmp1.s |
161 |
< |
cpufast2.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
162 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 -S $(CXXFLAGS) $< -o cputmp2.s |
163 |
< |
$(OBJ_DIR)/cpuopti <cputmp2.s >$@ || mv cputmp2.s $@ |
164 |
< |
rm -f cputmp2.s |
165 |
< |
cpufast3.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
166 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 -S $(CXXFLAGS) $< -o cputmp3.s |
167 |
< |
$(OBJ_DIR)/cpuopti <cputmp3.s >$@ || mv cputmp3.s $@ |
168 |
< |
rm -f cputmp3.s |
169 |
< |
cpufast4.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
170 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 -S $(CXXFLAGS) $< -o cputmp4.s |
171 |
< |
$(OBJ_DIR)/cpuopti <cputmp4.s >$@ || mv cputmp4.s $@ |
172 |
< |
rm -f cputmp4.s |
173 |
< |
cpufast5.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
174 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 -S $(CXXFLAGS) $< -o cputmp5.s |
175 |
< |
$(OBJ_DIR)/cpuopti <cputmp5.s >$@ || mv cputmp5.s $@ |
176 |
< |
rm -f cputmp5.s |
177 |
< |
cpufast6.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
178 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 -S $(CXXFLAGS) $< -o cputmp6.s |
179 |
< |
$(OBJ_DIR)/cpuopti <cputmp6.s >$@ || mv cputmp6.s $@ |
180 |
< |
rm -f cputmp6.s |
181 |
< |
cpufast7.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
182 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 -S $(CXXFLAGS) $< -o cputmp7.s |
183 |
< |
$(OBJ_DIR)/cpuopti <cputmp7.s >$@ || mv cputmp7.s $@ |
184 |
< |
rm -f cputmp7.s |
185 |
< |
cpufast8.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
186 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 -S $(CXXFLAGS) $< -o cputmp8.s |
187 |
< |
$(OBJ_DIR)/cpuopti <cputmp8.s >$@ || mv cputmp8.s $@ |
188 |
< |
rm -f cputmp8.s |
130 |
> |
$(GENEMUS) : cpuemu.cpp |
131 |
> |
for i in 1 2 3 4 5 6 7 8; \ |
132 |
> |
do \ |
133 |
> |
printf "#define PART_%d\n#include \"%s\"\n" $$i $< >cpuemu$$i.cpp; \ |
134 |
> |
done |
135 |
> |
|
136 |
> |
|
137 |
> |
cpufast.s: cpuemu.s $(OBJ_DIR)/cpuopti |
138 |
> |
$(OBJ_DIR)/cpuopti <cpuemu.s >$@ || mv cputmp.s $@ |
139 |
> |
|
140 |
> |
cpuemu.s: cpuemu.cpp |
141 |
> |
$(CXX) $(CPPFLAGS) $(DEFS) -S $(CXXFLAGS) $< -o $@ |
142 |
> |
|
143 |
> |
$(EMU_OBJ) : build/%.o : %.cpp |
144 |
> |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
145 |
> |
|
146 |
> |
build/newcpu.o : ../uae_cpu/newcpu.cpp |
147 |
> |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
148 |
> |
|
149 |
> |
$(EMU_LIB) : $(EMU_OBJ) build/newcpu.o |
150 |
> |
libtool -static -o $@ $^ |
151 |
> |
|
152 |
> |
$(SLIRP_OBJ) : build/%.o : ../slirp/%.c |
153 |
> |
$(CC) -I../slirp $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
154 |
> |
|
155 |
> |
$(SLIRP_LIB) : $(SLIRP_OBJ) |
156 |
> |
libtool -static -o $@ $^ |
157 |
|
|
158 |
|
#------------------------------------------------------------------------- |
159 |
|
# DO NOT DELETE THIS LINE -- make depend depends on it. |