-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
65 lines (44 loc) · 1.36 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
PACKAGE := scc
VERSION := 0.1
objects := nodes.o pass.o machine.o liveness.o utils.o tree.o arch.o
objects_x86_64 = arch/x86-64/arch-x86-64.o arch/x86-64/spec-x86-64.o arch/x86-64/rules-x86-64.o
tests_bin = tests/test-fast-match
all: scc tests
scc: main.o $(objects) $(objects_x86_64)
csc -o $@ $^
# extra dependencies
nodes.o: struct-syntax.scm
main.o: struct-syntax.scm
pass.o: struct-syntax.scm
tree.o: struct-syntax.scm
arch/x86-64/arch-x86-64.o: arch-syntax.scm
arch/x86-64/spec-x86-64.o: arch-syntax.scm
arch/x86-64/rules-x86-64.o: arch-syntax.scm munch-syntax.scm
arch.o: nodes.scm
tests/test-spill.o: arch-syntax.scm
# default rule
%.o: %.scm
csc -c $<
tests: tests/test-spill
tests/test-fast-match: tests/test-fast-match.scm fast-match-syntax.scm
csc -o $@ $<
tests/test-spill: tests/test-spill.o $(objects) $(objects_x86_64)
csc -o $@ $^
asm-test: asm-test.o asm-test.c
gcc -o asm-test -o $@ $^
asm-test.o: asm-test.nasm
nasm -f elf64 -g -o $@ $^
dist: tarball
dist-prep:
rm -rf $(PACKAGE)-$(VERSION)
mkdir $(PACKAGE)-$(VERSION)
cp -a *.scm Makefile README docs tests $(PACKAGE)-$(VERSION)
tarball: dist-prep
tar -czf $(PACKAGE)-$(VERSION).tar.gz $(PACKAGE)-$(VERSION)
rm -rf $(PACKAGE)-$(VERSION)
tags:
etags *.scm
.PHONY : clean
clean:
rm -rf $(PACKAGE)-$(VERSION) $(PACKAGE)-$(VERSION).tar.gz
rm -rf $(objects) $(objects_x86_64) scc