1 | CC = g++
|
---|
2 |
|
---|
3 | CompileParms = -c -Wall -Wno-deprecated -g
|
---|
4 |
|
---|
5 | OBJS = showlist.o leestekst.o testtrie.o
|
---|
6 | BINARY = opdracht2a
|
---|
7 |
|
---|
8 | $(BINARY): $(OBJS)
|
---|
9 | $(CC) $(OBJS) -o $(BINARY)
|
---|
10 |
|
---|
11 | showlist.o: showlist.h showlist.cc
|
---|
12 | $(CC) $(CompileParms) showlist.cc
|
---|
13 |
|
---|
14 | leestekst.o: leestekst.h leestekst.cc
|
---|
15 | $(CC) $(CompileParms) leestekst.cc
|
---|
16 |
|
---|
17 | testtrie.o: general.h trie.h trie.cc showlist.h leestekst.h testtrie.cc
|
---|
18 | $(CC) $(CompileParms) testtrie.cc
|
---|
19 |
|
---|
20 | clean:
|
---|
21 | rm -f *.o $(BINARY)
|
---|
22 |
|
---|
23 | distclean: clean
|
---|
24 | rm -f *.uit
|
---|
25 |
|
---|
26 | debug: $(BINARY)
|
---|
27 | @sed 's/InterActief = 1/InterActief = 0/g' test.dat >test.dat.tmp
|
---|
28 | @mv test.dat.tmp test.dat
|
---|
29 | gdb -batch -x gdb.run ./$(BINARY)
|
---|
30 |
|
---|
31 | auto: $(BINARY)
|
---|
32 | @sed 's/InterActief = 1/InterActief = 0/g' test.dat >test.dat.tmp
|
---|
33 | @mv test.dat.tmp test.dat
|
---|
34 | sh -c "./$(BINARY) | grep -v '^ [2-8]' |\
|
---|
35 | sed 's/1. AtLeaf 9. PutInfo/--------------------/g' | cat -v"
|
---|
36 |
|
---|
37 | run: $(BINARY)
|
---|
38 | @sed 's/InterActief = 0/InterActief = 1/g' test.dat >test.dat.tmp
|
---|
39 | @mv test.dat.tmp test.dat
|
---|
40 | ./$(BINARY)
|
---|
41 |
|
---|
42 | test1: $(BINARY)
|
---|
43 | @echo "InterActief = 0" > test.dat
|
---|
44 | @echo "Invoer = test1.inv" >> test.dat
|
---|
45 | @echo "Controleren = 1" >> test.dat
|
---|
46 | @./$(BINARY) | tail -1 | grep -q "^GELIJK"
|
---|
47 |
|
---|
48 | test2: $(BINARY)
|
---|
49 | @echo "InterActief = 0" > test.dat
|
---|
50 | @echo "Invoer = test2.inv" >> test.dat
|
---|
51 | @echo "Controleren = 1" >> test.dat
|
---|
52 | @./$(BINARY) | tail -1 | grep -q "^GELIJK"
|
---|
53 |
|
---|
54 | test8: $(BINARY)
|
---|
55 | @echo "InterActief = 0" > test.dat
|
---|
56 | @echo "Invoer = test8.inv" >> test.dat
|
---|
57 | @echo "Controleren = 1" >> test.dat
|
---|
58 | @./$(BINARY) | tail -1 | grep -q "^GELIJK"
|
---|
59 |
|
---|
60 | test9: $(BINARY)
|
---|
61 | @echo "InterActief = 0" > test.dat
|
---|
62 | @echo "Invoer = test9.inv" >> test.dat
|
---|
63 | @echo "Controleren = 1" >> test.dat
|
---|
64 | @./$(BINARY) | tail -1 | grep -q "^GELIJK"
|
---|
65 |
|
---|
66 | test: $(BINARY)
|
---|
67 | make test1
|
---|
68 | make test2
|
---|