-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.mac6
128 lines (93 loc) · 3.31 KB
/
Makefile.mac6
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
# vi:syntax=make
ifneq ($(CALLER),MASTER)
include Makefile.inc
endif
ifneq ($(DEPTH),MONO)
$(error mac6 target must be built with MONO DEPTH)
endif
# 1. Directories
OBJDIR_MAC6 := $(OBJDIR)/mac6
DEPDIR_MAC6 := $(DEPDIR)/mac6
GENDIR_MAC6 := $(GENDIR)/mac6
RETRO68_PREFIX := /opt/Retro68-build/toolchain
# 2. Files
BIN_MAC6 := $(BINDIR)/$(DSEKAI).bin $(BINDIR)/$(DSEKAI).APPL $(BINDIR)/$(DSEKAI).dsk
DSEKAI_C_FILES_MAC6_ONLY := \
src/main.c \
src/scparse.c \
unilayer/src/input/mac6i.c \
unilayer/src/graphics/mac6g.c \
unilayer/src/memory/mac6m.c \
unilayer/src/save/file.c
# 1a. Packaging Manifest
DSEKAI_ASSETS_ICNS := \
$(subst .bmp,.icns,$(subst $(ASSETDIR)/,$(GENDIR_MAC6)/,$(DSEKAI_ASSETS_BITMAPS)))
DSEKAI_ASSETS_RSRC := \
$(subst .bmp,.rsrc,$(subst $(ASSETDIR)/,$(GENDIR_MAC6)/,$(DSEKAI_ASSETS_BITMAPS)))
DSEKAI_ASSETS_MAPS_MAC6 := \
$(subst .json,.h,$(subst $(ASSETDIR)/,$(GENDIR_MAC6)/,$(DSEKAI_ASSETS_MAPS_JSON)))
DSEKAI_O_FILES_MAC6 := \
$(addprefix $(OBJDIR_MAC6)/,$(subst .c,.o,$(DSEKAI_C_FILES))) \
$(addprefix $(OBJDIR_MAC6)/,$(subst .c,.o,$(DSEKAI_C_FILES_MAC6_ONLY))) \
$(addprefix $(OBJDIR_MAC6)/,$(subst .c,.o,$(DSEKAI_C_FILES_RES)))
RESEXT_H_MAC6 := $(GENDIR_MAC6)/resext.h
# 3. Programs
CC_MAC6 := m68k-apple-macos-gcc
CXX_MAC6 := m68k-apple-macos-g++
REZ_MAC6 := Rez
# 4. Arguments
DEFINES_MAC6 := \
$(DEFINES_DSEKAI) \
$(DEFINES_DEPTH) \
$(DEFINES_RESOURCE) \
-DPLATFORM_MAC6 \
-DNO_ENGINE_POV \
-DNO_ANIMATE \
-DNO_TRANSITIONS \
-DUSE_SOFTWARE_TEXT
INCLUDES_MAC6 := \
$(INCLUDES_UNILAYER) \
-I$(GENDIR_MAC6) \
-I$(RETRO68_PREFIX)/multiversal/CIncludes
#CFLAGS_MAC6 := $(shell echo $(CFLAGS_GCC_GENERIC) | sed -e 's/--std=c89//g') $(DEFINES_MAC6) $(INCLUDES_MAC6)
CFLAGS_MAC6 := $(DEFINES_MAC6) $(INCLUDES_MAC6) -Werror
ifneq ($(BUILD),RELEASE)
CFLAGS_MAC6 += -DLOG_TO_FILE
endif
LDFLAGS_MAC6 := -lRetroConsole $(LDFLAGS_GCC_GENERIC)
# 5. Targets
#$(BINDIR)/mac6.drc \
#$(GENDIR_MAC6)/resext.h: $(DSEKAI_ASSETS_PICTS) $(DRCPACK) | \
#$(GENDIR_MAC6)/$(STAMPFILE)
# $(DRCPACK) -c -a -af $(BINDIR)/mac6.drc -t PICT -i 5001 \
# -if $(DSEKAI_ASSETS_PICTS) $(DSEKAI_ASSETS_MAPS) \
# -lh $(GENDIR_MAC6)/resext.h
platform := mac6
platform_upper := MAC6
res_gfx := $(DSEKAI_ASSETS_BITMAPS)
$(eval $(RESEXT_H_RULE))
pkg_bin := $(BINDIR)/$(DSEKAI).APPL
pkg_strip := echo
pkg_name := $(DSEKAI)-$(platform)-$(GIT_HASH)
pkg_reqs :=
$(eval $(PKG_RULE))
#$(GENDIR_MAC6)/%.pict: $(ASSETDIR)/%.bmp | $(GENDIR_MAC6)/$(STAMPFILE)
# $(IMAGEMAGICK) $< $@
#$(GENDIR_MAC6)/%.rsrc: $(GENDIR_MAC6)/%.icns
# echo "read 'icns' (-16455) \"$<\";" > $@
$(GENDIR_MAC6)/%.icns: $(ASSETDIR)/%.bmp $(CONVERT) | $(GENDIR_MAC6)/$(STAMPFILE)
$(MD) $(dir $@)
$(CONVERT) -if $< -of $@ -ob 1 -r -ic bmp -oc icns
$(OBJDIR_MAC6)/$(DSEKAI).code.bin: $(DSEKAI_O_FILES_MAC6) | $(OBJDIR_MAC6)
$(CXX_MAC6) $(LDFLAGS_MAC6) -o $@ $^ # Use CXX to link for RetroConsole.
$(BIN_MAC6): $(OBJDIR_MAC6)/$(DSEKAI).code.bin $(BINDIR)/$(STAMPFILE)
$(REZ_MAC6) -I$(RETRO68_PREFIX)/RIncludes \
--copy $^ \
"$(RETRO68_PREFIX)/RIncludes/Retro68APPL.r" \
-t "APPL" -c "DSEK" \
-o $(BINDIR)/$(DSEKAI).bin \
--cc $(BINDIR)/$(DSEKAI).APPL \
--cc $(BINDIR)/$(DSEKAI).dsk
$(OBJDIR_MAC6)/%.o: %.c $(RESEXT_H_MAC6)
$(MD) $(dir $@)
$(CC_MAC6) $(CFLAGS_MAC6) -c -o $@ $(<:%.o=%)