-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
136 lines (120 loc) · 3.23 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
CC=gcc
OPTIONS=
PLATFORM = sdl2
CPU=020
PROGRAM_DIR = ./install/
PROGRAM_NAME = cruise
PROGRAM = $(PROGRAM_DIR)$(PROGRAM_NAME)_$(PLATFORM)_$(CPU)
ICON= $(PROGRAM).info
CXXFLAGS := -w -I. -D__AMIGADATE__="\"$(DATESTR)\""
LDFLAGS :=
SDL2_RUN := (cd $(PROGRAM_DIR) && $(PROGRAM_NAME))
ifeq ($(PLATFORM), sdl2)
UNAME := 'unknown'
ifeq ($(OS),Windows_NT)
UNAME := 'win32'
else
UNAME := $(shell uname -p | tr A-Z a-z)_$(shell uname -s | tr A-Z a-z)
endif
include apk/sdl.makefile
PROGRAM := $(PROGRAM_DIR)$(PROGRAM_NAME)_$(UNAME)_sdl
OBJ := $(APK_OBJ)
CC := gcc
DELETE := rm -f
CXXFLAGS += -g -lSDL2 -I/opt/homebrew/include -L/opt/homebrew/lib -std=c++17 -fno-exceptions -fno-rtti -fno-threadsafe-statics
LDFLAGS :=
endif
AMIGA_CC := /opt/amiga/bin/m68k-amigaos-gcc
AMIGA_DELETE := rm -f
AMIGA_CXXFLAGS := -std=c++17 -m68$(CPU) -Wall -noixemul -fno-exceptions -fno-rtti -fno-threadsafe-statics
AMIGA_LDFLAGS := -fbbb=- -noixemul -noixemul -fno-exceptions -fno-rtti -fno-threadsafe-statics
AMIGA_RUN := fs-uae \
--model=A1200 \
--cpu=68030 \
--zorro_iii_memory=16384 \
--kickstart_file=./install/amigaos-3.2-a1200.rom \
--hard_drive_0=./install/amigaos-3.2-a1200.hdf \
--hard_drive_1=./install/ \
--hard_drive_1_label="Cruise" \
--hard_drive_2=./tests/amiga \
--hard_drive_2_label="Saves" \
--floppy_drive_volume=0 \
--floppy_drive_volume_empty=0 \
--smoothing=0 \
--graphics_card=uaegfx \
--fssa=0 \
--texture_filter=nearest \
--window_x=3001 \
--window_y=-200 \
--window_width=1400 \
--window_height=1024 \
--scale=2
ifeq ($(PLATFORM), rtg)
include apk/amiga.makefile
OBJ += $(APK_OBJ)
OBJ += apk/amiga/video_rtg.cpp
CC := $(AMIGA_CC)
DELETE := $(AMIGA_DELETE)
CXXFLAGS += $(AMIGA_CXXFLAGS)
LDFLAGS := $(AMIGA_LDFLAGS)
endif
ifeq ($(PLATFORM), aga)
include apk/amiga.makefile
OBJ += $(APK_OBJ)
OBJ += apk/amiga/video_aga.cpp
CC := $(AMIGA_CC)
DELETE := $(AMIGA_DELETE)
CXXFLAGS += $(AMIGA_CXXFLAGS)
LDFLAGS := $(AMIGA_LDFLAGS)
endif
OBJ += \
engine/engine.cpp \
cruise/actor.cpp \
cruise/background.cpp \
cruise/backgroundIncrust.cpp \
cruise/cell.cpp \
cruise/cruise.cpp \
cruise/cruise_main.cpp \
cruise/ctp.cpp \
cruise/dataLoader.cpp \
cruise/delphine-unpack.cpp \
cruise/font.cpp \
cruise/function.cpp \
cruise/gfxModule.cpp \
cruise/linker.cpp \
cruise/mainDraw.cpp \
cruise/menu.cpp \
cruise/mouse.cpp \
cruise/object.cpp \
cruise/overlay.cpp \
cruise/perso.cpp \
cruise/polys.cpp \
cruise/saveload.cpp \
cruise/script.cpp \
cruise/stack.cpp \
cruise/staticres.cpp \
cruise/various.cpp \
cruise/vars.cpp \
cruise/volume.cpp
all: $(PROGRAM)
$(PROGRAM): $(OBJ)
@$(DELETE) $(PROGRAM) || exit 1
@if $(CC) $(CXXFLAGS) $(OBJ) -o $(PROGRAM) $(LDFLAGS); then \
echo "Compiled to $(PROGRAM)"; \
cp -f apk/amiga/program.info $(ICON); \
else \
echo "Compilation failed."; \
fi
%.o: %.cpp
$(CC) $(CXX) -c $< -o $@
clean .IGNORE:
$(DELETE) *.o
$(DELETE) $(PROGRAM)
run:
@HUNK_COOKIE="000003F3"; \
if hexdump -n 4 -e '4/1 "%02X"' $(PROGRAM) | grep -q "$$HUNK_COOKIE"; then \
$(AMIGA_RUN); \
else \
$(SDL2_RUN); \
fi
.PHONY: $(PROGRAM) run run_amiga