-
Notifications
You must be signed in to change notification settings - Fork 7
/
release.make
136 lines (95 loc) · 2.99 KB
/
release.make
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
export
BINDIR = release
ZIPDIR = zipdir
ifneq ($(words $(BINDIR)), 1)
$(error BINDIR must not contain spaces in the name)
endif
ifneq ($(words $(ZIPDIR)), 1)
$(error ZIPDIR must not contain spaces in the name)
endif
FPBIN = $(BINDIR)/sdcard/fpbin
APPS = fpdoom fpduke3d fpsw fpblood infones \
wolf3d wolf3d_sw snes9x snes9x_16bit
BINS = \
$(patsubst %,$(BINDIR)/usb/%.bin,fptest $(APPS)) \
$(patsubst %,$(FPBIN)/%.bin,fpmain $(APPS)) \
$(patsubst %,$(BINDIR)/sdboot%.bin,1 2 3) \
$(BINDIR)/jump4m.bin \
$(FPBIN)/config.txt
.PHONY: all clean
all: $(BINS)
clean:
$(RM) $(BINS)
define getsrc
test -d $@ || ( mkdir -p $(ZIPDIR); cd $(1) && $(MAKE) -f helper.make ZIPDIR="../$(ZIPDIR)" all patch )
endef
doom_src:
$(call getsrc,fpdoom)
fpbuild/jfbuild:
$(call getsrc,fpbuild)
infones/InfoNES:
$(call getsrc,infones)
wolf3d/Wolf4SDL:
$(call getsrc,wolf3d)
snes9x/snes9x_src:
$(call getsrc,snes9x)
define makebin
cd $(1) && $(MAKE) clean $(2)
cd $(1) && $(MAKE) all $(2)
mkdir -p $(dir $@)
mv $(1)/$(notdir $@) $@
cd $(1) && $(MAKE) clean $(2)
endef
# USB mode
$(BINDIR)/usb/fptest.bin:
$(call makebin,fptest,LIBC_SDIO=0)
$(BINDIR)/usb/fpdoom.bin: doom_src
$(call makebin,fpdoom,LIBC_SDIO=0)
$(BINDIR)/usb/fpduke3d.bin: fpbuild/jfbuild
$(call makebin,fpbuild,LIBC_SDIO=0 GAME=duke3d)
$(BINDIR)/usb/fpsw.bin: fpbuild/jfbuild
$(call makebin,fpbuild,LIBC_SDIO=0 GAME=sw)
$(BINDIR)/usb/fpblood.bin: fpbuild/jfbuild
$(call makebin,fpbuild,LIBC_SDIO=0 GAME=blood)
$(BINDIR)/usb/infones.bin: infones/InfoNES
$(call makebin,infones,LIBC_SDIO=0)
$(BINDIR)/usb/wolf3d.bin: wolf3d/Wolf4SDL
$(call makebin,wolf3d,LIBC_SDIO=0)
$(BINDIR)/usb/wolf3d_sw.bin: wolf3d/Wolf4SDL
$(call makebin,wolf3d,LIBC_SDIO=0 NAME=wolf3d_sw)
$(BINDIR)/usb/snes9x.bin: snes9x/snes9x_src
$(call makebin,snes9x,LIBC_SDIO=0)
$(BINDIR)/usb/snes9x_16bit.bin: snes9x/snes9x_src
$(call makebin,snes9x,LIBC_SDIO=0 NAME=snes9x_16bit)
# SD card mode
$(BINDIR)/sdboot1.bin:
$(call makebin,sdboot,CHIP=1)
$(BINDIR)/sdboot2.bin:
$(call makebin,sdboot,CHIP=2)
$(BINDIR)/sdboot3.bin:
$(call makebin,sdboot,CHIP=3)
$(BINDIR)/jump4m.bin:
$(call makebin,sdboot,NAME=jump4m)
$(FPBIN)/fpmain.bin:
$(call makebin,fpmenu,LIBC_SDIO=3 NAME=fpmain)
$(FPBIN)/config.txt:
mkdir -p $(dir $@)
cp fpmenu/$(notdir $@) $@
$(FPBIN)/fpdoom.bin: doom_src
$(call makebin,fpdoom,LIBC_SDIO=3)
$(FPBIN)/fpduke3d.bin: fpbuild/jfbuild
$(call makebin,fpbuild,LIBC_SDIO=3 GAME=duke3d)
$(FPBIN)/fpsw.bin: fpbuild/jfbuild
$(call makebin,fpbuild,LIBC_SDIO=3 GAME=sw)
$(FPBIN)/fpblood.bin: fpbuild/jfbuild
$(call makebin,fpbuild,LIBC_SDIO=3 GAME=blood)
$(FPBIN)/infones.bin: infones/InfoNES
$(call makebin,infones,LIBC_SDIO=3)
$(FPBIN)/wolf3d.bin: wolf3d/Wolf4SDL
$(call makebin,wolf3d,LIBC_SDIO=3)
$(FPBIN)/wolf3d_sw.bin: wolf3d/Wolf4SDL
$(call makebin,wolf3d,LIBC_SDIO=3 NAME=wolf3d_sw)
$(FPBIN)/snes9x.bin: snes9x/snes9x_src
$(call makebin,snes9x,LIBC_SDIO=3)
$(FPBIN)/snes9x_16bit.bin: snes9x/snes9x_src
$(call makebin,snes9x,LIBC_SDIO=3 NAME=snes9x_16bit)