-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·55 lines (38 loc) · 1.42 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
# "make test" Compiles everything and runs the regression tests
.PHONY : test
test : all testall.sh
./testall.sh
# "make all" builds the executable as well as the "hello" library designed
# to test linking external code
.PHONY : all
all : textplusplus.native hello.o
# "make textplusplus.native" compiles the compiler
#
# The _tags file controls the operation of ocamlbuild, e.g., by including
# packages, enabling warnings
textplusplus.native :
opam config exec -- \
ocamlbuild -use-ocamlfind textplusplus.native
# "make clean" removes all generated files
.PHONY : clean
clean :
ocamlbuild -clean
rm -rf testall.log ocamlllvm *.diff test-*.exe test-*.ll test-*.out test-*.s text.pdf
# Testing the "hello" example
hello : hello.c
cc -o hello -DBUILD_TEST hello.c
# Building the tarball
TESTS = \
hello wrap left-wrap right-wrap center-wrap add-page get-cap-height get-low-height \
get-bytes left-margin right-margin top-margin bot-margin text-out regular italic bold \
draw-line rect page-number page-title heading for while
FAILS = \
TESTFILES = $(TESTS:%=test-%.tpp) $(TESTS:%=test-%.out) \
$(FAILS:%=fail-%.tpp) $(FAILS:%=fail-%.err)
TARFILES = ast.ml sast.ml codegen.ml Makefile _tags textplusplus.ml parser.mly \
README scanner.mll semant.ml testall.sh \
hello.c \
$(TESTFILES:%=tests/%)
textPlusPlus.tar.gz : $(TARFILES)
cd .. && tar czf textPlusPlus/textPlusPlus.tar.gz \
$(TARFILES:%=textPlusPlus/%)