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