-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile-48
93 lines (70 loc) · 2.33 KB
/
Makefile-48
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
################################################################################
##
## RAGE1 - Retro Adventure Game Engine, release 1
## (c) Copyright 2020 Jorge Gonzalez Villalonga <[email protected]>
##
## This code is ublished under a GNU GPL license version 3 or later. See
## LICENSE file in the distribution for details.
##
################################################################################
.SILENT:
MYMAKE = $(MAKE) -s -f Makefile-48
ZPRAGMA_INC = zpragma-48.inc
# All taps
TAPS = $(BAS_LOADER_TAP) $(LOADING_SCREEN_TAP) $(ASMLOADER_TAP) $(MAIN_TAP) $(SUB_TAPS)
-include Makefile.common
.PHONY: taps
# add SRC and OBJS for 48K build
SRC += $(BANKED_CODE_SRC_COMMON)
OBJS += $(BANKED_CODE_OBJS_COMMON)
build:
cp $(ENGINE_DIR)/loader48/$(BAS_LOADER_SRC) $(BAS_LOADER)
$(MYMAKE) -j8 main
$(MYMAKE) -j8 subs
$(MYMAKE) loader
$(MYMAKE) asmloader
$(MYMAKE) -j8 taps
$(MYMAKE) final
$(MYMAKE) section-check
## Taps
taps: $(TAPS)
##
## SUBs (Single Use Binaries) compilation to standalone binaries
##
subs: $(SUB_BINS)
sub_%.bin:
echo "Compiling SUB $@ ..."
mv $(GAME_SRC_DIR)/sub_$* $(GENERATED_DIR_SUBS)/sub_$*.src
$(MAKE) -s -C $(GENERATED_DIR_SUBS)/sub_$*.src
cp $(GENERATED_DIR_SUBS)/sub_$*.src/sub.bin $(GENERATED_DIR)/sub_$*.bin
# we set org at 0x0000 for the subs (unused)
sub_%.tap:
echo "Creating TAP $@..."
z88dk-appmake +zx --noloader --noheader --org 0x0000 -b $(GENERATED_DIR)/sub_$*.bin -o sub_$*.tap
##
## Custom ASM loader
##
# loader is loaded at 0x5E00 in 48 mode
loader:
echo "Creating custom loader..."
./tools/loadertool.pl -i $(GENERATED_DIR) -o $(GENERATED_DIR_ASMLOADER) $(LOADING_SCREEN_FLAG)
asmloader: $(ASMLOADER_BIN)
$(ASMLOADER_BIN):
echo "Assembling loader routine..."
$(ZCC) $(ZCC_TARGET) $(CFLAGS) $(CFLAGS_LIST) --list --no-crt $(ASMLOADER_SRC) -o $(ASMLOADER_BIN)
# we set org at 0x5E00 for loader
$(ASMLOADER_TAP): $(ASMLOADER_BIN)
echo "Creating TAP $@..."
z88dk-appmake +zx --noloader --org 0x5E00 -b $<
##
## Main binary
##
# we set org at 0x5F00 for 48 mode
$(MAIN_TAP): $(MAIN_BIN)
echo "Creating TAP $@..."
z88dk-appmake +zx --noloader --noheader --org 0x5F00 -b $<
$(MAIN_BIN): $(OBJS)
echo "Bulding $(MAIN_BIN)...."
$(ZCC) $(ZCC_TARGET) $(CFLAGS) $(CFLAGS_LIST) $(INCLUDE) $(LIBDIR) $(LIBS) $(OBJS) -startup=31 -o $(MAIN_BIN)
## Run options
FUSE_RUN_OPTS = --machine 48