1 |
+ |
# $Id$ |
2 |
|
# MacOS X makefile for Basilisk II. Slightly based on the Unix one |
3 |
|
|
4 |
|
## System specific configuration |
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 |
> |
# Symlinks to, or copies of, files in other directories |
32 |
> |
GENLINK = README.txt INSTALL.txt install-sh \ |
33 |
> |
Darwin config.guess config.sub semaphore.h \ |
34 |
> |
sys_unix.cpp timer_unix.cpp user_strings_unix.h |
35 |
|
|
36 |
< |
GEN = $(GENEMUS) $(GENSRCS) $(GENLINK) |
36 |
> |
GEN = $(GENEMUS) $(GENSRCS) |
37 |
|
|
38 |
|
SRCS = BasiliskII.icns Controller.h Controller.mm Credits.html \ |
39 |
|
Emulator.h Emulator.mm EmulatorView.h EmulatorView.mm English.lproj \ |
40 |
|
NNThread.h NNThread.m PrefsEditor.h PrefsEditor.mm \ |
41 |
|
ToDo.html Versions.html \ |
42 |
< |
audio_macosx.cpp extfs_macosx.mm macos_util_macosx.h main_macosx.h \ |
43 |
< |
main_macosx.mm misc_macosx.h misc_macosx.mm prefs_macosx.cpp \ |
44 |
< |
sysdeps.h video_macosx.mm video_macosx.h |
42 |
> |
audio_macosx.mm extfs_macosx.mm macos_util_macosx.h main_macosx.h \ |
43 |
> |
main_macosx.mm misc_macosx.h misc_macosx.mm nowrite.icns \ |
44 |
> |
prefs_macosx.cpp sysdeps.h video_macosx.mm video_macosx.h |
45 |
> |
|
46 |
> |
SLIRP_OBJ = $(patsubst ../slirp/%.c, build/%.o, $(SLIRP_SRCS)) |
47 |
> |
SLIRP_LIB = libslirp.a |
48 |
> |
|
49 |
|
APP = $(OBJ_DIR)/BasiliskII.app |
50 |
|
|
51 |
+ |
DEPS = $(OBJ_DIR) $(GEN) $(SLIRP_LIB) $(SRCS) |
52 |
+ |
|
53 |
|
## Rules |
54 |
|
|
55 |
|
.PHONY: mostlyclean clean distclean depend dep |
58 |
|
|
59 |
|
all: $(APP) |
60 |
|
|
61 |
< |
ide: $(OBJ_DIR) $(GEN) $(SRCS) |
62 |
< |
open BasiliskII.pbproj |
61 |
> |
ide: $(DEPS) |
62 |
> |
open $(PROJECT) |
63 |
|
|
64 |
|
test: $(APP) |
65 |
|
open $(APP) |
68 |
|
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
69 |
|
|
70 |
|
|
71 |
< |
$(APP): $(OBJ_DIR) $(GEN) $(SRCS) |
72 |
< |
pbxbuild -buildstyle Deployment |
73 |
< |
# pbxbuild |
71 |
> |
$(APP): $(DEPS) |
72 |
> |
$(IDE) -buildstyle Deployment $(IDEARGS) \ |
73 |
> |
&& $(BLESS) $(APP)/Contents/MacOS/BasiliskII \ |
74 |
> |
|| rm -fr $(APP) |
75 |
|
|
76 |
|
BasiliskII.icns : |
77 |
|
touch $@ |
78 |
|
|
79 |
+ |
nowrite.icns : |
80 |
+ |
# ln -sf /System/Library/CoreServices/Finder.app/Contents/Resources/nowrite.icns . |
81 |
+ |
touch $@ |
82 |
+ |
|
83 |
|
mostlyclean: |
84 |
|
rm -fr English.lproj/*~* $(OBJ_DIR)/* core* *.core *~ *.bak |
85 |
+ |
rm -fr autom4te.cache |
86 |
|
|
87 |
|
clean: mostlyclean |
88 |
+ |
rm -f $(SLIRP_LIB) |
89 |
|
rm -f $(GEN) |
90 |
|
rm -f cpudefs.cpp cputmp*.s cpufast*.s cpustbl.cpp |
91 |
|
|
92 |
|
distclean: clean |
93 |
< |
rm -fr $(OBJ_DIR) |
94 |
< |
rm -f config.cache config.log config.status config.h |
75 |
< |
rm -f configure |
93 |
> |
rm -rf $(OBJ_DIR) |
94 |
> |
rm -rf autom4te.cache |
95 |
|
rm -f Makefile |
96 |
+ |
rm -f config.cache config.log config.status config.h config.h.in |
97 |
+ |
rm -f Darwin/lowmem Darwin/pagezero |
98 |
+ |
rm -f $(GENLINK) |
99 |
+ |
rm -f configure |
100 |
+ |
rm -f .DS_Store |
101 |
|
|
102 |
|
|
103 |
|
|
120 |
|
$< |
121 |
|
|
122 |
|
|
123 |
< |
cpuemu1.cpp: cpuemu.cpp |
124 |
< |
echo '#define PART_1' > $@ |
125 |
< |
echo '#include "$<"' >> $@ |
126 |
< |
cpuemu2.cpp: cpuemu.cpp |
127 |
< |
echo '#define PART_2' > $@ |
128 |
< |
echo '#include "$<"' >> $@ |
129 |
< |
cpuemu3.cpp: cpuemu.cpp |
130 |
< |
echo '#define PART_3' > $@ |
131 |
< |
echo '#include "$<"' >> $@ |
132 |
< |
cpuemu4.cpp: cpuemu.cpp |
133 |
< |
echo '#define PART_4' > $@ |
134 |
< |
echo '#include "$<"' >> $@ |
135 |
< |
cpuemu5.cpp: cpuemu.cpp |
136 |
< |
echo '#define PART_5' > $@ |
137 |
< |
echo '#include "$<"' >> $@ |
138 |
< |
cpuemu6.cpp: cpuemu.cpp |
139 |
< |
echo '#define PART_6' > $@ |
140 |
< |
echo '#include "$<"' >> $@ |
141 |
< |
cpuemu7.cpp: cpuemu.cpp |
118 |
< |
echo '#define PART_7' > $@ |
119 |
< |
echo '#include "$<"' >> $@ |
120 |
< |
cpuemu8.cpp: cpuemu.cpp |
121 |
< |
echo '#define PART_8' > $@ |
122 |
< |
echo '#include "$<"' >> $@ |
123 |
< |
|
124 |
< |
|
125 |
< |
cpufast.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
126 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -S $(CXXFLAGS) $< -o cputmp.s |
127 |
< |
$(OBJ_DIR)/cpuopti <cputmp.s >$@ || mv cputmp.s $@ |
128 |
< |
rm -f cputmp.s |
129 |
< |
cpufast1.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
130 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 -S $(CXXFLAGS) $< -o cputmp1.s |
131 |
< |
$(OBJ_DIR)/cpuopti <cputmp1.s >$@ || mv cputmp1.s $@ |
132 |
< |
rm -f cputmp1.s |
133 |
< |
cpufast2.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
134 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 -S $(CXXFLAGS) $< -o cputmp2.s |
135 |
< |
$(OBJ_DIR)/cpuopti <cputmp2.s >$@ || mv cputmp2.s $@ |
136 |
< |
rm -f cputmp2.s |
137 |
< |
cpufast3.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
138 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 -S $(CXXFLAGS) $< -o cputmp3.s |
139 |
< |
$(OBJ_DIR)/cpuopti <cputmp3.s >$@ || mv cputmp3.s $@ |
140 |
< |
rm -f cputmp3.s |
141 |
< |
cpufast4.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
142 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 -S $(CXXFLAGS) $< -o cputmp4.s |
143 |
< |
$(OBJ_DIR)/cpuopti <cputmp4.s >$@ || mv cputmp4.s $@ |
144 |
< |
rm -f cputmp4.s |
145 |
< |
cpufast5.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
146 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 -S $(CXXFLAGS) $< -o cputmp5.s |
147 |
< |
$(OBJ_DIR)/cpuopti <cputmp5.s >$@ || mv cputmp5.s $@ |
148 |
< |
rm -f cputmp5.s |
149 |
< |
cpufast6.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
150 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 -S $(CXXFLAGS) $< -o cputmp6.s |
151 |
< |
$(OBJ_DIR)/cpuopti <cputmp6.s >$@ || mv cputmp6.s $@ |
152 |
< |
rm -f cputmp6.s |
153 |
< |
cpufast7.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
154 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 -S $(CXXFLAGS) $< -o cputmp7.s |
155 |
< |
$(OBJ_DIR)/cpuopti <cputmp7.s >$@ || mv cputmp7.s $@ |
156 |
< |
rm -f cputmp7.s |
157 |
< |
cpufast8.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
158 |
< |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 -S $(CXXFLAGS) $< -o cputmp8.s |
159 |
< |
$(OBJ_DIR)/cpuopti <cputmp8.s >$@ || mv cputmp8.s $@ |
160 |
< |
rm -f cputmp8.s |
123 |
> |
$(GENEMUS) : cpuemu.cpp |
124 |
> |
for i in 1 2 3 4 5 6 7 8; \ |
125 |
> |
do \ |
126 |
> |
printf "#define PART_%d\n#include \"%s\"\n" $$i $< >cpuemu$$i.cpp; \ |
127 |
> |
done |
128 |
> |
|
129 |
> |
|
130 |
> |
cpufast.s: cpuemu.s $(OBJ_DIR)/cpuopti |
131 |
> |
$(OBJ_DIR)/cpuopti <cpuemu.s >$@ || mv cputmp.s $@ |
132 |
> |
|
133 |
> |
cpuemu.s: cpuemu.cpp |
134 |
> |
$(CXX) $(CPPFLAGS) $(DEFS) -S $(CXXFLAGS) $< -o $@ |
135 |
> |
|
136 |
> |
|
137 |
> |
$(SLIRP_OBJ) : build/%.o : ../slirp/%.c |
138 |
> |
$(CC) -I../slirp $(CPPFLAGS) $(DEFS) $(CFLAGS) $(LDFLAGS) -c $< -o $@ |
139 |
> |
|
140 |
> |
$(SLIRP_LIB) : $(SLIRP_OBJ) |
141 |
> |
libtool -static -o libslirp.a build/*.o |
142 |
|
|
143 |
|
#------------------------------------------------------------------------- |
144 |
|
# DO NOT DELETE THIS LINE -- make depend depends on it. |