-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
64 lines (49 loc) · 1.15 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
localversion = $(shell bash scripts/localversion.sh)
cflags = -Wall -Iinclude -Iinclude/asm/gameboy -DLOCALVERSION=\"$(localversion)\" -g
all:
rgbasm_obj := \
src/asm/alloca.o \
src/asm/asmy.o \
src/asm/fstack.o \
src/asm/globlex.o \
src/asm/lexer.o \
src/asm/main.o \
src/asm/math.o \
src/asm/output.o \
src/asm/rpn.o \
src/asm/symbol.o \
src/asm/gameboy/locallex.o
xlib_obj := \
src/lib/library.o \
src/lib/main.o
xlink_obj := \
src/link/assign.o \
src/link/library.o \
src/link/main.o \
src/link/mapfile.o \
src/link/object.o \
src/link/output.o \
src/link/patch.o \
src/link/symbol.o
rgbfix_obj := \
src/rgbfix/main.o
all: rgbasm xlib xlink rgbfix
clean:
rm -rf rgbasm $(rgbasm_obj)
rm -rf xlib $(xlib_obj)
rm -rf xlink $(xlink_obj)
rm -rf rgbfix $(rgbfix_obj)
rgbasm: $(rgbasm_obj)
gcc $(cflags) -o $@ $^ -lm
xlib: $(xlib_obj)
gcc $(cflags) -o $@ $^
xlink: $(xlink_obj)
gcc $(cflags) -o $@ $^
rgbfix: $(rgbfix_obj)
gcc $(cflags) -o $@ $^
.c.o:
gcc $(cflags) -DGAMEBOY -c -o $@ $<
.y.c:
bison -d -o $@ $^
src/asm/asmy.y: src/asm/yaccprt1.y src/asm/gameboy/yaccprt2.y src/asm/yaccprt3.y src/asm/gameboy/yaccprt4.y
cat $^ > $@