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