-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
120 lines (91 loc) · 4.44 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
all: roms
SRC = \
src/bio_sensor.c \
src/joybus_n64_accessory.c \
src/joypad_accessory.c \
src/joypad.c \
OBJS = $(SRC:%.c=$(BUILD_DIR)/%.o)
DEPS = $(SRC:%.c=$(BUILD_DIR)/%.d)
BUILD_DIR = build
include $(N64_INST)/include/n64.mk
N64_CFLAGS += -I./include
# Test ROM versions (bump when distributing)
ACCESSORY_PROBE_TEST_VERSION = v5
BIO_SENSOR_TEST_VERSION = v4
CONTROLLER_PAK_DUMP_VERSION = v2
GB_CAMERA_TEST_VERSION = v1
RUMBLE_SHORT_TEST_VERSION = v1
SNAP_STATION_TEST_VERSION = v4
TRANSFER_PAK_TEST_VERSION = v2
# Test ROMs
roms: \
AccessoryProbeTest.z64 \
RumbleShortTest.z64 \
AccessoryTest.z64 \
BioSensorTest.z64 \
ControllerPakDump.z64 \
GBCameraTest.z64 \
JoypadTest.z64 \
SnapStationTest.z64 \
TransferPakTest.z64 \
AccessoryProbeTest.z64: N64_ROM_TITLE = AccessoryProbeTest
AccessoryProbeTest.z64: N64_CFLAGS += -DROM_VERSION='"$(ACCESSORY_PROBE_TEST_VERSION)"'
$(BUILD_DIR)/AccessoryProbeTest.elf: $(OBJS) $(BUILD_DIR)/examples/AccessoryProbeTest.o
AccessoryTest.z64: N64_ROM_TITLE = AccessoryTest
$(BUILD_DIR)/AccessoryTest.elf: $(OBJS) $(BUILD_DIR)/examples/AccessoryTest.o
BioSensorTest.z64: N64_ROM_TITLE = BioSensorTest
BioSensorTest.z64: N64_CFLAGS += -DROM_VERSION='"$(BIO_SENSOR_TEST_VERSION)"'
$(BUILD_DIR)/BioSensorTest.elf: $(OBJS) $(BUILD_DIR)/examples/BioSensorTest.o
ControllerPakDump.z64: N64_ROM_TITLE = ControllerPakDump
ControllerPakDump.z64: N64_ROM_SAVETYPE = sram256k
ControllerPakDump.z64: N64_CFLAGS += -DROM_VERSION='"$(CONTROLLER_PAK_DUMP_VERSION)"'
$(BUILD_DIR)/ControllerPakDump.elf: $(OBJS) $(BUILD_DIR)/examples/ControllerPakDump.o
GBCameraTest.z64: N64_ROM_TITLE = GBCameraTest
GBCameraTest.z64: N64_CFLAGS += -DROM_VERSION='"$(GB_CAMERA_TEST_VERSION)"'
$(BUILD_DIR)/GBCameraTest.elf: $(OBJS) $(BUILD_DIR)/examples/GBCameraTest.o
JoypadTest.z64: N64_ROM_TITLE = JoypadTest
$(BUILD_DIR)/JoypadTest.elf: $(OBJS) $(BUILD_DIR)/examples/JoypadTest.o
RumbleShortTest.z64: N64_ROM_TITLE = RumbleShortTest
RumbleShortTest.z64: N64_CFLAGS += -DROM_VERSION='"$(RUMBLE_SHORT_TEST_VERSION)"'
$(BUILD_DIR)/RumbleShortTest.elf: $(OBJS) $(BUILD_DIR)/examples/RumbleShortTest.o
SnapStationTest.z64: N64_ROM_TITLE = SnapStationTest
SnapStationTest.z64: N64_CFLAGS += -DROM_VERSION='"$(SNAP_STATION_TEST_VERSION)"'
$(BUILD_DIR)/SnapStationTest.elf: $(OBJS) $(BUILD_DIR)/examples/SnapStationTest.o
TransferPakTest.z64: N64_ROM_TITLE = TransferPakTest
TransferPakTest.z64: N64_CFLAGS += -DROM_VERSION='"$(TRANSFER_PAK_TEST_VERSION)"'
$(BUILD_DIR)/TransferPakTest.elf: $(OBJS) $(BUILD_DIR)/examples/TransferPakTest.o
# Archives
archives: \
AccessoryProbeTest-$(ACCESSORY_PROBE_TEST_VERSION).zip \
BioSensorTest-$(BIO_SENSOR_TEST_VERSION).zip \
ControllerPakDump-$(CONTROLLER_PAK_DUMP_VERSION).zip \
GBCameraTest-$(GB_CAMERA_TEST_VERSION).zip \
RumbleShortTest-$(RUMBLE_SHORT_TEST_VERSION).zip \
SnapStationTest-$(SNAP_STATION_TEST_VERSION).zip \
TransferPakTest-$(TRANSFER_PAK_TEST_VERSION).zip \
AccessoryProbeTest-$(ACCESSORY_PROBE_TEST_VERSION).zip: AccessoryProbeTest.z64
cp $^ $(^:%.z64=%-$(ACCESSORY_PROBE_TEST_VERSION).z64)
zip -m $@ $(^:%.z64=%-$(ACCESSORY_PROBE_TEST_VERSION).z64)
BioSensorTest-$(BIO_SENSOR_TEST_VERSION).zip: BioSensorTest.z64
cp $^ $(^:%.z64=%-$(BIO_SENSOR_TEST_VERSION).z64)
zip -m $@ $(^:%.z64=%-$(BIO_SENSOR_TEST_VERSION).z64)
ControllerPakDump-$(CONTROLLER_PAK_DUMP_VERSION).zip: ControllerPakDump.z64
cp $^ $(^:%.z64=%-$(CONTROLLER_PAK_DUMP_VERSION).z64)
zip -m $@ $(^:%.z64=%-$(CONTROLLER_PAK_DUMP_VERSION).z64)
GBCameraTest-$(GB_CAMERA_TEST_VERSION).zip: GBCameraTest.z64
cp $^ $(^:%.z64=%-$(GB_CAMERA_TEST_VERSION).z64)
zip -m $@ $(^:%.z64=%-$(GB_CAMERA_TEST_VERSION).z64)
RumbleShortTest-$(RUMBLE_SHORT_TEST_VERSION).zip: RumbleShortTest.z64
cp $^ $(^:%.z64=%-$(RUMBLE_SHORT_TEST_VERSION).z64)
zip -m $@ $(^:%.z64=%-$(RUMBLE_SHORT_TEST_VERSION).z64)
SnapStationTest-$(SNAP_STATION_TEST_VERSION).zip: SnapStationTest.z64
cp $^ $(^:%.z64=%-$(SNAP_STATION_TEST_VERSION).z64)
zip -m $@ $(^:%.z64=%-$(SNAP_STATION_TEST_VERSION).z64)
TransferPakTest-$(TRANSFER_PAK_TEST_VERSION).zip: TransferPakTest.z64
cp $^ $(^:%.z64=%-$(TRANSFER_PAK_TEST_VERSION).z64)
zip -m $@ $(^:%.z64=%-$(TRANSFER_PAK_TEST_VERSION).z64)
# Housekeeping
clean:
rm -rf $(BUILD_DIR) *.z64 *.zip
-include $(DEPS)
.PHONY: all archives clean roms