1 |
# AmigaOS makefile for Basilisk II (GeekGadgets) |
2 |
|
3 |
## System specific configuration |
4 |
CC = gcc |
5 |
CXX = c++ |
6 |
CXXFLAGS = -g -O1 -noixemul -m68020 -msmall-code -Wno-multichar |
7 |
CPPFLAGS = -I../include -I. |
8 |
DEFS = |
9 |
LDFLAGS = -noixemul |
10 |
LIBS = /gg/lib/libnix/swapstack.o |
11 |
AS = PhxAss |
12 |
ASFLAGS = OPT ! INCPATH GG:os-include MACHINE=68020 FPU=1 |
13 |
|
14 |
## Files |
15 |
SRCS = ../main.cpp main_amiga.cpp ../prefs.cpp prefs_amiga.cpp prefs_editor_amiga.cpp \ |
16 |
sys_amiga.cpp ../rom_patches.cpp ../slot_rom.cpp ../rsrc_patches.cpp \ |
17 |
../emul_op.cpp ../macos_util.cpp ../xpram.cpp xpram_amiga.cpp \ |
18 |
../timer.cpp timer_amiga.cpp clip_amiga.cpp ../adb.cpp ../serial.cpp \ |
19 |
serial_amiga.cpp ../ether.cpp ether_amiga.cpp ../sony.cpp ../disk.cpp \ |
20 |
../cdrom.cpp ../scsi.cpp scsi_amiga.cpp ../video.cpp video_amiga.cpp \ |
21 |
../audio.cpp audio_amiga.cpp ../user_strings.cpp user_strings_amiga.cpp \ |
22 |
asm_support.asm |
23 |
APP = BasiliskII |
24 |
|
25 |
## Rules |
26 |
.PHONY: clean distclean |
27 |
.SUFFIXES: |
28 |
.SUFFIXES: .c .cpp .asm .o .h |
29 |
|
30 |
all: $(APP) |
31 |
|
32 |
OBJ_DIR = obj |
33 |
$(OBJ_DIR):: |
34 |
@[ -d $(OBJ_DIR) ] || mkdir $(OBJ_DIR) > /dev/null 2>&1 |
35 |
|
36 |
define SRCS_LIST_TO_OBJS |
37 |
$(addprefix $(OBJ_DIR)/, $(addsuffix .o, $(foreach file, $(SRCS), \ |
38 |
$(basename $(notdir $(file)))))) |
39 |
endef |
40 |
OBJS = $(SRCS_LIST_TO_OBJS) |
41 |
|
42 |
SRC_PATHS += $(sort $(foreach file, $(SRCS), $(dir $(file)))) |
43 |
VPATH := |
44 |
VPATH += $(addprefix :, $(subst ,:, $(filter-out $($(subst, :, ,$(VPATH))), $(SRC_PATHS)))) |
45 |
|
46 |
$(APP): $(OBJ_DIR) $(OBJS) |
47 |
$(CXX) -o $(APP) $(LDFLAGS) $(LIBS) $(OBJS) |
48 |
|
49 |
clean: |
50 |
rm -f $(APP) $(OBJ_DIR)/* *~ *.bak obj.0000.* |
51 |
|
52 |
distclean: clean |
53 |
rm -rf $(OBJ_DIR) |
54 |
|
55 |
$(OBJ_DIR)/%.o : %.cpp |
56 |
$(CXX) $(CPPFLAGS) $(DEFS) $(CXXFLAGS) -c $< -o $@ |
57 |
$(OBJ_DIR)/%.o : %.asm |
58 |
$(AS) $(ASFLAGS) $< TO $(OBJ_DIR)/$*.obj |
59 |
hunk2aout $(OBJ_DIR)/$*.obj >/dev/null |
60 |
mv obj.0000.* $@ |
61 |
|
62 |
#------------------------------------------------------------------------- |
63 |
# DO NOT DELETE THIS LINE -- make depend depends on it. |