ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/SheepShaver/src/Unix/Makefile.in
Revision: 1.28
Committed: 2005-01-30T21:19:07Z (19 years, 9 months ago) by gbeauche
Branch: MAIN
Changes since 1.27: +1 -1 lines
Log Message:
Add InitAll() which covers common initializations so that to avoid duplicate
code and possible bugs (e.g. on BeOS/PPC). Likewise for ExitAll().

File Contents

# User Rev Content
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 gbeauche 1.11 DESTDIR =
15    
16 cebix 1.1 CC = @CC@
17     CXX = @CXX@
18     CFLAGS = @CFLAGS@
19     CXXFLAGS = @CXXFLAGS@
20     CPPFLAGS = @CPPFLAGS@ -I../include -I.
21     DEFS = @DEFS@ -D_REENTRANT -DDATADIR=\"$(datadir)/$(APP)\"
22     LDFLAGS = @LDFLAGS@
23     LIBS = @LIBS@
24     SYSSRCS = @SYSSRCS@
25 gbeauche 1.7 CPUSRCS = @CPUSRCS@
26 gbeauche 1.23 MONSRCS = @MONSRCS@
27 gbeauche 1.27 USE_DYNGEN = @USE_DYNGEN@
28 gbeauche 1.7 DYNGENSRCS = @DYNGENSRCS@
29 gbeauche 1.10 DYNGEN_CC = @DYNGEN_CC@
30 gbeauche 1.7 DYNGEN_OP_FLAGS = @DYNGEN_OP_FLAGS@
31 gbeauche 1.9 BLESS = @BLESS@
32 gbeauche 1.20 EXEEXT = @EXEEXT@
33 gbeauche 1.15 KEYCODES = @KEYCODES@
34 cebix 1.1 INSTALL = @INSTALL@
35     INSTALL_PROGRAM = @INSTALL_PROGRAM@ -s
36     INSTALL_DATA = @INSTALL_DATA@
37    
38 gbeauche 1.26 # Append disassembler to dyngen, if available
39 gbeauche 1.27 ifneq (:no,$(MONSRCS):$(USE_DYNGEN))
40 gbeauche 1.26 DYNGENSRCS += $(filter %i386-dis.c,$(MONSRCS))
41     endif
42    
43 cebix 1.1 ## Files
44 gbeauche 1.28 SRCS = ../main.cpp main_unix.cpp ../prefs.cpp ../prefs_items.cpp prefs_unix.cpp sys_unix.cpp \
45 cebix 1.1 ../rom_patches.cpp ../rsrc_patches.cpp ../emul_op.cpp ../name_registry.cpp \
46     ../macos_util.cpp ../timer.cpp timer_unix.cpp ../xpram.cpp xpram_unix.cpp \
47 gbeauche 1.13 ../adb.cpp ../sony.cpp ../disk.cpp ../cdrom.cpp ../scsi.cpp \
48 gbeauche 1.16 ../gfxaccel.cpp ../video.cpp video_blit.cpp ../audio.cpp ../ether.cpp ../thunks.cpp \
49 gbeauche 1.18 ../serial.cpp ../extfs.cpp \
50 gbeauche 1.2 about_window_unix.cpp ../user_strings.cpp user_strings_unix.cpp \
51 gbeauche 1.3 vm_alloc.cpp sigsegv.cpp \
52 gbeauche 1.23 sshpty.c strlcpy.c $(SYSSRCS) $(CPUSRCS) $(MONSRCS)
53 cebix 1.1 APP = SheepShaver
54 gbeauche 1.20 APP_EXE = $(APP)$(EXEEXT)
55 gbeauche 1.17 APP_APP = $(APP).app
56 cebix 1.1
57     ## Rules
58     .PHONY: modules install uninstall clean distclean depend dep
59     .SUFFIXES:
60     .SUFFIXES: .c .cpp .S .o .h
61    
62 gbeauche 1.20 all: $(APP_EXE)
63 cebix 1.1
64     OBJ_DIR = obj
65     $(OBJ_DIR)::
66     @[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1
67    
68     define SRCS_LIST_TO_OBJS
69     $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \
70     $(basename $(notdir $(file))))))
71     endef
72     OBJS = $(SRCS_LIST_TO_OBJS)
73    
74 gbeauche 1.7 define DYNGENSRCS_LIST_TO_OBJS
75     $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(DYNGENSRCS), \
76     $(basename $(notdir $(file))))))
77     endef
78     DYNGENOBJS = $(DYNGENSRCS_LIST_TO_OBJS)
79    
80 cebix 1.1 SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file))))
81     VPATH :=
82     VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS))))
83    
84 gbeauche 1.20 $(APP_EXE): $(OBJ_DIR) $(OBJS)
85     $(CXX) -o $(APP_EXE) $(LDFLAGS) $(OBJS) $(LIBS)
86     $(BLESS) $(APP_EXE)
87 cebix 1.1
88 gbeauche 1.17 $(APP)_app: $(APP) ../MacOSX/Info.plist ../MacOSX/SheepShaver.icns
89     mkdir -p $(APP_APP)/Contents
90     cp -f ../MacOSX/Info.plist $(APP_APP)/Contents/
91     echo -n 'APPL????' > $(APP_APP)/Contents/PkgInfo
92     mkdir -p $(APP_APP)/Contents/MacOS
93     cp -f $(APP) $(APP_APP)/Contents/MacOS/
94     strip $(APP_APP)/Contents/MacOS/$(APP)
95     mkdir -p $(APP_APP)/Contents/Resources
96     cp -f ../MacOSX/SheepShaver.icns $(APP_APP)/Contents/Resources/
97    
98 cebix 1.1 modules:
99     cd NetDriver; make
100    
101 gbeauche 1.20 install: $(APP_EXE) installdirs
102     $(INSTALL_PROGRAM) $(APP_EXE) $(DESTDIR)$(bindir)/$(APP_EXE)
103 gbeauche 1.11 -$(INSTALL_DATA) $(APP).1 $(DESTDIR)$(man1dir)/$(APP).1
104 gbeauche 1.14 $(INSTALL_DATA) $(KEYCODES) $(DESTDIR)$(datadir)/$(APP)/keycodes
105 gbeauche 1.11 $(INSTALL_DATA) tunconfig $(DESTDIR)$(datadir)/$(APP)/tunconfig
106 gbeauche 1.12 chmod 755 $(DESTDIR)$(datadir)/$(APP)/tunconfig
107 cebix 1.1
108     installdirs:
109 gbeauche 1.11 $(SHELL) mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(man1dir) $(DESTDIR)$(datadir)/$(APP)
110 cebix 1.1
111     uninstall:
112 gbeauche 1.20 rm -f $(DESTDIR)$(bindir)/$(APP_EXE)
113 gbeauche 1.11 rm -f $(DESTDIR)$(man1dir)/$(APP).1
114     rm -f $(DESTDIR)$(datadir)/$(APP)/keycodes
115     rm -f $(DESTDIR)$(datadir)/$(APP)/tunconfig
116     rmdir $(DESTDIR)$(datadir)/$(APP)
117 cebix 1.1
118     clean:
119 gbeauche 1.20 rm -f $(APP_EXE) $(OBJ_DIR)/* core* *.core *~ *.bak ppc-execute-impl.cpp
120 gbeauche 1.7 rm -f dyngen basic-dyngen-ops.hpp ppc-dyngen-ops.hpp
121 gbeauche 1.17 rm -rf $(APP_APP)
122 cebix 1.1
123     distclean: clean
124     rm -rf $(OBJ_DIR)
125     rm -f Makefile
126     rm -f config.cache config.log config.status config.h
127 gbeauche 1.17 rm -f ../MacOSX/Info.plist
128 cebix 1.1
129     depend dep:
130     makedepend $(CPPFLAGS) -Y. $(SRCS) 2>/dev/null
131    
132     $(OBJ_DIR)/%.o : %.c
133     $(CC) $(CPPFLAGS) $(DEFS) $(CFLAGS) -c $< -o $@
134     $(OBJ_DIR)/%.o : %.cpp
135     $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
136 gbeauche 1.18 $(OBJ_DIR)/%.o : %.mm
137     $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@
138 cebix 1.1 $(OBJ_DIR)/%.o : %.S
139     $(CPP) $(CPPFLAGS) -D__ASSEMBLY__ $< -o $*.s
140     $(AS) $(ASFLAGS) -o $@ $*.s
141     rm $*.s
142 gbeauche 1.5
143     # Kheperix CPU emulator
144 gbeauche 1.19 kpxsrcdir = ../kpx_cpu/src
145     GENEXEC = $(kpxsrcdir)/cpu/ppc/genexec.pl
146 gbeauche 1.20 DYNGEN = dyngen$(EXEEXT)
147 gbeauche 1.5
148 gbeauche 1.27 ifeq ($(USE_DYNGEN),yes)
149 gbeauche 1.20 DYNGENDEPS = basic-dyngen-ops.hpp ppc-dyngen-ops.hpp
150    
151     $(DYNGEN): $(DYNGENOBJS)
152 gbeauche 1.7 $(CXX) -o $@ $(LDFLAGS) $(DYNGENOBJS)
153    
154     $(OBJ_DIR)/basic-dyngen.o: basic-dyngen-ops.hpp
155 gbeauche 1.19 $(OBJ_DIR)/basic-dyngen-ops.o: $(kpxsrcdir)/cpu/jit/basic-dyngen-ops.cpp
156 gbeauche 1.10 $(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@
157 gbeauche 1.20 basic-dyngen-ops.hpp: $(OBJ_DIR)/basic-dyngen-ops.o $(DYNGEN)
158     ./$(DYNGEN) -o $@ $<
159 gbeauche 1.7
160     $(OBJ_DIR)/ppc-dyngen.o: ppc-dyngen-ops.hpp
161 gbeauche 1.19 $(OBJ_DIR)/ppc-dyngen-ops.o: $(kpxsrcdir)/cpu/ppc/ppc-dyngen-ops.cpp basic-dyngen-ops.hpp
162 gbeauche 1.10 $(DYNGEN_CC) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) $(DYNGEN_OP_FLAGS) -c $< -o $@
163 gbeauche 1.20 ppc-dyngen-ops.hpp: $(OBJ_DIR)/ppc-dyngen-ops.o $(DYNGEN)
164     ./$(DYNGEN) -o $@ $<
165 cebix 1.1
166 gbeauche 1.19 $(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
167 gbeauche 1.20 endif
168 gbeauche 1.19
169 gbeauche 1.22 $(OBJ_DIR)/ppc-execute.o: ppc-execute-impl.cpp
170     ppc-execute-impl.cpp: $(kpxsrcdir)/cpu/ppc/ppc-decode.cpp $(GENEXEC) $(DYNGENDEPS)
171     $(CPP) $(CPPFLAGS) -DGENEXEC $< | $(GENEXEC) > $@
172    
173 gbeauche 1.23 # PowerPC CPU tester
174 gbeauche 1.24 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
175 gbeauche 1.27 ifeq ($(USE_DYNGEN),yes)
176 gbeauche 1.25 TESTSRCS_ += cpu/jit/jit-cache.cpp cpu/jit/basic-dyngen.cpp cpu/ppc/ppc-dyngen.cpp
177 gbeauche 1.24 endif
178 gbeauche 1.23 TESTSRCS = $(TESTSRCS_:%.cpp=$(kpxsrcdir)/%.cpp)
179    
180     define TESTSRCS_LIST_TO_OBJS
181     $(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(TESTSRCS), \
182     $(basename $(notdir $(file))))))
183     endef
184     TESTOBJS = $(TESTSRCS_LIST_TO_OBJS)
185    
186     $(OBJ_DIR)/test-powerpc.o: $(kpxsrcdir)/test/test-powerpc.cpp
187     $(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -DEMU_KHEPERIX -c $< -o $@
188    
189     test-powerpc$(EXEEXT): $(TESTOBJS)
190     $(CXX) -o $@ $(LDFLAGS) $(TESTOBJS) $(LIBS)
191    
192 cebix 1.1 #-------------------------------------------------------------------------
193     # DO NOT DELETE THIS LINE -- make depend depends on it.