Makefile

changeset 65
7dd4fd1e7071
parent 64
60decfc9ad13
child 67
5da2cb5aea6b
equal deleted inserted replaced
64:60decfc9ad13 65:7dd4fd1e7071
45 build/%$(OBJ_EXT): src/%.c 45 build/%$(OBJ_EXT): src/%.c
46 $(CC) -o $@ $(CFLAGS) -c $< 46 $(CC) -o $@ $(CFLAGS) -c $<
47 47
48 build: 48 build:
49 $(MKDIR) $@ 49 $(MKDIR) $@
50 50
51 test: all 51 test-c: all
52 ./build/$(BIN) test/ctestfile.c -o build/ctest.html \ 52 for f in ctest bigtest empty ; do \
53 -H test/header.html -F test/footer.html 53 echo "test/$$f.c" ; \
54 ./build/$(BIN) -j test/javatestfile.java -o build/javatest.html \ 54 ./build/$(BIN) -o "build/$$f.html" \
55 -H test/jheader.html -F test/footer.html 55 -H test/header.html \
56 ./build/$(BIN) test/bigtestfile.c -o build/bigtest.html \ 56 -F test/footer.html \
57 -H test/header.html -F test/footer.html 57 "test/$$f.c" && \
58 ./build/$(BIN) -p test/plain.csp -o build/plain.html \ 58 diff "build/$$f.html" "test/golden-master/$$f.html" ; \
59 -H test/header.html -F test/footer.html 59 done
60 ./build/$(BIN) -p test/emptyfile.c -o build/emptyfile.html \ 60
61 -H test/header.html -F test/footer.html 61 test-java: all
62 diff build/ctest.html test/golden-master/ctest.html && \ 62 for f in javatest ; do \
63 diff build/javatest.html test/golden-master/javatest.html && \ 63 ./build/$(BIN) -j -o "build/$$f.html" \
64 diff build/bigtest.html test/golden-master/bigtest.html && \ 64 -H test/jheader.html \
65 diff build/plain.html test/golden-master/plain.html && \ 65 -F test/footer.html \
66 diff build/emptyfile.html test/golden-master/emptyfile.html 66 "test/$$f.java" && \
67 diff "build/$$f.html" "test/golden-master/$$f.html" ; \
68 done
69
70 test-plain: all
71 for f in plain ; do \
72 ./build/$(BIN) -p -o "build/$$f.html" \
73 -H test/header.html \
74 -F test/footer.html \
75 "test/$$f.txt" && \
76 diff "build/$$f.html" "test/golden-master/$$f.html" ; \
77 done
78
79 test: test-c test-java test-plain
80 @echo "Tests successful."
67 81
68 clean: 82 clean:
69 $(RM) $(RMFLAGS) build 83 $(RM) $(RMFLAGS) build

mercurial