X-Git-Url: https://git.llucax.com/software/mutest.git/blobdiff_plain/6fa3862da83a93a63c025035d8e614eaac4f5cab..d5be024b1cc1a456cd9726d85a7e108e1818ae7f:/sample/Makefile?ds=inline diff --git a/sample/Makefile b/sample/Makefile index df8b16c..3c1588c 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -1,26 +1,64 @@ +# +# This file is part of mutest, a simple micro unit testing framework for C. +# +# mutest was written by Leandro Lucarella and is released +# under the BOLA license, please see the LICENSE file or visit: +# http://blitiri.com.ar/p/bola/ +# +# This is the samples Makefile. +# +# Please, read the README file for more details. +# # Show the tests summary V=-v -TARGET=tester +CFLAGS = -Wall -std=c89 + +TARGET = tester +RUNNER_SRC = test_suite_runner.c +MKMUTEST = ../mkmutest +MUTEST = ../py/mutest +MUTEST_H = ../mutest.h +MUTEST_C = ../mutest.c OBJS = factorial.o sum.o -TESTS = factorial_test.o sum_test.o -TESTER = tester.o -ALL = $(TESTER) $(OBJS) $(TESTS) +TEST_OBJS = factorial_test.o sum_test.o init_fail_test.o +MUTEST_OBJ = mutest.o +RUNNER_OBJ = $(RUNNER_SRC:.c=.o) +ALL_OBJS = $(RUNNER_OBJ) $(OBJS) $(TEST_OBJS) $(MUTEST_OBJ) +TEST_SOS = $(TEST_OBJS:.o=.so) all: $(TARGET) -$(TARGET): $(ALL) +py: $(TEST_SOS) + +$(TARGET): $(ALL_OBJS) + $(CC) $(LDFLAGS) -o $@ $^ + +$(RUNNER_SRC): $(MKMUTEST_OBJ) $(MUTEST_H) $(TEST_OBJS) + $(MKMUTEST) $(MUTEST_H) $(TEST_OBJS) > $@ + +factorial_test.so: factorial.c -$(TESTER): $(OBJS) $(TESTS) - ../mkmutest $(TESTS) | gcc -xc -o $(TESTER) -c - +sum_test.so: sum.c + +$(MUTEST_OBJ): $(MUTEST_C) + $(CC) $(CFLAGS) -c -o $@ $^ test: $(TARGET) ./$(TARGET) $(V) +test-py: $(TEST_SOS) + $(MUTEST) $(V) -a + clean: - $(RM) $(TARGET) $(ALL) + $(RM) $(TARGET) $(TEST_SOS) $(ALL_OBJS) $(RUNNER_SRC) + +.c.so: + $(CC) $(CFLAGS) $(LDFLAGS) -DMUTEST_PY -fPIC -shared -o $@ $^ + +.SUFFIXES: .so .PHONY: all test clean