1 |
# Unix makefile for Basilisk II |
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 |
CC = @CC@ |
17 |
CXX = @CXX@ |
18 |
CFLAGS = @CFLAGS@ |
19 |
CXXFLAGS = @CXXFLAGS@ |
20 |
CPPFLAGS = @CPPFLAGS@ -I../include -I. @CPUINCLUDES@ |
21 |
DEFS = @DEFS@ @DEFINES@ -D_REENTRANT -DDATADIR=\"$(datadir)/$(APP)\" |
22 |
LDFLAGS = @LDFLAGS@ |
23 |
LIBS = @LIBS@ |
24 |
SYSSRCS = @SYSSRCS@ |
25 |
CPUSRCS = @CPUSRCS@ |
26 |
INSTALL = @INSTALL@ |
27 |
INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s |
28 |
INSTALL_DATA = @INSTALL_DATA@ |
29 |
|
30 |
## Files |
31 |
SRCS = ../main.cpp main_unix.cpp ../prefs.cpp ../prefs_items.cpp prefs_unix.cpp \ |
32 |
sys_unix.cpp ../rom_patches.cpp ../slot_rom.cpp ../rsrc_patches.cpp \ |
33 |
../emul_op.cpp ../macos_util.cpp ../xpram.cpp xpram_unix.cpp ../timer.cpp \ |
34 |
timer_unix.cpp clip_unix.cpp ../adb.cpp ../serial.cpp ../ether.cpp \ |
35 |
../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp ../video.cpp video_blit.cpp \ |
36 |
video_x.cpp sigsegv.cpp ../audio.cpp ../extfs.cpp extfs_unix.cpp \ |
37 |
../user_strings.cpp user_strings_unix.cpp \ |
38 |
$(SYSSRCS) $(CPUSRCS) |
39 |
APP = BasiliskII |
40 |
|
41 |
## Rules |
42 |
.PHONY: modules install installdirs uninstall mostlyclean clean distclean depend dep |
43 |
.SUFFIXES: |
44 |
.SUFFIXES: .c .cpp .s .o .h |
45 |
|
46 |
all: $(APP) |
47 |
|
48 |
OBJ_DIR = obj |
49 |
$(OBJ_DIR):: |
50 |
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
51 |
|
52 |
define SRCS_LIST_TO_OBJS |
53 |
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ |
54 |
$(basename $(notdir $(file)))))) |
55 |
endef |
56 |
OBJS = $(SRCS_LIST_TO_OBJS) |
57 |
|
58 |
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
59 |
VPATH := |
60 |
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
61 |
|
62 |
$(APP): $(OBJ_DIR) $(OBJS) |
63 |
$(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS) |
64 |
|
65 |
modules: |
66 |
cd Linux/NetDriver; make |
67 |
|
68 |
install: $(APP) installdirs |
69 |
$(INSTALL_PROGRAM) $(APP) $(DESTDIR)$(bindir)/$(APP) |
70 |
-$(INSTALL_DATA) $(APP).1 $(DESTDIR)$(man1dir)/$(APP).1 |
71 |
$(INSTALL_DATA) keycodes $(DESTDIR)$(datadir)/$(APP)/keycodes |
72 |
$(INSTALL_DATA) fbdevices $(DESTDIR)$(datadir)/$(APP)/fbdevices |
73 |
|
74 |
installdirs: |
75 |
$(SHELL) mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(datadir)/$(APP) |
76 |
|
77 |
uninstall: |
78 |
rm -f $(DESTDIR)$(bindir)/$(APP) |
79 |
rm -f $(DESTDIR)$(man1dir)/$(APP).1 |
80 |
rm -f $(DESTDIR)$(datadir)/$(APP)/keycodes |
81 |
rm -f $(DESTDIR)$(datadir)/$(APP)/fbdevices |
82 |
rmdir $(DESTDIR)$(datadir)/$(APP) |
83 |
|
84 |
mostlyclean: |
85 |
rm -f $(APP) $(OBJ_DIR)/* core* *.core *~ *.bak |
86 |
|
87 |
clean: mostlyclean |
88 |
rm -f cpuemu.cpp cpudefs.cpp cputmp*.s cpufast*.s cpustbl.cpp cputbl.h |
89 |
|
90 |
distclean: clean |
91 |
rm -rf $(OBJ_DIR) |
92 |
rm -f Makefile |
93 |
rm -f config.cache config.log config.status config.h |
94 |
|
95 |
depend dep: |
96 |
makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null |
97 |
|
98 |
$(OBJ_DIR)/%.o : %.c |
99 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
100 |
$(OBJ_DIR)/%.o : %.cpp |
101 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
102 |
$(OBJ_DIR)/%.o : %.s |
103 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
104 |
|
105 |
$(OBJ_DIR)/cpuopti: $(OBJ_DIR)/cpuopti.o |
106 |
$(CC) $(LDFLAGS) -o $(OBJ_DIR)/cpuopti $(OBJ_DIR)/cpuopti.o |
107 |
$(OBJ_DIR)/build68k: $(OBJ_DIR)/build68k.o |
108 |
$(CC) $(LDFLAGS) -o $(OBJ_DIR)/build68k $(OBJ_DIR)/build68k.o |
109 |
$(OBJ_DIR)/gencpu: $(OBJ_DIR)/gencpu.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
110 |
$(CC) $(LDFLAGS) -o $(OBJ_DIR)/gencpu $(OBJ_DIR)/gencpu.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
111 |
cpudefs.cpp: $(OBJ_DIR)/build68k ../uae_cpu/table68k |
112 |
$(OBJ_DIR)/build68k <../uae_cpu/table68k >cpudefs.cpp |
113 |
cpustbl.cpp: cpuemu.cpp |
114 |
cputbl.h: cpuemu.cpp |
115 |
|
116 |
cpuemu.cpp: $(OBJ_DIR)/gencpu |
117 |
$(OBJ_DIR)/gencpu |
118 |
|
119 |
$(OBJ_DIR)/cpuemu1.o: cpuemu.cpp |
120 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 $(CXXFLAGS) -c $< -o $@ |
121 |
$(OBJ_DIR)/cpuemu2.o: cpuemu.cpp |
122 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 $(CXXFLAGS) -c $< -o $@ |
123 |
$(OBJ_DIR)/cpuemu3.o: cpuemu.cpp |
124 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 $(CXXFLAGS) -c $< -o $@ |
125 |
$(OBJ_DIR)/cpuemu4.o: cpuemu.cpp |
126 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 $(CXXFLAGS) -c $< -o $@ |
127 |
$(OBJ_DIR)/cpuemu5.o: cpuemu.cpp |
128 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 $(CXXFLAGS) -c $< -o $@ |
129 |
$(OBJ_DIR)/cpuemu6.o: cpuemu.cpp |
130 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 $(CXXFLAGS) -c $< -o $@ |
131 |
$(OBJ_DIR)/cpuemu7.o: cpuemu.cpp |
132 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 $(CXXFLAGS) -c $< -o $@ |
133 |
$(OBJ_DIR)/cpuemu8.o: cpuemu.cpp |
134 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 $(CXXFLAGS) -c $< -o $@ |
135 |
|
136 |
cpufast.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
137 |
$(CXX) $(CPPFLAGS) $(DEFS) -S $(CXXFLAGS) $< -o cputmp.s |
138 |
$(OBJ_DIR)/cpuopti <cputmp.s >$@ || mv cputmp.s $@ |
139 |
rm -f cputmp.s |
140 |
cpufast1.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
141 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_1 -S $(CXXFLAGS) $< -o cputmp1.s |
142 |
$(OBJ_DIR)/cpuopti <cputmp1.s >$@ || mv cputmp1.s $@ |
143 |
rm -f cputmp1.s |
144 |
cpufast2.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
145 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_2 -S $(CXXFLAGS) $< -o cputmp2.s |
146 |
$(OBJ_DIR)/cpuopti <cputmp2.s >$@ || mv cputmp2.s $@ |
147 |
rm -f cputmp2.s |
148 |
cpufast3.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
149 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_3 -S $(CXXFLAGS) $< -o cputmp3.s |
150 |
$(OBJ_DIR)/cpuopti <cputmp3.s >$@ || mv cputmp3.s $@ |
151 |
rm -f cputmp3.s |
152 |
cpufast4.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
153 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_4 -S $(CXXFLAGS) $< -o cputmp4.s |
154 |
$(OBJ_DIR)/cpuopti <cputmp4.s >$@ || mv cputmp4.s $@ |
155 |
rm -f cputmp4.s |
156 |
cpufast5.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
157 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_5 -S $(CXXFLAGS) $< -o cputmp5.s |
158 |
$(OBJ_DIR)/cpuopti <cputmp5.s >$@ || mv cputmp5.s $@ |
159 |
rm -f cputmp5.s |
160 |
cpufast6.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
161 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_6 -S $(CXXFLAGS) $< -o cputmp6.s |
162 |
$(OBJ_DIR)/cpuopti <cputmp6.s >$@ || mv cputmp6.s $@ |
163 |
rm -f cputmp6.s |
164 |
cpufast7.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
165 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_7 -S $(CXXFLAGS) $< -o cputmp7.s |
166 |
$(OBJ_DIR)/cpuopti <cputmp7.s >$@ || mv cputmp7.s $@ |
167 |
rm -f cputmp7.s |
168 |
cpufast8.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
169 |
$(CXX) $(CPPFLAGS) $(DEFS) -DPART_8 -S $(CXXFLAGS) $< -o cputmp8.s |
170 |
$(OBJ_DIR)/cpuopti <cputmp8.s >$@ || mv cputmp8.s $@ |
171 |
rm -f cputmp8.s |
172 |
|
173 |
#------------------------------------------------------------------------- |
174 |
# DO NOT DELETE THIS LINE -- make depend depends on it. |