1 |
gbeauche |
1.1 |
# Windows Makefile for SheepShaver |
2 |
|
|
|
3 |
|
|
## System specific configuration |
4 |
|
|
@SET_MAKE@ |
5 |
|
|
SHELL = /bin/sh |
6 |
|
|
|
7 |
|
|
prefix = @prefix@ |
8 |
|
|
exec_prefix = @exec_prefix@ |
9 |
|
|
bindir = @bindir@ |
10 |
|
|
datadir = @datadir@ |
11 |
|
|
mandir = @mandir@ |
12 |
|
|
man1dir = $(mandir)/man1 |
13 |
|
|
|
14 |
|
|
DESTDIR = |
15 |
|
|
|
16 |
|
|
LN_S = @LN_S@ |
17 |
|
|
CC = @CC@ |
18 |
|
|
CXX = @CXX@ |
19 |
|
|
CFLAGS = @CFLAGS@ |
20 |
|
|
CXXFLAGS = @CXXFLAGS@ |
21 |
|
|
CPPFLAGS = @CPPFLAGS@ -I../include -I. |
22 |
|
|
DEFS = @DEFS@ |
23 |
|
|
LDFLAGS = @LDFLAGS@ |
24 |
|
|
LIBS = @LIBS@ |
25 |
|
|
CPUSRCS = @CPUSRCS@ |
26 |
|
|
PERL = @PERL@ |
27 |
|
|
|
28 |
|
|
USE_DYNGEN = @USE_DYNGEN@ |
29 |
|
|
DYNGENSRCS = @DYNGENSRCS@ |
30 |
|
|
DYNGEN_CC = $(CXX) |
31 |
|
|
DYNGEN_OP_FLAGS = @DYNGEN_OP_FLAGS@ |
32 |
|
|
|
33 |
|
|
HOST_CC = gcc |
34 |
|
|
HOST_CXX = g++ |
35 |
|
|
HOST_CFLAGS = -O2 |
36 |
|
|
HOST_CXXFLAGS = -O2 |
37 |
|
|
HOST_LDFLAGS = |
38 |
|
|
|
39 |
|
|
## Files |
40 |
|
|
UNIXSRCS = vm_alloc.cpp vm_alloc.h sigsegv.cpp sigsegv.h video_vosf.h video_blit.cpp video_blit.h |
41 |
|
|
|
42 |
|
|
SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_windows.cpp \ |
43 |
|
|
sys_windows.cpp cdenable/cache.cpp cdenable/eject_nt.cpp cdenable/ntcd.cpp \ |
44 |
|
|
../rom_patches.cpp ../rsrc_patches.cpp ../emul_op.cpp ../name_registry.cpp \ |
45 |
|
|
../macos_util.cpp ../timer.cpp timer_windows.cpp ../xpram.cpp xpram_windows.cpp \ |
46 |
|
|
../adb.cpp ../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp ../dummy/scsi_dummy.cpp \ |
47 |
|
|
../gfxaccel.cpp ../video.cpp ../SDL/video_sdl.cpp video_blit.cpp \ |
48 |
|
|
../audio.cpp ../SDL/audio_sdl.cpp ../ether.cpp ../dummy/ether_dummy.cpp \ |
49 |
|
|
../thunks.cpp ../serial.cpp ../dummy/serial_dummy.cpp ../extfs.cpp extfs_windows.cpp \ |
50 |
|
|
about_window_windows.cpp ../user_strings.cpp user_strings_windows.cpp \ |
51 |
|
|
../dummy/prefs_editor_dummy.cpp clip_windows.cpp util_windows.cpp \ |
52 |
|
|
vm_alloc.cpp sigsegv.cpp posix_emu.cpp SheepShaver.rc $(CPUSRCS) |
53 |
|
|
APP = SheepShaver.exe |
54 |
|
|
|
55 |
|
|
## Rules |
56 |
|
|
.PHONY: clean distclean |
57 |
|
|
.SUFFIXES: |
58 |
|
|
.SUFFIXES: .c .cpp .S .o .h |
59 |
|
|
|
60 |
|
|
all: $(APP) |
61 |
|
|
|
62 |
|
|
$(UNIXSRCS): %: ../Unix/% |
63 |
|
|
$(LN_S) $< $@ |
64 |
|
|
|
65 |
|
|
OBJ_DIR = obj |
66 |
|
|
$(OBJ_DIR):: |
67 |
|
|
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
68 |
|
|
|
69 |
|
|
define SRCS_LIST_TO_OBJS |
70 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ |
71 |
|
|
$(basename $(notdir $(file)))))) |
72 |
|
|
endef |
73 |
|
|
OBJS = $(SRCS_LIST_TO_OBJS) |
74 |
|
|
|
75 |
|
|
define DYNGENSRCS_LIST_TO_OBJS |
76 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .ho, $(foreach file, $(DYNGENSRCS), \ |
77 |
|
|
$(basename $(notdir $(file)))))) |
78 |
|
|
endef |
79 |
|
|
DYNGENOBJS = $(DYNGENSRCS_LIST_TO_OBJS) |
80 |
|
|
|
81 |
|
|
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
82 |
|
|
VPATH := |
83 |
|
|
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
84 |
|
|
|
85 |
|
|
$(APP): $(UNIXSRCS) $(OBJ_DIR) $(OBJS) |
86 |
|
|
$(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS) |
87 |
|
|
|
88 |
|
|
clean: |
89 |
|
|
rm -f $(UNIXSRCS) |
90 |
|
|
rm -f $(APP) $(OBJ_DIR)/* core* *.core *~ *.bak ppc-execute-impl.cpp |
91 |
|
|
rm -f dyngen basic-dyngen-ops.hpp ppc-dyngen-ops.hpp |
92 |
|
|
|
93 |
|
|
distclean: clean |
94 |
|
|
rm -rf $(OBJ_DIR) |
95 |
|
|
rm -f Makefile |
96 |
|
|
rm -f config.cache config.log config.status config.h |
97 |
|
|
|
98 |
|
|
depend dep: |
99 |
|
|
makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null |
100 |
|
|
|
101 |
|
|
$(OBJ_DIR)/%.ho : %.c |
102 |
|
|
$(HOST_CC) $(CPPFLAGS) $(DEFS) $(HOST_CFLAGS) -c $< -o $@ |
103 |
|
|
$(OBJ_DIR)/%.ho : %.cpp |
104 |
|
|
$(HOST_CXX) $(CPPFLAGS) $(DEFS) $(HOST_CXXFLAGS) -c $< -o $@ |
105 |
|
|
$(OBJ_DIR)/%.o : %.c |
106 |
|
|
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
107 |
|
|
$(OBJ_DIR)/%.o : %.cpp |
108 |
|
|
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
109 |
|
|
$(OBJ_DIR)/%.o : %.mm |
110 |
|
|
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
111 |
|
|
$(OBJ_DIR)/%.o : %.S |
112 |
|
|
$(CPP) $(CPPFLAGS) -D__ASSEMBLY__ $< -o $*.out.s |
113 |
|
|
$(AS) $(ASFLAGS) -o $@ $*.out.s |
114 |
|
|
rm $*.out.s |
115 |
|
|
|
116 |
|
|
# Windows resources |
117 |
|
|
$(OBJ_DIR)/%.o: %.rc |
118 |
|
|
windres --include-dir ../Windows -i $< -o $@ |
119 |
|
|
|
120 |
|
|
# Kheperix CPU emulator |
121 |
|
|
kpxsrcdir = ../kpx_cpu/src |
122 |
|
|
GENEXECPL = $(kpxsrcdir)/cpu/ppc/genexec.pl |
123 |
|
|
DYNGEN = dyngen.exe |
124 |
|
|
|
125 |
|
|
ifeq ($(USE_DYNGEN),yes) |
126 |
|
|
DYNGENDEPS = basic-dyngen-ops.hpp ppc-dyngen-ops.hpp |
127 |
|
|
|
128 |
|
|
$(DYNGEN): $(DYNGENOBJS) |
129 |
|
|
$(CXX) -o $@ $(LDFLAGS) $(DYNGENOBJS) |
130 |
|
|
|
131 |
|
|
$(OBJ_DIR)/basic-dyngen.o: basic-dyngen-ops.hpp |
132 |
|
|
$(OBJ_DIR)/basic-dyngen-ops.o: $(kpxsrcdir)/cpu/jit/basic-dyngen-ops.cpp |
133 |
|
|
$(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@ |
134 |
|
|
basic-dyngen-ops.hpp: $(OBJ_DIR)/basic-dyngen-ops.o $(DYNGEN) |
135 |
|
|
./$(DYNGEN) -o $@ $< |
136 |
|
|
|
137 |
|
|
$(OBJ_DIR)/ppc-dyngen.o: ppc-dyngen-ops.hpp |
138 |
|
|
$(OBJ_DIR)/ppc-dyngen-ops.o: $(kpxsrcdir)/cpu/ppc/ppc-dyngen-ops.cpp basic-dyngen-ops.hpp |
139 |
|
|
$(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@ |
140 |
|
|
ppc-dyngen-ops.hpp: $(OBJ_DIR)/ppc-dyngen-ops.o $(DYNGEN) |
141 |
|
|
./$(DYNGEN) -o $@ $< |
142 |
|
|
|
143 |
|
|
$(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 |
144 |
|
|
endif |
145 |
|
|
|
146 |
|
|
$(OBJ_DIR)/ppc-execute.o: ppc-execute-impl.cpp |
147 |
|
|
ppc-execute-impl.cpp: $(kpxsrcdir)/cpu/ppc/ppc-decode.cpp $(GENEXECPL) $(DYNGENDEPS) |
148 |
|
|
$(CPP) $(CPPFLAGS) -DGENEXEC $< | $(PERL) $(GENEXECPL) > $@ |
149 |
|
|
|
150 |
|
|
# PowerPC CPU tester |
151 |
|
|
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 |
152 |
|
|
ifeq ($(USE_DYNGEN),yes) |
153 |
|
|
TESTSRCS_ += cpu/jit/jit-cache.cpp cpu/jit/basic-dyngen.cpp cpu/ppc/ppc-dyngen.cpp |
154 |
|
|
endif |
155 |
|
|
TESTSRCS = $(TESTSRCS_:%.cpp=$(kpxsrcdir)/%.cpp) |
156 |
|
|
|
157 |
|
|
define TESTSRCS_LIST_TO_OBJS |
158 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(TESTSRCS), \ |
159 |
|
|
$(basename $(notdir $(file)))))) |
160 |
|
|
endef |
161 |
|
|
TESTOBJS = $(TESTSRCS_LIST_TO_OBJS) |
162 |
|
|
|
163 |
|
|
$(OBJ_DIR)/test-powerpc.o: $(kpxsrcdir)/test/test-powerpc.cpp |
164 |
|
|
$(HOST_CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DEMU_KHEPERIX -c $< -o $@ |
165 |
|
|
|
166 |
|
|
test-powerpc.exe: $(TESTOBJS) |
167 |
|
|
$(HOST_CXX) -o $@ $(LDFLAGS) $(TESTOBJS) -mconsole |
168 |
|
|
|
169 |
|
|
#------------------------------------------------------------------------- |
170 |
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it. |