11 |
|
mandir = @mandir@ |
12 |
|
man1dir = $(mandir)/man1 |
13 |
|
|
14 |
+ |
DESTDIR = |
15 |
+ |
|
16 |
|
CC = @CC@ |
17 |
|
CXX = @CXX@ |
18 |
|
CFLAGS = @CFLAGS@ |
22 |
|
LDFLAGS = @LDFLAGS@ |
23 |
|
LIBS = @LIBS@ |
24 |
|
SYSSRCS = @SYSSRCS@ |
25 |
+ |
CPUSRCS = @CPUSRCS@ |
26 |
+ |
MONSRCS = @MONSRCS@ |
27 |
+ |
USE_DYNGEN = @USE_DYNGEN@ |
28 |
+ |
DYNGENSRCS = @DYNGENSRCS@ |
29 |
+ |
DYNGEN_CC = @DYNGEN_CC@ |
30 |
+ |
DYNGEN_OP_FLAGS = @DYNGEN_OP_FLAGS@ |
31 |
+ |
BLESS = @BLESS@ |
32 |
+ |
EXEEXT = @EXEEXT@ |
33 |
+ |
KEYCODES = @KEYCODES@ |
34 |
|
INSTALL = @INSTALL@ |
35 |
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s |
36 |
|
INSTALL_DATA = @INSTALL_DATA@ |
37 |
|
|
38 |
+ |
# Append disassembler to dyngen, if available |
39 |
+ |
ifneq (:no,$(MONSRCS):$(USE_DYNGEN)) |
40 |
+ |
DYNGENSRCS += $(filter %i386-dis.c,$(MONSRCS)) |
41 |
+ |
endif |
42 |
+ |
|
43 |
|
## Files |
44 |
|
SRCS = main_unix.cpp ../prefs.cpp ../prefs_items.cpp prefs_unix.cpp sys_unix.cpp \ |
45 |
|
../rom_patches.cpp ../rsrc_patches.cpp ../emul_op.cpp ../name_registry.cpp \ |
46 |
|
../macos_util.cpp ../timer.cpp timer_unix.cpp ../xpram.cpp xpram_unix.cpp \ |
47 |
< |
../adb.cpp clip_unix.cpp ../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp \ |
48 |
< |
Linux/scsi_linux.cpp ../video.cpp video_blit.cpp video_x.cpp \ |
49 |
< |
../audio.cpp audio_oss_esd.cpp ../ether.cpp \ |
34 |
< |
Linux/ether_linux.cpp ../serial.cpp serial_unix.cpp ../extfs.cpp extfs_unix.cpp \ |
47 |
> |
../adb.cpp ../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp \ |
48 |
> |
../gfxaccel.cpp ../video.cpp video_blit.cpp ../audio.cpp ../ether.cpp ../thunks.cpp \ |
49 |
> |
../serial.cpp ../extfs.cpp \ |
50 |
|
about_window_unix.cpp ../user_strings.cpp user_strings_unix.cpp \ |
51 |
|
vm_alloc.cpp sigsegv.cpp \ |
52 |
< |
sshpty.c strlcpy.c $(SYSSRCS) |
52 |
> |
sshpty.c strlcpy.c $(SYSSRCS) $(CPUSRCS) $(MONSRCS) |
53 |
|
APP = SheepShaver |
54 |
+ |
APP_EXE = $(APP)$(EXEEXT) |
55 |
+ |
APP_APP = $(APP).app |
56 |
|
|
57 |
|
## Rules |
58 |
|
.PHONY: modules install uninstall clean distclean depend dep |
59 |
|
.SUFFIXES: |
60 |
|
.SUFFIXES: .c .cpp .S .o .h |
61 |
|
|
62 |
< |
all: $(APP) |
62 |
> |
all: $(APP_EXE) |
63 |
|
|
64 |
|
OBJ_DIR = obj |
65 |
|
$(OBJ_DIR):: |
71 |
|
endef |
72 |
|
OBJS = $(SRCS_LIST_TO_OBJS) |
73 |
|
|
74 |
+ |
define DYNGENSRCS_LIST_TO_OBJS |
75 |
+ |
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(DYNGENSRCS), \ |
76 |
+ |
$(basename $(notdir $(file)))))) |
77 |
+ |
endef |
78 |
+ |
DYNGENOBJS = $(DYNGENSRCS_LIST_TO_OBJS) |
79 |
+ |
|
80 |
|
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
81 |
|
VPATH := |
82 |
|
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
83 |
|
|
84 |
< |
$(APP): $(OBJ_DIR) $(OBJS) |
85 |
< |
$(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS) |
84 |
> |
$(APP_EXE): $(OBJ_DIR) $(OBJS) |
85 |
> |
$(CXX) -o $(APP_EXE) $(LDFLAGS) $(OBJS) $(LIBS) |
86 |
> |
$(BLESS) $(APP_EXE) |
87 |
> |
|
88 |
> |
$(APP)_app: $(APP) ../MacOSX/Info.plist ../MacOSX/SheepShaver.icns |
89 |
> |
mkdir -p $(APP_APP)/Contents |
90 |
> |
cp -f ../MacOSX/Info.plist $(APP_APP)/Contents/ |
91 |
> |
echo -n 'APPL????' > $(APP_APP)/Contents/PkgInfo |
92 |
> |
mkdir -p $(APP_APP)/Contents/MacOS |
93 |
> |
cp -f $(APP) $(APP_APP)/Contents/MacOS/ |
94 |
> |
strip $(APP_APP)/Contents/MacOS/$(APP) |
95 |
> |
mkdir -p $(APP_APP)/Contents/Resources |
96 |
> |
cp -f ../MacOSX/SheepShaver.icns $(APP_APP)/Contents/Resources/ |
97 |
|
|
98 |
|
modules: |
99 |
|
cd NetDriver; make |
100 |
|
|
101 |
< |
install: $(APP) installdirs |
102 |
< |
$(INSTALL_PROGRAM) $(APP) $(bindir)/$(APP) |
103 |
< |
-$(INSTALL_DATA) $(APP).1 $(man1dir)/$(APP).1 |
101 |
> |
install: $(APP_EXE) installdirs |
102 |
> |
$(INSTALL_PROGRAM) $(APP_EXE) $(DESTDIR)$(bindir)/$(APP_EXE) |
103 |
> |
-$(INSTALL_DATA) $(APP).1 $(DESTDIR)$(man1dir)/$(APP).1 |
104 |
> |
$(INSTALL_DATA) $(KEYCODES) $(DESTDIR)$(datadir)/$(APP)/keycodes |
105 |
> |
$(INSTALL_DATA) tunconfig $(DESTDIR)$(datadir)/$(APP)/tunconfig |
106 |
> |
chmod 755 $(DESTDIR)$(datadir)/$(APP)/tunconfig |
107 |
|
|
108 |
|
installdirs: |
109 |
< |
$(SHELL) mkinstalldirs $(bindir) $(man1dir) |
109 |
> |
$(SHELL) mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(datadir)/$(APP) |
110 |
|
|
111 |
|
uninstall: |
112 |
< |
rm -f $(bindir)/$(APP) |
113 |
< |
rm -f $(man1dir)/$(APP).1 |
112 |
> |
rm -f $(DESTDIR)$(bindir)/$(APP_EXE) |
113 |
> |
rm -f $(DESTDIR)$(man1dir)/$(APP).1 |
114 |
> |
rm -f $(DESTDIR)$(datadir)/$(APP)/keycodes |
115 |
> |
rm -f $(DESTDIR)$(datadir)/$(APP)/tunconfig |
116 |
> |
rmdir $(DESTDIR)$(datadir)/$(APP) |
117 |
|
|
118 |
|
clean: |
119 |
< |
rm -f $(APP) $(OBJ_DIR)/* core* *.core *~ *.bak |
119 |
> |
rm -f $(APP_EXE) $(OBJ_DIR)/* core* *.core *~ *.bak ppc-execute-impl.cpp |
120 |
> |
rm -f dyngen basic-dyngen-ops.hpp ppc-dyngen-ops.hpp |
121 |
> |
rm -rf $(APP_APP) |
122 |
|
|
123 |
|
distclean: clean |
124 |
|
rm -rf $(OBJ_DIR) |
125 |
|
rm -f Makefile |
126 |
|
rm -f config.cache config.log config.status config.h |
127 |
+ |
rm -f ../MacOSX/Info.plist |
128 |
|
|
129 |
|
depend dep: |
130 |
|
makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null |
133 |
|
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
134 |
|
$(OBJ_DIR)/%.o : %.cpp |
135 |
|
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
136 |
+ |
$(OBJ_DIR)/%.o : %.mm |
137 |
+ |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
138 |
|
$(OBJ_DIR)/%.o : %.S |
139 |
|
$(CPP) $(CPPFLAGS) -D__ASSEMBLY__ $< -o $*.s |
140 |
|
$(AS) $(ASFLAGS) -o $@ $*.s |
141 |
|
rm $*.s |
142 |
|
|
143 |
+ |
# Kheperix CPU emulator |
144 |
+ |
kpxsrcdir = ../kpx_cpu/src |
145 |
+ |
GENEXEC = $(kpxsrcdir)/cpu/ppc/genexec.pl |
146 |
+ |
DYNGEN = dyngen$(EXEEXT) |
147 |
+ |
|
148 |
+ |
ifeq ($(USE_DYNGEN),yes) |
149 |
+ |
DYNGENDEPS = basic-dyngen-ops.hpp ppc-dyngen-ops.hpp |
150 |
+ |
|
151 |
+ |
$(DYNGEN): $(DYNGENOBJS) |
152 |
+ |
$(CXX) -o $@ $(LDFLAGS) $(DYNGENOBJS) |
153 |
+ |
|
154 |
+ |
$(OBJ_DIR)/basic-dyngen.o: basic-dyngen-ops.hpp |
155 |
+ |
$(OBJ_DIR)/basic-dyngen-ops.o: $(kpxsrcdir)/cpu/jit/basic-dyngen-ops.cpp |
156 |
+ |
$(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@ |
157 |
+ |
basic-dyngen-ops.hpp: $(OBJ_DIR)/basic-dyngen-ops.o $(DYNGEN) |
158 |
+ |
./$(DYNGEN) -o $@ $< |
159 |
+ |
|
160 |
+ |
$(OBJ_DIR)/ppc-dyngen.o: ppc-dyngen-ops.hpp |
161 |
+ |
$(OBJ_DIR)/ppc-dyngen-ops.o: $(kpxsrcdir)/cpu/ppc/ppc-dyngen-ops.cpp basic-dyngen-ops.hpp |
162 |
+ |
$(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@ |
163 |
+ |
ppc-dyngen-ops.hpp: $(OBJ_DIR)/ppc-dyngen-ops.o $(DYNGEN) |
164 |
+ |
./$(DYNGEN) -o $@ $< |
165 |
+ |
|
166 |
+ |
$(OBJ_DIR)/sheepshaver_glue.o $(OBJ_DIR)/ppc-cpu.o $(OBJ_DIR)/ppc-decode.o $(OBJ_DIR)/ppc-translate.o: basic-dyngen-ops.hpp ppc-dyngen-ops.hpp |
167 |
+ |
endif |
168 |
+ |
|
169 |
+ |
$(OBJ_DIR)/ppc-execute.o: ppc-execute-impl.cpp |
170 |
+ |
ppc-execute-impl.cpp: $(kpxsrcdir)/cpu/ppc/ppc-decode.cpp $(GENEXEC) $(DYNGENDEPS) |
171 |
+ |
$(CPP) $(CPPFLAGS) -DGENEXEC $< | $(GENEXEC) > $@ |
172 |
+ |
|
173 |
+ |
# PowerPC CPU tester |
174 |
+ |
TESTSRCS_ = mathlib/ieeefp.cpp cpu/ppc/ppc-cpu.cpp cpu/ppc/ppc-decode.cpp cpu/ppc/ppc-execute.cpp cpu/ppc/ppc-translate.cpp test/test-powerpc.cpp $(MONSRCS) vm_alloc.cpp |
175 |
+ |
ifeq ($(USE_DYNGEN),yes) |
176 |
+ |
TESTSRCS_ += cpu/jit/jit-cache.cpp cpu/jit/basic-dyngen.cpp cpu/ppc/ppc-dyngen.cpp |
177 |
+ |
endif |
178 |
+ |
TESTSRCS = $(TESTSRCS_:%.cpp=$(kpxsrcdir)/%.cpp) |
179 |
+ |
|
180 |
+ |
define TESTSRCS_LIST_TO_OBJS |
181 |
+ |
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(TESTSRCS), \ |
182 |
+ |
$(basename $(notdir $(file)))))) |
183 |
+ |
endef |
184 |
+ |
TESTOBJS = $(TESTSRCS_LIST_TO_OBJS) |
185 |
+ |
|
186 |
+ |
$(OBJ_DIR)/test-powerpc.o: $(kpxsrcdir)/test/test-powerpc.cpp |
187 |
+ |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DEMU_KHEPERIX -c $< -o $@ |
188 |
+ |
|
189 |
+ |
test-powerpc$(EXEEXT): $(TESTOBJS) |
190 |
+ |
$(CXX) -o $@ $(LDFLAGS) $(TESTOBJS) $(LIBS) |
191 |
+ |
|
192 |
|
#------------------------------------------------------------------------- |
193 |
|
# DO NOT DELETE THIS LINE -- make depend depends on it. |