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
15 MANUAL_LATEX=manual.latex
17 SAMPLES = sample/factorial.c sample/factorial_test.c sample/exception_test.cpp
18 MANUAL_GARBAGE = manual.aux manual.log manual.out
32 DOC_DIR = shared/doc/mutest
38 doc-html: $(MANUAL_HTML)
40 $(MANUAL_HTML): $(MANUAL_SRC) $(SAMPLES)
43 doc-latex: $(MANUAL_LATEX)
45 $(MANUAL_LATEX): $(MANUAL_SRC) $(SAMPLES)
48 doc-pdf: $(MANUAL_PDF)
50 $(MANUAL_PDF): $(MANUAL_LATEX)
55 $(INSTALL) -m 755 -d $(prefix)/$(DOC_DIR)
56 $(INSTALL) -m 644 $(MANUAL_SRC) $(prefix)/$(DOC_DIR)/$(MANUAL_SRC)
58 install-html: $(MANUAL_HTML)
59 $(INSTALL) -m 755 -d $(prefix)/$(DOC_DIR)
60 $(INSTALL) -m 644 $(MANUAL_HTML) $(prefix)/$(DOC_DIR)/$(MANUAL_HTML)
62 install-pdf: $(MANUAL_PDF)
63 $(INSTALL) -m 755 -d $(prefix)/$(DOC_DIR)
64 $(INSTALL) -m 644 $(MANUAL_PDF) $(prefix)/$(DOC_DIR)/$(MANUAL_PDF)
67 $(INSTALL) -m 755 -d $(prefix)/$(BIN_DIR)
68 $(INSTALL) -m 755 -d $(prefix)/$(INC_DIR)
69 $(INSTALL) -m 644 mutest.c $(prefix)/$(INC_DIR)/mutest.c
70 $(INSTALL) -m 644 mutest.h $(prefix)/$(INC_DIR)/mutest.h
71 $(INSTALL) -m 755 mkmutest $(prefix)/$(BIN_DIR)/mkmutest
74 $(INSTALL) -m 755 -d $(prefix)/$(BIN_DIR)
75 $(INSTALL) -m 755 -d $(prefix)/$(INC_DIR)
76 $(INSTALL) -m 644 mutest.h $(prefix)/$(INC_DIR)/mutest.h
77 $(INSTALL) -m 755 mutest $(prefix)/$(BIN_DIR)/mutest
79 install-doc: install-readme install-html install-pdf
81 install: install-c install-py install-doc
84 $(MAKE) -k -C sample test test-py
86 # You shouldn't use this target
87 ifeq ($(MAKECMDGOALS),release)
89 $(error You have to specify a VERSION when using the 'release' target)
93 $(RM) $(MANUAL_GARBAGE)
94 $(GIT) tag -f $(VERSION)
98 $(GIT) archive --format=tar --prefix=mutest-$(VERSION)/ $(VERSION) \
99 | gzip > releases/mutest-$(VERSION).tar.gz
100 $(CHMOD) 644 releases/mutest-$(VERSION).tar.gz
101 $(LN) -sf mutest-$(VERSION).tar.gz releases/mutest.tar.gz
102 $(INSTALL) -m 644 manual.html releases/manual-$(VERSION).html
103 $(LN) -sf manual-$(VERSION).html releases/manual.html
104 $(INSTALL) -m 644 manual.pdf releases/manual-$(VERSION).pdf
105 $(LN) -sf manual-$(VERSION).pdf releases/manual.pdf
108 $(RM) $(MANUAL_HTML) $(MANUAL_LATEX) $(MANUAL_PDF) $(MANUAL_GARBAGE)
110 .PHONY: all doc doc-html doc-latex doc-pdf \
111 install-readme install-html install-pdf install-doc \
112 install-c install-py install \