2 # This file is part of mutest, a simple micro unit testing framework for C.
4 # mutest was written by Leandro Lucarella <llucax@gmail.com> and is released
5 # under the BOLA license, please see the LICENSE file or visit:
6 # http://blitiri.com.ar/p/bola/
8 # This is the main Makefile.
10 # Please, read the README file for more details.
14 MANUAL_HTML=manual.html
16 SAMPLES = sample/factorial.c sample/factorial_test.c sample/exception_test.cpp
17 MANUAL_GARBAGE = manual.aux manual.log manual.out
30 DOC_DIR = shared/doc/mutest
36 doc-html: $(MANUAL_HTML)
38 $(MANUAL_HTML): $(MANUAL_SRC) $(SAMPLES)
41 doc-pdf: $(MANUAL_PDF)
43 $(MANUAL_PDF): $(MANUAL_SRC)
47 $(INSTALL) -m 755 -d $(prefix)/$(DOC_DIR)
48 $(INSTALL) -m 644 $(MANUAL_SRC) $(prefix)/$(DOC_DIR)/$(MANUAL_SRC)
50 install-html: $(MANUAL_HTML)
51 $(INSTALL) -m 755 -d $(prefix)/$(DOC_DIR)
52 $(INSTALL) -m 644 $(MANUAL_HTML) $(prefix)/$(DOC_DIR)/$(MANUAL_HTML)
54 install-pdf: $(MANUAL_PDF)
55 $(INSTALL) -m 755 -d $(prefix)/$(DOC_DIR)
56 $(INSTALL) -m 644 $(MANUAL_PDF) $(prefix)/$(DOC_DIR)/$(MANUAL_PDF)
59 $(INSTALL) -m 755 -d $(prefix)/$(BIN_DIR)
60 $(INSTALL) -m 755 -d $(prefix)/$(INC_DIR)
61 $(INSTALL) -m 644 mutest.c $(prefix)/$(INC_DIR)/mutest.c
62 $(INSTALL) -m 644 mutest.h $(prefix)/$(INC_DIR)/mutest.h
63 $(INSTALL) -m 755 mkmutest $(prefix)/$(BIN_DIR)/mkmutest
66 $(INSTALL) -m 755 -d $(prefix)/$(BIN_DIR)
67 $(INSTALL) -m 755 -d $(prefix)/$(INC_DIR)
68 $(INSTALL) -m 644 mutest.h $(prefix)/$(INC_DIR)/mutest.h
69 $(INSTALL) -m 755 mutest $(prefix)/$(BIN_DIR)/mutest
71 install-doc: install-readme install-html install-pdf
73 install: install-c install-py install-doc
76 $(MAKE) -k -C sample test test-py
78 # You shouldn't use this target
79 ifeq ($(MAKECMDGOALS),release)
81 $(error You have to specify a VERSION when using the 'release' target)
85 $(RM) $(MANUAL_GARBAGE)
86 $(GIT) tag -f $(VERSION)
90 $(GIT) archive --format=tar --prefix=mutest-$(VERSION)/ $(VERSION) \
91 | gzip > releases/mutest-$(VERSION).tar.gz
92 $(CHMOD) 644 releases/mutest-$(VERSION).tar.gz
93 $(LN) -sf mutest-$(VERSION).tar.gz releases/mutest.tar.gz
94 $(INSTALL) -m 644 manual.html releases/manual-$(VERSION).html
95 $(LN) -sf manual-$(VERSION).html releases/manual.html
96 $(INSTALL) -m 644 manual.pdf releases/manual-$(VERSION).pdf
97 $(LN) -sf manual-$(VERSION).pdf releases/manual.pdf
100 $(RM) $(MANUAL_HTML) $(MANUAL_PDF) $(MANUAL_GARBAGE)
102 .PHONY: all doc doc-html doc-pdf \
103 install-readme install-html install-pdf install-doc \
104 install-c install-py install \