1 |
# Unix makefile for Basilisk II |
2 |
|
3 |
## System specific configuration |
4 |
@SET_MAKE@ |
5 |
|
6 |
prefix = @prefix@ |
7 |
exec_prefix = @exec_prefix@ |
8 |
bindir = @bindir@ |
9 |
datadir = @datadir@ |
10 |
mandir = @mandir@ |
11 |
man1dir = $(mandir)/man1 |
12 |
|
13 |
CC = @CC@ |
14 |
CXX = @CXX@ |
15 |
CFLAGS = @CFLAGS@ |
16 |
CXXFLAGS = @CXXFLAGS@ |
17 |
CPPFLAGS = @CPPFLAGS@ -I../include -I. @CPUINCLUDES@ |
18 |
DEFS = @DEFS@ @DEFINES@ -D_REENTRANT -DDATADIR=\"$(datadir)/$(APP)\" |
19 |
LDFLAGS = @LDFLAGS@ |
20 |
LIBS = @LIBS@ |
21 |
SYSSRCS = @SYSSRCS@ |
22 |
CPUSRCS = @CPUSRCS@ |
23 |
INSTALL = @INSTALL@ |
24 |
INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s |
25 |
INSTALL_DATA = @INSTALL_DATA@ |
26 |
|
27 |
## Files |
28 |
SRCS=../prefs.cpp ../rom_patches.cpp ../slot_rom.cpp ../rsrc_patches.cpp ../emul_op.cpp \ |
29 |
../macos_util.cpp ../xpram.cpp ../timer.cpp ../adb.cpp ../serial.cpp ../ether.cpp ../sony.cpp \ |
30 |
../disk.cpp ../cdrom.cpp ../scsi.cpp ../video.cpp ../audio.cpp ../user_strings.cpp \ |
31 |
main_unix.cpp prefs_unix.cpp sys_unix.cpp xpram_unix.cpp timer_unix.cpp clip_unix.cpp \ |
32 |
serial_unix.cpp video_x.cpp \ |
33 |
$(SYSSRCS) $(CPUSRCS) |
34 |
APP = BasiliskII |
35 |
|
36 |
## Rules |
37 |
.PHONY: modules install uninstall clean distclean depend |
38 |
|
39 |
default: $(APP) |
40 |
|
41 |
OBJ_DIR = obj |
42 |
$(OBJ_DIR):: |
43 |
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
44 |
|
45 |
define SRCS_LIST_TO_OBJS |
46 |
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ |
47 |
$(basename $(notdir $(file)))))) |
48 |
endef |
49 |
OBJS = $(SRCS_LIST_TO_OBJS) |
50 |
|
51 |
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
52 |
VPATH := |
53 |
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
54 |
|
55 |
$(APP): $(OBJ_DIR) $(OBJS) |
56 |
$(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS) |
57 |
|
58 |
modules: |
59 |
cd Linux/NetDriver; make |
60 |
|
61 |
install: $(APP) |
62 |
$(INSTALL_PROGRAM) $(APP) $(bindir) |
63 |
$(INSTALL_DATA) $(APP).1 $(man1dir) |
64 |
$(INSTALL) -d $(datadir)/$(APP) |
65 |
$(INSTALL_DATA) keycodes $(datadir)/$(APP) |
66 |
|
67 |
uninstall: |
68 |
-rm -f $(bindir)/$(APP) |
69 |
-rm -f $(man1dir)/$(APP).1 |
70 |
-rm -rf $(datadir)/$(APP) |
71 |
|
72 |
clean: |
73 |
-rm -f $(APP) $(OBJ_DIR)/* core* *.core *~ *.bak |
74 |
-rm -f cpuemu.cpp cpudefs.cpp cputmp.s cpufast*.s cpustbl.cpp cputbl.h |
75 |
|
76 |
distclean: clean |
77 |
-rm -rf $(OBJ_DIR) |
78 |
-rm -f Makefile |
79 |
-rm -f config.cache config.log config.status config.h |
80 |
|
81 |
depend dep: |
82 |
makedepend $(CPPFLAGS) -Y ../*.cpp ../*.c *.cpp |
83 |
|
84 |
$(OBJ_DIR)/%.o : %.c |
85 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
86 |
$(OBJ_DIR)/%.o : %.cpp |
87 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
88 |
$(OBJ_DIR)/%.o : %.s |
89 |
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
90 |
|
91 |
$(OBJ_DIR)/cpuopti: $(OBJ_DIR)/cpuopti.o |
92 |
$(CC) $(LDFLAGS) -o $(OBJ_DIR)/cpuopti $(OBJ_DIR)/cpuopti.o |
93 |
$(OBJ_DIR)/build68k: $(OBJ_DIR)/build68k.o |
94 |
$(CC) $(LDFLAGS) -o $(OBJ_DIR)/build68k $(OBJ_DIR)/build68k.o |
95 |
$(OBJ_DIR)/gencpu: $(OBJ_DIR)/gencpu.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
96 |
$(CC) $(LDFLAGS) -o $(OBJ_DIR)/gencpu $(OBJ_DIR)/gencpu.o $(OBJ_DIR)/readcpu.o $(OBJ_DIR)/cpudefs.o |
97 |
cpudefs.cpp: $(OBJ_DIR)/build68k ../uae_cpu/table68k |
98 |
$(OBJ_DIR)/build68k <../uae_cpu/table68k >cpudefs.cpp |
99 |
cpuemu.cpp: $(OBJ_DIR)/gencpu |
100 |
$(OBJ_DIR)/gencpu |
101 |
cpustbl.cpp: cpuemu.cpp |
102 |
cputbl.h: cpuemu.cpp |
103 |
cpufast.s: cpuemu.cpp $(OBJ_DIR)/cpuopti |
104 |
$(CXX) $(CPPFLAGS) $(DEFS) -S $(CXXFLAGS) $< -o cputmp.s |
105 |
$(OBJ_DIR)/cpuopti <cputmp.s >$@ || mv cputmp.s $@ |
106 |
rm -f cputmp.s |
107 |
|
108 |
#------------------------------------------------------------------------- |
109 |
# DO NOT DELETE THIS LINE -- make depend depends on it. |