-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.pc
61 lines (43 loc) · 1.12 KB
/
Makefile.pc
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
src = $(wildcard src/*.c) $(wildcard src/pc/*.c)
ssrc = $(wildcard src/*.s) data/lut.s
obj = $(src:.c=.o) $(ssrc:.s=.o)
dep = $(src:.c=.d)
bin = gbajam22
opt = -O0 -fno-strict-aliasing -fcommon
dbg = -g
inc = -I. -Isrc -Isrc/gba
warn = -pedantic -Wall
CFLAGS = $(opt) $(dbg) $(warn) -MMD $(def) $(inc)
LDFLAGS = $(libs) -lm
-include cfg.mk
sys = $(shell uname -s | sed 's/MINGW.*/mingw/')
ifeq ($(sys), mingw)
libs = -lopengl32 -lwinmm
else
libs = -lGL -lX11 -lXext
endif
$(bin): $(obj)
$(CC) -o $@ $(obj) $(LDFLAGS)
-include $(dep)
src/data.o: src/data.s $(data)
tools/pngdump/pngdump:
$(MAKE) -C tools/pngdump
tools/lutgen: tools/lutgen.c
$(CC) -o $@ $< -lm
tools/vistab: tools/vistab.c
$(CC) -o $@ $< -lm
%.sraw: %.png tools/pngdump/pngdump
tools/pngdump/pngdump -o $@ -oc $(subst .sraw,.spal,$@) -os $(subst .sraw,.shade,$@) -s 8 $<
%.raw: %.png tools/pngdump/pngdump
tools/pngdump/pngdump -o $@ -n $<
%.pal: %.png tools/pngdump/pngdump
tools/pngdump/pngdump -o $@ -c $<
data/lut.s: tools/lutgen
tools/lutgen >$@
.PHONY: clean
clean:
rm -f $(obj) $(bin)
.PHONY: cleandep
cleandep:
rm -f $(dep)
# vi:ft=make: