Makefile

changeset 69
ff56b28e2cdd
parent 67
5da2cb5aea6b
child 72
b533da8e7411
equal deleted inserted replaced
68:4d1ce98e09cc 69:ff56b28e2cdd
35 SRC += c2html.c 35 SRC += c2html.c
36 SRC += highlighter.c 36 SRC += highlighter.c
37 37
38 OBJ = $(SRC:%.c=build/%$(OBJ_EXT)) 38 OBJ = $(SRC:%.c=build/%$(OBJ_EXT))
39 39
40 all: build build/$(BIN) 40 all: build build/c2html
41 41
42 build/$(BIN): $(OBJ) 42 build/c2html: $(OBJ)
43 $(LD) -o $@ $^ $(LDFLAGS) 43 $(LD) -o $@ $^ $(LDFLAGS)
44 44
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: all
52 ./build/$(BIN) test/ctest.c -o build/ctest.html \ 52 cd test && $(MAKE)
53 -H test/header.html -F test/footer.html
54 ./build/$(BIN) -j test/javatest.java -o build/javatest.html \
55 -H test/jheader.html -F test/footer.html
56 ./build/$(BIN) test/bigtest.c -o build/bigtest.html \
57 -H test/header.html -F test/footer.html
58 ./build/$(BIN) -p test/plain.txt -o build/plain.html \
59 -H test/header.html -F test/footer.html
60 diff build/ctest.html test/gs/ctest.html && \
61 diff build/javatest.html test/gs/javatest.html && \
62 diff build/bigtest.html test/gs/bigtest.html && \
63 diff build/plain.html test/gs/plain.html
64 @echo "Tests successful."
65 53
66 clean: 54 clean:
67 $(RM) $(RMFLAGS) build 55 $(RM) $(RMFLAGS) build

mercurial