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 samples Makefile.
10 # Please, read the README file for more details.
13 # Show the tests summary
16 CFLAGS = -Wall -std=c89
19 RUNNER_SRC = test_suite_runner.c
20 MKMUTEST = ../mkmutest
22 MUTEST_H = ../mutest.h
23 MUTEST_C = ../mutest.c
25 OBJS = factorial.o sum.o
26 TEST_OBJS = factorial_test.o sum_test.o init_fail_test.o
28 RUNNER_OBJ = $(RUNNER_SRC:.c=.o)
29 ALL_OBJS = $(RUNNER_OBJ) $(OBJS) $(TEST_OBJS) $(MUTEST_OBJ)
30 TEST_SOS = $(TEST_OBJS:.o=.so)
36 $(TARGET): $(ALL_OBJS)
37 $(CC) $(LDFLAGS) -o $@ $^
39 $(RUNNER_SRC): $(MKMUTEST_OBJ) $(MUTEST_H) $(TEST_OBJS)
40 $(MKMUTEST) $(MUTEST_H) $(TEST_OBJS) > $@
42 factorial_test.so: factorial.c
46 $(MUTEST_OBJ): $(MUTEST_C)
47 $(CC) $(CFLAGS) -c -o $@ $^
56 $(RM) $(TARGET) $(TEST_SOS) $(ALL_OBJS) $(RUNNER_SRC)
59 $(CC) $(CFLAGS) $(LDFLAGS) -DMUTEST_PY -fPIC -shared -o $@ $^
63 .PHONY: all test clean