-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
57 lines (40 loc) · 1.35 KB
/
Copy pathMakefile
File metadata and controls
57 lines (40 loc) · 1.35 KB
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
-include config.mak
FIRM_CFLAGS ?= $(shell pkg-config --cflags libfirm)
FIRM_LIBS ?= $(shell pkg-config --libs libfirm)
YCOMP ?= ycomp
CFLAGS = -Wall -W -std=c99 $(FIRM_CFLAGS) -O0 -g3
LFLAGS = $(FIRM_LIBS)
TANGLEFLAGS = -t8
BUILDDIR = build
TANGLED_FILES = io.simple example.simple libruntime.c answer.simple
SIMPLE_FILES = io.simple example.simple answer.simple
.PHONY: all documentation clean runtests
all: documentation tutorial libruntime.o $(TANGLED_FILES) runtests
documentation: $(BUILDDIR)/tutorial.html
runtests: runtests.sh libruntime.o tutorial $(SIMPLE_FILES)
./runtests.sh
$(TANGLED_FILES): tutorial.nw
notangle $(TANGLEFLAGS) -R$@ $< > $@
index.rst: tutorial.nw 2rst.py
mkdir -p $(BUILDDIR)
/usr/lib/noweb/markup -t < $< | python 2rst.py > $@
$(BUILDDIR)/tutorial.html: tutorial.c index.rst conf.py
sphinx-build -b html . $(BUILDDIR)
tutorial.c: tutorial.nw
notangle $(TANGLEFLAGS) $< > $@
debug: tutorial.c
$(CC) -g3 $< $(LFLAGS) $(LFLAGS) -o $@
tutorial: tutorial.c
$(CC) $< $(CFLAGS) $(LFLAGS) -o $@
libruntime.o: libruntime.c
$(CC) $(CFLAGS) -c $<
$(BUILDDIR)/plus.vcg: plus.simple tutorial
./tutorial -d $< > /dev/null
mv plus-00.vcg $@
plus.svg: $(BUILDDIR)/plus.vcg
$(YCOMP) $< --export $@
clean:
rm -f tutorial debug libsimple.o
rm -f tutorial.c $(TANGLED_FILES)
rm -f tutorial.tex tutorial.pdf tutorial.aux tutorial.log
rm -f *.s