Mirai's Miscellaneous Misadventures

M53 / makefile

1# license: AGPLv3 or later
2# copyright 2024 zamfofex
3
4CFLAGS ?= -ansi -Wall -Wextra -Wpedantic -O3
5RM ?= rm -f
6
7obj = \
8	core/animations.o \
9	core/cameras.o \
10	core/controls.o \
11	core/dialogues.o \
12	core/displays.o \
13	core/effects.o \
14	core/font.o \
15	core/ground.o \
16	core/math.o \
17	core/motion.o \
18	core/packbits.o \
19	core/sprites.o \
20	core/stages.o \
21	core/text.o \
22	core/images.o \
23	models/homura.o \
24	models/mirai.o \
25	models/haruka.o \
26	models/hebijo.o \
27	models/ryoubi.o \
28	models/ryouna.o \
29	models/base.o \
30	chapter-I/main.o
31
32mimimi: $(obj) engines/sdl.o
33	$(CC) $(LDFLAGS) -o $@ $^ $> -lSDL2
34
35mimimi.wasm: $(obj) engines/wasm.o
36	$(CC) $(LDFLAGS) -Wl,--import-undefined -o mimimi0.wasm $^ $>
37	wasm-opt -O4 --asyncify -o $@ mimimi0.wasm
38
39$(obj): mimimi.h models/models.h
40chapter-I/main.o: chapter-I/ground.h chapter-I/background.h
41
42.c.o:
43	$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
44
45.PHONY: clean
46
47clean:
48	$(RM) mimimi */*.o *.wasm