X-Git-Url: https://git.llucax.com/software/mutest.git/blobdiff_plain/5ce20f06cfd85f7498652f86a4111ed6c456b9f9..5b3a1f1593fc57a4dd5b492f9b4cd55e28cb6eaa:/sample/Makefile diff --git a/sample/Makefile b/sample/Makefile index e67a320..19bf4c3 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -1,42 +1,59 @@ +# +# 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 CFLAGS = -Wall -std=c89 -TARGET=tester +TARGET = tester +RUNNER_SRC = test_suite_runner.c +MKMUTEST = ../mkmutest +MUTEST = ../mutest +MUTEST_H = ../mutest.h +MUTEST_C = ../mutest.c OBJS = factorial.o sum.o -TESTS = factorial_test.o sum_test.o -MUTEST = mutest.o -TESTER = tester.o -SO = factorial.so sum.so -ALL = $(TESTER) $(OBJS) $(TESTS) $(MUTEST) +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) -py: $(SO) +py: $(TEST_SOS) -$(TARGET): $(ALL) +$(TARGET): $(ALL_OBJS) + $(CC) $(LDFLAGS) -o $@ $^ -$(TESTER): $(OBJS) $(TESTS) $(MUTEST) - ../mkmutest ../mutest.h $(TESTS) | gcc -xc -o $(TESTER) -c - +$(RUNNER_SRC): $(MKMUTEST_OBJ) $(MUTEST_H) $(TEST_OBJS) + $(MKMUTEST) $(MUTEST_H) $(TEST_OBJS) > $@ -factorial.so: factorial_test.c +factorial_test.so: factorial.c -sum.so: sum_test.c +sum_test.so: sum.c -$(MUTEST): ../mutest.c - $(CC) $(CFLAGS) -c -o mutest.o $^ +$(MUTEST_OBJ): $(MUTEST_C) + $(CC) $(CFLAGS) -c -o $@ $^ test: $(TARGET) ./$(TARGET) $(V) -test-py: $(SO) - ../py/mutest $(V) -a +test-py: $(TEST_SOS) + $(MUTEST) $(V) -a clean: - $(RM) $(TARGET) $(SO) $(ALL) + $(RM) $(TARGET) $(TEST_SOS) $(ALL_OBJS) $(RUNNER_SRC) .c.so: $(CC) $(CFLAGS) $(LDFLAGS) -DMUTEST_PY -fPIC -shared -o $@ $^