ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/MacOSX/Makefile.in
Revision: 1.26
Committed: 2007-06-15T21:46:25Z (17 years, 5 months ago) by gbeauche
Branch: MAIN
Changes since 1.25: +26 -7 lines
Log Message:
Disable cxmon by default for MacOS X builds. Add hackery to cross-compile
a working 10.2/ppc binary.

File Contents

# User Rev Content
1 gbeauche 1.23 # Unix makefile for Basilisk II
2 nigel 1.1
3     ## System specific configuration
4     SHELL = /bin/sh
5    
6 gbeauche 1.26 HOST_CC = @CC@
7     HOST_CXX = @CXX@
8     CC_PROG = @CC@
9     CXX_PROG = @CXX@
10 gbeauche 1.23 CFLAGS = @CFLAGS@ -g
11     CXXFLAGS = @CXXFLAGS@ -g
12 gbeauche 1.25 CPPFLAGS = @CPPFLAGS@ -I../include -I. -I../uae_cpu
13     DEFS = @DEFS@ @DEFINES@ -D_REENTRANT -DAQUA -DFPU_IEEE
14 nigel 1.1 LDFLAGS = @LDFLAGS@
15     LIBS = @LIBS@
16 gbeauche 1.24 MONSRCS = @MONSRCS@
17 nigel 1.14 BLESS = @BLESS@
18 gbeauche 1.23 LN_S = ln -s
19    
20 gbeauche 1.26 ## Compilers selection (XXX hackery for 10.2 cross-compilation...)
21     SDK_VERSION.ppc = @PPC_SDK_VERSION@
22     SDK_VERSION = $(SDK_VERSION.$(ARCH))
23     ifeq ($(SDK_VERSION), 10.2.8)
24     CC_PROG = gcc-3.3
25     CXX_PROG = g++-3.3
26     SDK_ROOT = /Developer/SDKs/MacOSX10.2.8.sdk
27     CC_ROOT = -F$(SDK_ROOT)/System/Library/Frameworks
28     LDFLAGS += -Wl,-syslibroot,$(SDK_ROOT)
29     endif
30     ifeq ($(SDK_VERSION), 10.3.9)
31     CC_ROOT = -isysroot /Developer/SDKs/MacOSX10.3.9.sdk -mmacosx-version-min=10.3
32     endif
33     ifeq ($(SDK_VERSION), 10.4)
34     CC_ROOT = -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4
35     endif
36     CC = $(CC_PROG) $(CC_ROOT) -arch $(ARCH)
37     CXX = $(CXX_PROG) $(CC_ROOT) -arch $(ARCH)
38    
39 gbeauche 1.24 ## slirp network emulation code
40     WANT_SLIRP = @WANT_SLIRP@
41     ifeq ($(WANT_SLIRP), yes)
42     CPPFLAGS += -I../slirp
43 gbeauche 1.23 SLIRP_CFLAGS = @SLIRP_CFLAGS@
44 nigel 1.17 SLIRP_SRCS = @SLIRP_SRCS@
45 gbeauche 1.23 SLIRP_OBJS = $(SLIRP_SRCS:../slirp/%.c=obj/%.o)
46 gbeauche 1.24 endif
47    
48     ## CPU emulation code
49     WANT_JIT = @WANT_JIT@
50     WANT_JIT_DEBUG = @WANT_JIT_DEBUG@
51 gbeauche 1.25 USE_JIT = no
52     CPUSRCS = \
53     ../uae_cpu/basilisk_glue.cpp ../uae_cpu/readcpu.cpp \
54     ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/fpu/fpu_ieee.cpp
55     GEN_CPUSRCS = \
56     cpustbl.cpp cpudefs.cpp \
57     cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp \
58     cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp
59     ifeq ($(ARCH), i386)
60 gbeauche 1.24 USE_JIT = $(WANT_JIT)
61 gbeauche 1.25 DEFS += -DUNALIGNED_PROFITABLE -DREGPARAM="__attribute__((regparm(3)))"
62     DEFS += -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE
63     endif
64     ifeq ($(ARCH), x86_64)
65     USE_JIT = $(WANT_JIT)
66     DEFS += -DUNALIGNED_PROFITABLE
67     DEFS += -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS
68     endif
69 gbeauche 1.24 ifeq ($(USE_JIT), yes)
70     DEFS += -DUSE_JIT -DUSE_JIT_FPU
71     ifeq ($(WANT_JIT_DEBUG), yes)
72     DEFS += -DJIT_DEBUG
73     endif
74     CPUSRCS += \
75 gbeauche 1.25 ../uae_cpu/compiler/compemu_support.cpp \
76     ../uae_cpu/compiler/compemu_fpp.cpp
77     GEN_CPUSRCS += \
78 gbeauche 1.24 cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp \
79     cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp \
80     compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp \
81     compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp \
82 gbeauche 1.25 cpustbl_nf.cpp compstbl.cpp
83     endif
84    
85     GEN_DIR = gen
86     ifneq ($(ARCH),)
87     GEN_DIR = gen.$(ARCH)
88 gbeauche 1.24 endif
89 gbeauche 1.25 CPUSRCS += $(foreach file, $(GEN_CPUSRCS), $(GEN_DIR)/$(file))
90     CPPFLAGS += -I$(GEN_DIR)
91 nigel 1.1
92     ## Files
93 gbeauche 1.23 UNIXSRCS = vm_alloc.cpp vm_alloc.h sigsegv.cpp sigsegv.h video_vosf.h video_blit.cpp \
94     xpram_unix.cpp user_strings_unix.cpp user_strings_unix.h \
95     serial_unix.cpp ether_unix.cpp sys_unix.cpp timer_unix.cpp \
96     sshpty.c sshpty.h strlcpy.c strlcpy.h semaphore.h
97     SRCS = ../main.cpp main_macosx.mm ../prefs.cpp ../prefs_items.cpp prefs_macosx.mm \
98     sys_unix.cpp sys_darwin.cpp ../rom_patches.cpp ../slot_rom.cpp ../rsrc_patches.cpp \
99     ../emul_op.cpp ../macos_util.cpp ../xpram.cpp xpram_unix.cpp ../timer.cpp \
100     timer_unix.cpp ../adb.cpp ../serial.cpp serial_unix.cpp ../ether.cpp ether_unix.cpp \
101     ../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp ../video.cpp video_macosx.mm \
102     vm_alloc.cpp sigsegv.cpp ../audio.cpp ../extfs.cpp extfs_macosx.mm \
103     ../user_strings.cpp user_strings_unix.cpp clip_macosx.cpp misc_macosx.mm \
104     ../dummy/scsi_dummy.cpp \
105     audio_macosx.cpp AudioBackEnd.cpp AudioDevice.cpp MacOSX_sound_if.cpp \
106     NNThread.m Emulator.mm EmulatorView.mm Controller.mm PrefsEditor.mm \
107     sshpty.c strlcpy.c \
108 gbeauche 1.24 $(MONSRCS) $(CPUSRCS) $(SLIRP_SRCS)
109 gbeauche 1.25
110     ## Documentation files
111     DOCS = README.txt Credits.html ToDo.html HowTo.html Versions.html
112    
113     ## Binaries to build
114 gbeauche 1.23 APP = BasiliskII
115     APP_APP = $(APP).app
116 gbeauche 1.25 TARGET_ARCHES = @TARGET_ARCHES@
117     PROGS = $(foreach arch, $(TARGET_ARCHES), $(APP).$(arch))
118 nigel 1.17
119 nigel 1.1 ## Rules
120 gbeauche 1.23 .PHONY: modules install installdirs uninstall mostlyclean clean distclean depend dep
121 nigel 1.1 .SUFFIXES:
122     .SUFFIXES: .c .cpp .s .o .h
123    
124 gbeauche 1.25 all: $(APP)_app
125 nigel 1.1
126 gbeauche 1.23 README.txt: ../../README
127     $(LN_S) $< $@
128     $(UNIXSRCS): %: ../Unix/%
129     $(LN_S) $< $@
130 nigel 1.1
131 gbeauche 1.23 OBJ_DIR = obj
132 gbeauche 1.25 ifneq ($(ARCH),)
133     OBJ_DIR = obj.$(ARCH)
134     endif
135 nigel 1.1 $(OBJ_DIR)::
136     @[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
137    
138 gbeauche 1.23 define SRCS_LIST_TO_OBJS
139     $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \
140     $(basename $(notdir $(file))))))
141     endef
142     OBJS = $(SRCS_LIST_TO_OBJS)
143    
144     SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file))))
145     VPATH :=
146     VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
147    
148 gbeauche 1.25 define PROGS_template
149     $(APP).$(1): links
150     +$(MAKE) $(OBJ_DIR).$(1)/$(APP) ARCH=$(1)
151     $(LN_S) -f $(OBJ_DIR).$(1)/$(APP) $(APP).$(1)
152     endef
153    
154     $(APP): $(PROGS)
155     lipo $(foreach arch, $(TARGET_ARCHES), -arch $(arch) $(APP).$(arch)) \
156     -create -output $@
157    
158     $(foreach arch,$(TARGET_ARCHES),$(eval $(call PROGS_template,$(arch))))
159    
160     links: $(UNIXSRCS)
161    
162     $(OBJ_DIR)/$(APP): $(OBJ_DIR) $(GEN_DIR) $(OBJS)
163 gbeauche 1.23 $(CXX) -o $@ $(LDFLAGS) $(OBJS) $(LIBS)
164 gbeauche 1.25 $(BLESS) $@
165 gbeauche 1.23
166 gbeauche 1.25 $(APP)_app: $(APP) $(DOCS) Info.plist $(APP).icns
167 gbeauche 1.23 mkdir -p $(APP_APP)/Contents
168     cp -f ../MacOSX/Info.plist $(APP_APP)/Contents/
169     echo -n 'APPL????' > $(APP_APP)/Contents/PkgInfo
170     mkdir -p $(APP_APP)/Contents/MacOS
171     cp -f $(APP) $(APP_APP)/Contents/MacOS/
172     strip $(APP_APP)/Contents/MacOS/$(APP)
173     mkdir -p $(APP_APP)/Contents/Resources
174     cp -Rp English.lproj $(APP_APP)/Contents/Resources/
175 gbeauche 1.25 cp -f $(APP).icns $(APP_APP)/Contents/Resources/
176 gbeauche 1.23 cp -f $(DOCS) $(APP_APP)/Contents/Resources/
177     find $(APP_APP) -type d -name CVS | xargs rm -rf
178 nigel 1.1
179     mostlyclean:
180 gbeauche 1.23 rm -rf $(APP_APP)
181 gbeauche 1.25 rm -f $(PROGS) $(OBJ_DIR)/* $(OBJ_DIR).*/* core* *.core *~ *.bak
182 nigel 1.1
183     clean: mostlyclean
184 gbeauche 1.23 rm -f $(UNIXSRCS)
185 gbeauche 1.25 rm -f $(GEN_DIR).*/*
186 nigel 1.1
187     distclean: clean
188 nigel 1.12 rm -rf $(OBJ_DIR)
189     rm -rf autom4te.cache
190     rm -f Makefile
191 gbeauche 1.23 rm -f config.cache config.log config.status config.h
192 nigel 1.12 rm -f Darwin/lowmem Darwin/pagezero
193 nigel 1.1
194 gbeauche 1.23 depend dep:
195     makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null
196 nigel 1.1
197 gbeauche 1.23 $(OBJ_DIR)/%.o : ../slirp/%.c
198     $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) $(SLIRP_CFLAGS) -c $< -o $@
199     $(OBJ_DIR)/%.o : %.c
200     $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
201     $(OBJ_DIR)/%.o : %.cpp
202     $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
203     $(OBJ_DIR)/%.o : %.m
204     $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
205     $(OBJ_DIR)/%.o : %.mm
206     $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
207     $(OBJ_DIR)/%.o : %.s
208     $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
209 gbeauche 1.25 $(OBJ_DIR)/%.ho : %.c
210     $(HOST_CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
211     $(OBJ_DIR)/%.ho : %.cpp
212     $(HOST_CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
213    
214     $(OBJ_DIR)/build68k: $(OBJ_DIR)/build68k.ho
215 gbeauche 1.26 $(HOST_CC) -o $@ $(OBJ_DIR)/build68k.ho
216 gbeauche 1.25 $(OBJ_DIR)/gencpu: $(OBJ_DIR)/gencpu.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho
217 gbeauche 1.26 $(HOST_CXX) -o $@ $(OBJ_DIR)/gencpu.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho
218 gbeauche 1.25 $(OBJ_DIR)/gencomp: $(OBJ_DIR)/gencomp.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho
219 gbeauche 1.26 $(HOST_CXX) -o $@ $(OBJ_DIR)/gencomp.ho $(OBJ_DIR)/readcpu.ho $(OBJ_DIR)/cpudefs.ho
220 gbeauche 1.25
221     $(GEN_DIR)::
222     @[ -d $(GEN_DIR) ] || mkdir $(GEN_DIR) > /dev/null 2>&1
223    
224     $(GEN_DIR)/cpudefs.cpp: $(OBJ_DIR)/build68k ../uae_cpu/table68k
225     $(OBJ_DIR)/build68k <../uae_cpu/table68k > $@
226     $(GEN_DIR)/cpustbl.cpp: $(GEN_DIR)/cpuemu.cpp
227     $(GEN_DIR)/cpustbl_nf.cpp: $(GEN_DIR)/cpustbl.cpp
228     $(GEN_DIR)/compstbl.cpp: $(GEN_DIR)/compemu.cpp
229     $(GEN_DIR)/cputbl.h: $(GEN_DIR)/cpuemu.cpp
230     $(GEN_DIR)/comptbl.h: $(GEN_DIR)/compemu.cpp
231 nigel 1.1
232 gbeauche 1.25 $(GEN_DIR)/cpuemu.cpp: $(OBJ_DIR)/gencpu
233     cd $(GEN_DIR) && ../$(OBJ_DIR)/gencpu
234 nigel 1.1
235 gbeauche 1.25 $(GEN_DIR)/compemu.cpp: $(OBJ_DIR)/gencomp
236     cd $(GEN_DIR) && ../$(OBJ_DIR)/gencomp
237 nigel 1.1
238 gbeauche 1.25 $(OBJ_DIR)/cpustbl_nf.o: $(GEN_DIR)/cpustbl.cpp
239 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DNOFLAGS -c $< -o $@
240 nigel 1.7
241 gbeauche 1.25 $(OBJ_DIR)/compemu_support.o: compemu_support.cpp $(GEN_DIR)/comptbl.h
242 nigel 1.19 $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
243    
244 gbeauche 1.25 $(OBJ_DIR)/cpuemu1.o: $(GEN_DIR)/cpuemu.cpp
245 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@
246 gbeauche 1.25 $(OBJ_DIR)/cpuemu2.o: $(GEN_DIR)/cpuemu.cpp
247 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@
248 gbeauche 1.25 $(OBJ_DIR)/cpuemu3.o: $(GEN_DIR)/cpuemu.cpp
249 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@
250 gbeauche 1.25 $(OBJ_DIR)/cpuemu4.o: $(GEN_DIR)/cpuemu.cpp
251 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@
252 gbeauche 1.25 $(OBJ_DIR)/cpuemu5.o: $(GEN_DIR)/cpuemu.cpp
253 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@
254 gbeauche 1.25 $(OBJ_DIR)/cpuemu6.o: $(GEN_DIR)/cpuemu.cpp
255 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@
256 gbeauche 1.25 $(OBJ_DIR)/cpuemu7.o: $(GEN_DIR)/cpuemu.cpp
257 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@
258 gbeauche 1.25 $(OBJ_DIR)/cpuemu8.o: $(GEN_DIR)/cpuemu.cpp
259 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@
260    
261 gbeauche 1.25 $(OBJ_DIR)/cpuemu1_nf.o: $(GEN_DIR)/cpuemu.cpp
262 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
263 gbeauche 1.25 $(OBJ_DIR)/cpuemu2_nf.o: $(GEN_DIR)/cpuemu.cpp
264 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
265 gbeauche 1.25 $(OBJ_DIR)/cpuemu3_nf.o: $(GEN_DIR)/cpuemu.cpp
266 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
267 gbeauche 1.25 $(OBJ_DIR)/cpuemu4_nf.o: $(GEN_DIR)/cpuemu.cpp
268 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
269 gbeauche 1.25 $(OBJ_DIR)/cpuemu5_nf.o: $(GEN_DIR)/cpuemu.cpp
270 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
271 gbeauche 1.25 $(OBJ_DIR)/cpuemu6_nf.o: $(GEN_DIR)/cpuemu.cpp
272 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
273 gbeauche 1.25 $(OBJ_DIR)/cpuemu7_nf.o: $(GEN_DIR)/cpuemu.cpp
274 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
275 gbeauche 1.25 $(OBJ_DIR)/cpuemu8_nf.o: $(GEN_DIR)/cpuemu.cpp
276 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 -DNOFLAGS $(CXXFLAGS) -c $< -o $@
277    
278 gbeauche 1.25 $(OBJ_DIR)/compemu1.o: $(GEN_DIR)/compemu.cpp
279 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@
280 gbeauche 1.25 $(OBJ_DIR)/compemu2.o: $(GEN_DIR)/compemu.cpp
281 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@
282 gbeauche 1.25 $(OBJ_DIR)/compemu3.o: $(GEN_DIR)/compemu.cpp
283 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@
284 gbeauche 1.25 $(OBJ_DIR)/compemu4.o: $(GEN_DIR)/compemu.cpp
285 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@
286 gbeauche 1.25 $(OBJ_DIR)/compemu5.o: $(GEN_DIR)/compemu.cpp
287 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@
288 gbeauche 1.25 $(OBJ_DIR)/compemu6.o: $(GEN_DIR)/compemu.cpp
289 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@
290 gbeauche 1.25 $(OBJ_DIR)/compemu7.o: $(GEN_DIR)/compemu.cpp
291 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@
292 gbeauche 1.25 $(OBJ_DIR)/compemu8.o: $(GEN_DIR)/compemu.cpp
293 gbeauche 1.23 $(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@
294 nigel 1.17
295 nigel 1.1 #-------------------------------------------------------------------------
296     # DO NOT DELETE THIS LINE -- make depend depends on it.