1 |
cebix |
1.1 |
# Linux 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 |
|
|
CC = @CC@ |
15 |
|
|
CXX = @CXX@ |
16 |
|
|
CFLAGS = @CFLAGS@ |
17 |
|
|
CXXFLAGS = @CXXFLAGS@ |
18 |
|
|
CPPFLAGS = @CPPFLAGS@ -I../include -I. |
19 |
|
|
DEFS = @DEFS@ -D_REENTRANT -DDATADIR=\"$(datadir)/$(APP)\" |
20 |
|
|
LDFLAGS = @LDFLAGS@ |
21 |
|
|
LIBS = @LIBS@ |
22 |
|
|
SYSSRCS = @SYSSRCS@ |
23 |
gbeauche |
1.7 |
CPUSRCS = @CPUSRCS@ |
24 |
|
|
DYNGENSRCS = @DYNGENSRCS@ |
25 |
gbeauche |
1.10 |
DYNGEN_CC = @DYNGEN_CC@ |
26 |
gbeauche |
1.7 |
DYNGEN_OP_FLAGS = @DYNGEN_OP_FLAGS@ |
27 |
gbeauche |
1.9 |
BLESS = @BLESS@ |
28 |
cebix |
1.1 |
INSTALL = @INSTALL@ |
29 |
|
|
INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s |
30 |
|
|
INSTALL_DATA = @INSTALL_DATA@ |
31 |
|
|
|
32 |
|
|
## Files |
33 |
|
|
SRCS = main_unix.cpp ../prefs.cpp ../prefs_items.cpp prefs_unix.cpp sys_unix.cpp \ |
34 |
|
|
../rom_patches.cpp ../rsrc_patches.cpp ../emul_op.cpp ../name_registry.cpp \ |
35 |
|
|
../macos_util.cpp ../timer.cpp timer_unix.cpp ../xpram.cpp xpram_unix.cpp \ |
36 |
|
|
../adb.cpp clip_unix.cpp ../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp \ |
37 |
gbeauche |
1.9 |
../video.cpp video_blit.cpp video_x.cpp ../audio.cpp ../ether.cpp ../thunks.cpp \ |
38 |
|
|
../serial.cpp ../extfs.cpp extfs_unix.cpp \ |
39 |
gbeauche |
1.2 |
about_window_unix.cpp ../user_strings.cpp user_strings_unix.cpp \ |
40 |
gbeauche |
1.3 |
vm_alloc.cpp sigsegv.cpp \ |
41 |
gbeauche |
1.7 |
sshpty.c strlcpy.c $(SYSSRCS) $(CPUSRCS) |
42 |
cebix |
1.1 |
APP = SheepShaver |
43 |
|
|
|
44 |
|
|
## Rules |
45 |
|
|
.PHONY: modules install uninstall clean distclean depend dep |
46 |
|
|
.SUFFIXES: |
47 |
|
|
.SUFFIXES: .c .cpp .S .o .h |
48 |
|
|
|
49 |
|
|
all: $(APP) |
50 |
|
|
|
51 |
|
|
OBJ_DIR = obj |
52 |
|
|
$(OBJ_DIR):: |
53 |
|
|
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
54 |
|
|
|
55 |
|
|
define SRCS_LIST_TO_OBJS |
56 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ |
57 |
|
|
$(basename $(notdir $(file)))))) |
58 |
|
|
endef |
59 |
|
|
OBJS = $(SRCS_LIST_TO_OBJS) |
60 |
|
|
|
61 |
gbeauche |
1.7 |
define DYNGENSRCS_LIST_TO_OBJS |
62 |
|
|
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(DYNGENSRCS), \ |
63 |
|
|
$(basename $(notdir $(file)))))) |
64 |
|
|
endef |
65 |
|
|
DYNGENOBJS = $(DYNGENSRCS_LIST_TO_OBJS) |
66 |
|
|
|
67 |
cebix |
1.1 |
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
68 |
|
|
VPATH := |
69 |
|
|
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
70 |
|
|
|
71 |
|
|
$(APP): $(OBJ_DIR) $(OBJS) |
72 |
|
|
$(CXX) -o $(APP) $(LDFLAGS) $(OBJS) $(LIBS) |
73 |
gbeauche |
1.9 |
$(BLESS) $(APP) |
74 |
cebix |
1.1 |
|
75 |
|
|
modules: |
76 |
|
|
cd NetDriver; make |
77 |
|
|
|
78 |
|
|
install: $(APP) installdirs |
79 |
|
|
$(INSTALL_PROGRAM) $(APP) $(bindir)/$(APP) |
80 |
|
|
-$(INSTALL_DATA) $(APP).1 $(man1dir)/$(APP).1 |
81 |
|
|
|
82 |
|
|
installdirs: |
83 |
|
|
$(SHELL) mkinstalldirs $(bindir) $(man1dir) |
84 |
|
|
|
85 |
|
|
uninstall: |
86 |
|
|
rm -f $(bindir)/$(APP) |
87 |
|
|
rm -f $(man1dir)/$(APP).1 |
88 |
|
|
|
89 |
|
|
clean: |
90 |
gbeauche |
1.5 |
rm -f $(APP) $(OBJ_DIR)/* core* *.core *~ *.bak ppc-execute-impl.cpp |
91 |
gbeauche |
1.7 |
rm -f dyngen basic-dyngen-ops.hpp ppc-dyngen-ops.hpp |
92 |
cebix |
1.1 |
|
93 |
|
|
distclean: clean |
94 |
|
|
rm -rf $(OBJ_DIR) |
95 |
|
|
rm -f Makefile |
96 |
|
|
rm -f config.cache config.log config.status config.h |
97 |
|
|
|
98 |
|
|
depend dep: |
99 |
|
|
makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null |
100 |
|
|
|
101 |
|
|
$(OBJ_DIR)/%.o : %.c |
102 |
|
|
$(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@ |
103 |
|
|
$(OBJ_DIR)/%.o : %.cpp |
104 |
|
|
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
105 |
|
|
$(OBJ_DIR)/%.o : %.S |
106 |
|
|
$(CPP) $(CPPFLAGS) -D__ASSEMBLY__ $< -o $*.s |
107 |
|
|
$(AS) $(ASFLAGS) -o $@ $*.s |
108 |
|
|
rm $*.s |
109 |
gbeauche |
1.5 |
|
110 |
|
|
# Kheperix CPU emulator |
111 |
|
|
GENEXEC = ../kpx_cpu/src/cpu/ppc/genexec.pl |
112 |
|
|
|
113 |
gbeauche |
1.6 |
$(OBJ_DIR)/ppc-execute.o: ppc-execute-impl.cpp |
114 |
gbeauche |
1.5 |
ppc-execute-impl.cpp: ../kpx_cpu/src/cpu/ppc/ppc-decode.cpp $(GENEXEC) |
115 |
gbeauche |
1.6 |
$(CPP) $(CPPFLAGS) -DGENEXEC $< | $(GENEXEC) > $@ |
116 |
gbeauche |
1.7 |
|
117 |
|
|
dyngen: $(DYNGENOBJS) |
118 |
|
|
$(CXX) -o $@ $(LDFLAGS) $(DYNGENOBJS) |
119 |
|
|
|
120 |
|
|
$(OBJ_DIR)/basic-dyngen.o: basic-dyngen-ops.hpp |
121 |
|
|
$(OBJ_DIR)/basic-dyngen-ops.o: ../kpx_cpu/src/cpu/jit/basic-dyngen-ops.cpp |
122 |
gbeauche |
1.10 |
$(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@ |
123 |
gbeauche |
1.7 |
basic-dyngen-ops.hpp: $(OBJ_DIR)/basic-dyngen-ops.o dyngen |
124 |
|
|
./dyngen -o $@ $< |
125 |
|
|
|
126 |
|
|
$(OBJ_DIR)/ppc-dyngen.o: ppc-dyngen-ops.hpp |
127 |
|
|
$(OBJ_DIR)/ppc-dyngen-ops.o: ../kpx_cpu/src/cpu/ppc/ppc-dyngen-ops.cpp |
128 |
gbeauche |
1.10 |
$(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@ |
129 |
gbeauche |
1.7 |
ppc-dyngen-ops.hpp: $(OBJ_DIR)/ppc-dyngen-ops.o dyngen |
130 |
|
|
./dyngen -o $@ $< |
131 |
cebix |
1.1 |
|
132 |
|
|
#------------------------------------------------------------------------- |
133 |
|
|
# DO NOT DELETE THIS LINE -- make depend depends on it. |