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 |
gbeauche |
1.4 |
SDL_CFLAGS = @SDL_CFLAGS@ |
17 |
|
|
SDL_LIBS = @SDL_LIBS@ |
18 |
|
|
WANT_GTK = @WANT_GTK@ |
19 |
|
|
GTK_CFLAGS = @GTK_CFLAGS@ |
20 |
|
|
GTK_LIBS = @GTK_LIBS@ |
21 |
|
|
|
22 |
gbeauche |
1.1 |
LN_S = @LN_S@ |
23 |
gbeauche |
1.2 |
WINDRES = @WINDRES@ |
24 |
gbeauche |
1.1 |
CC = @CC@ |
25 |
|
|
CXX = @CXX@ |
26 |
gbeauche |
1.4 |
CFLAGS = @CFLAGS@ $(SDL_CFLAGS) |
27 |
|
|
CXXFLAGS = @CXXFLAGS@ $(SDL_CFLAGS) |
28 |
gbeauche |
1.1 |
CPPFLAGS = @CPPFLAGS@ -I../include -I. |
29 |
|
|
DEFS = @DEFS@ |
30 |
|
|
LDFLAGS = @LDFLAGS@ |
31 |
|
|
LIBS = @LIBS@ |
32 |
|
|
CPUSRCS = @CPUSRCS@ |
33 |
|
|
PERL = @PERL@ |
34 |
|
|
|
35 |
|
|
USE_DYNGEN = @USE_DYNGEN@ |
36 |
|
|
DYNGENSRCS = @DYNGENSRCS@ |
37 |
|
|
DYNGEN_CC = $(CXX) |
38 |
|
|
DYNGEN_OP_FLAGS = @DYNGEN_OP_FLAGS@ |
39 |
|
|
|
40 |
|
|
HOST_CC = gcc |
41 |
|
|
HOST_CXX = g++ |
42 |
|
|
HOST_CFLAGS = -O2 |
43 |
|
|
HOST_CXXFLAGS = -O2 |
44 |
|
|
HOST_LDFLAGS = |
45 |
|
|
|
46 |
|
|
## Files |
47 |
|
|
UNIXSRCS = vm_alloc.cpp vm_alloc.h sigsegv.cpp sigsegv.h video_vosf.h video_blit.cpp video_blit.h |
48 |
|
|
|
49 |
gbeauche |
1.3 |
ROUTERSRCS = router/arp.cpp router/dump.cpp router/dynsockets.cpp router/ftp.cpp \ |
50 |
|
|
router/icmp.cpp router/mib/interfaces.cpp router/iphelp.cpp router/ipsocket.cpp \ |
51 |
|
|
router/mib/mibaccess.cpp router/router.cpp router/tcp.cpp router/udp.cpp b2ether/packet32.cpp |
52 |
|
|
|
53 |
gbeauche |
1.1 |
SRCS = ../main.cpp main_windows.cpp ../prefs.cpp ../prefs_items.cpp prefs_windows.cpp \ |
54 |
|
|
sys_windows.cpp cdenable/cache.cpp cdenable/eject_nt.cpp cdenable/ntcd.cpp \ |
55 |
|
|
../rom_patches.cpp ../rsrc_patches.cpp ../emul_op.cpp ../name_registry.cpp \ |
56 |
|
|
../macos_util.cpp ../timer.cpp timer_windows.cpp ../xpram.cpp xpram_windows.cpp \ |
57 |
|
|
../adb.cpp ../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp ../dummy/scsi_dummy.cpp \ |
58 |
|
|
../gfxaccel.cpp ../video.cpp ../SDL/video_sdl.cpp video_blit.cpp \ |
59 |
gbeauche |
1.3 |
../audio.cpp ../SDL/audio_sdl.cpp ../ether.cpp ether_windows.cpp \ |
60 |
|
|
../thunks.cpp ../serial.cpp serial_windows.cpp ../extfs.cpp extfs_windows.cpp \ |
61 |
gbeauche |
1.1 |
about_window_windows.cpp ../user_strings.cpp user_strings_windows.cpp \ |
62 |
gbeauche |
1.3 |
../dummy/prefs_editor_dummy.cpp clip_windows.cpp util_windows.cpp kernel_windows.cpp \ |
63 |
|
|
vm_alloc.cpp sigsegv.cpp posix_emu.cpp SheepShaver.rc $(CPUSRCS) $(ROUTERSRCS) |
64 |
gbeauche |
1.4 |
|
65 |
|
|
UI_SRCS = ../prefs.cpp prefs_windows.cpp prefs_editor_gtk.cpp xpram_windows.cpp \ |
66 |
|
|
../prefs_items.cpp ../user_strings.cpp user_strings_windows.cpp SheepShaverGUI.rc |
67 |
|
|
|
68 |
|
|
UI_APP = SheepShaverGUI.exe |
69 |
|
|
|
70 |
gbeauche |
1.1 |
APP = SheepShaver.exe |
71 |
|
|
|
72 |
gbeauche |
1.5 |
PROGS = $(APP) |
73 |
|
|
|
74 |
gbeauche |
1.4 |
ifeq ($(WANT_GTK),yes) |
75 |
|
|
PROGS += $(UI_APP) |
76 |
|
|
endif |
77 |
|
|
|
78 |
gbeauche |
1.1 |
## Rules |
79 |
|
|
.PHONY: clean distclean |
80 |
|
|
.SUFFIXES: |
81 |
|
|
.SUFFIXES: .c .cpp .S .o .h |
82 |
|
|
|
83 |
gbeauche |
1.4 |
all: $(PROGS) |
84 |
gbeauche |
1.1 |
|
85 |
|
|
$(UNIXSRCS): %: ../Unix/% |
86 |
|
|
$(LN_S) $< $@ |
87 |
|
|
|
88 |
|
|
OBJ_DIR = obj |
89 |
|
|
$(OBJ_DIR):: |
90 |
|
|
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
91 |
|
|
|
92 |
|
|
define SRCS_LIST_TO_OBJS |
93 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ |
94 |
|
|
$(basename $(notdir $(file)))))) |
95 |
|
|
endef |
96 |
|
|
OBJS = $(SRCS_LIST_TO_OBJS) |
97 |
|
|
|
98 |
gbeauche |
1.4 |
define UI_SRCS_LIST_TO_OBJS |
99 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(UI_SRCS), \ |
100 |
|
|
$(basename $(notdir $(file)))))) |
101 |
|
|
endef |
102 |
|
|
UI_OBJS = $(UI_SRCS_LIST_TO_OBJS) |
103 |
|
|
|
104 |
gbeauche |
1.1 |
define DYNGENSRCS_LIST_TO_OBJS |
105 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .ho, $(foreach file, $(DYNGENSRCS), \ |
106 |
|
|
$(basename $(notdir $(file)))))) |
107 |
|
|
endef |
108 |
|
|
DYNGENOBJS = $(DYNGENSRCS_LIST_TO_OBJS) |
109 |
|
|
|
110 |
|
|
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
111 |
|
|
VPATH := |
112 |
|
|
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
113 |
|
|
|
114 |
|
|
$(APP): $(UNIXSRCS) $(OBJ_DIR) $(OBJS) |
115 |
gbeauche |
1.4 |
$(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS) $(SDL_LIBS) |
116 |
|
|
|
117 |
|
|
$(UI_APP): $(UNIXSRCS) $(OBJ_DIR) $(UI_OBJS) |
118 |
|
|
$(CXX) -o $@ $(LDFLAGS) $(UI_OBJS) $(LIBS) $(GTK_LIBS) -mwindows -mno-cygwin |
119 |
|
|
|
120 |
|
|
mostlyclean: |
121 |
|
|
rm -f $(APP) $(UI_APP) $(OBJ_DIR)/* core* *.core *~ *.bak |
122 |
gbeauche |
1.1 |
|
123 |
gbeauche |
1.4 |
clean: mostlyclean |
124 |
gbeauche |
1.1 |
rm -f $(UNIXSRCS) |
125 |
gbeauche |
1.4 |
rm -f dyngen basic-dyngen-ops.hpp ppc-dyngen-ops.hpp ppc-execute-impl.cpp |
126 |
gbeauche |
1.1 |
|
127 |
|
|
distclean: clean |
128 |
|
|
rm -rf $(OBJ_DIR) |
129 |
gbeauche |
1.4 |
rm -rf autom4te.cache |
130 |
gbeauche |
1.1 |
rm -f Makefile |
131 |
|
|
rm -f config.cache config.log config.status config.h |
132 |
|
|
|
133 |
|
|
depend dep: |
134 |
|
|
makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null |
135 |
|
|
|
136 |
|
|
$(OBJ_DIR)/%.ho : %.c |
137 |
|
|
$(HOST_CC) $(CPPFLAGS) $(DEFS) $(HOST_CFLAGS) -c $< -o $@ |
138 |
|
|
$(OBJ_DIR)/%.ho : %.cpp |
139 |
|
|
$(HOST_CXX) $(CPPFLAGS) $(DEFS) $(HOST_CXXFLAGS) -c $< -o $@ |
140 |
|
|
$(OBJ_DIR)/%.o : %.c |
141 |
|
|
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
142 |
|
|
$(OBJ_DIR)/%.o : %.cpp |
143 |
|
|
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
144 |
|
|
$(OBJ_DIR)/%.o : %.mm |
145 |
|
|
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
146 |
|
|
$(OBJ_DIR)/%.o : %.S |
147 |
|
|
$(CPP) $(CPPFLAGS) -D__ASSEMBLY__ $< -o $*.out.s |
148 |
|
|
$(AS) $(ASFLAGS) -o $@ $*.out.s |
149 |
|
|
rm $*.out.s |
150 |
gbeauche |
1.4 |
$(OBJ_DIR)/prefs_editor_gtk.o: prefs_editor_gtk.cpp |
151 |
|
|
$(CXX) -O2 -mno-cygwin -mms-bitfields $(CPPFLAGS) $(DEFS) $(GTK_CFLAGS) -c $< -o $@ |
152 |
gbeauche |
1.1 |
|
153 |
|
|
# Windows resources |
154 |
|
|
$(OBJ_DIR)/%.o: %.rc |
155 |
gbeauche |
1.2 |
$(WINDRES) --include-dir ../Windows -i $< -o $@ |
156 |
gbeauche |
1.1 |
|
157 |
|
|
# Kheperix CPU emulator |
158 |
|
|
kpxsrcdir = ../kpx_cpu/src |
159 |
|
|
GENEXECPL = $(kpxsrcdir)/cpu/ppc/genexec.pl |
160 |
|
|
DYNGEN = dyngen.exe |
161 |
|
|
|
162 |
|
|
ifeq ($(USE_DYNGEN),yes) |
163 |
|
|
DYNGENDEPS = basic-dyngen-ops.hpp ppc-dyngen-ops.hpp |
164 |
|
|
|
165 |
|
|
$(DYNGEN): $(DYNGENOBJS) |
166 |
gbeauche |
1.2 |
$(HOST_CXX) -o $@ $(LDFLAGS) $(DYNGENOBJS) |
167 |
gbeauche |
1.1 |
|
168 |
|
|
$(OBJ_DIR)/basic-dyngen.o: basic-dyngen-ops.hpp |
169 |
|
|
$(OBJ_DIR)/basic-dyngen-ops.o: $(kpxsrcdir)/cpu/jit/basic-dyngen-ops.cpp |
170 |
|
|
$(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@ |
171 |
|
|
basic-dyngen-ops.hpp: $(OBJ_DIR)/basic-dyngen-ops.o $(DYNGEN) |
172 |
|
|
./$(DYNGEN) -o $@ $< |
173 |
|
|
|
174 |
|
|
$(OBJ_DIR)/ppc-dyngen.o: ppc-dyngen-ops.hpp |
175 |
|
|
$(OBJ_DIR)/ppc-dyngen-ops.o: $(kpxsrcdir)/cpu/ppc/ppc-dyngen-ops.cpp basic-dyngen-ops.hpp |
176 |
|
|
$(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@ |
177 |
|
|
ppc-dyngen-ops.hpp: $(OBJ_DIR)/ppc-dyngen-ops.o $(DYNGEN) |
178 |
|
|
./$(DYNGEN) -o $@ $< |
179 |
|
|
|
180 |
|
|
$(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 |
181 |
|
|
endif |
182 |
|
|
|
183 |
|
|
$(OBJ_DIR)/ppc-execute.o: ppc-execute-impl.cpp |
184 |
|
|
ppc-execute-impl.cpp: $(kpxsrcdir)/cpu/ppc/ppc-decode.cpp $(GENEXECPL) $(DYNGENDEPS) |
185 |
|
|
$(CPP) $(CPPFLAGS) -DGENEXEC $< | $(PERL) $(GENEXECPL) > $@ |
186 |
|
|
|
187 |
|
|
# PowerPC CPU tester |
188 |
|
|
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 |
189 |
|
|
ifeq ($(USE_DYNGEN),yes) |
190 |
|
|
TESTSRCS_ += cpu/jit/jit-cache.cpp cpu/jit/basic-dyngen.cpp cpu/ppc/ppc-dyngen.cpp |
191 |
|
|
endif |
192 |
|
|
TESTSRCS = $(TESTSRCS_:%.cpp=$(kpxsrcdir)/%.cpp) |
193 |
|
|
|
194 |
|
|
define TESTSRCS_LIST_TO_OBJS |
195 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(TESTSRCS), \ |
196 |
|
|
$(basename $(notdir $(file)))))) |
197 |
|
|
endef |
198 |
|
|
TESTOBJS = $(TESTSRCS_LIST_TO_OBJS) |
199 |
|
|
|
200 |
|
|
$(OBJ_DIR)/test-powerpc.o: $(kpxsrcdir)/test/test-powerpc.cpp |
201 |
|
|
$(HOST_CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DEMU_KHEPERIX -c $< -o $@ |
202 |
|
|
|
203 |
|
|
test-powerpc.exe: $(TESTOBJS) |
204 |
|
|
$(HOST_CXX) -o $@ $(LDFLAGS) $(TESTOBJS) -mconsole |
205 |
|
|
|
206 |
|
|
#------------------------------------------------------------------------- |
207 |
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it. |