ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/MacOSX/Makefile.in
Revision: 1.25
Committed: 2007-06-15T17:11:46Z (17 years, 4 months ago) by gbeauche
Branch: MAIN
Changes since 1.24: +117 -63 lines
Log Message:
Enable universal builds with --enable-universal

Move arch-dependent definitions to config_macosx.h, i.e. make them compile
time instead of configure time. Support IEEE FPU emulation core only.

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