X-Git-Url: https://git.llucax.com/software/mutest.git/blobdiff_plain/6fa3862da83a93a63c025035d8e614eaac4f5cab..75eb5c4a3edb32190187334ca9238b3b1ef2be39:/sample/Makefile?ds=sidebyside diff --git a/sample/Makefile b/sample/Makefile index df8b16c..e7c764d 100644 --- a/sample/Makefile +++ b/sample/Makefile @@ -2,25 +2,51 @@ # Show the tests summary V=-v -TARGET=tester +CFLAGS = -Wall -std=c89 + +TARGET = tester +SUITES_RUNNER_SRC = test_suite_runner.c +MKMUTEST = ../mkmutest +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) +TESTS = factorial_test.o sum_test.o init_fail_test.o +MUTEST = mutest.o +SUITES_RUNNER = $(SUITES_RUNNER_SRC:.c=.o) +SO = factorial.so sum.so init_fail_test.so +ALL = $(SUITES_RUNNER) $(OBJS) $(TESTS) $(MUTEST) all: $(TARGET) +py: $(SO) + $(TARGET): $(ALL) + $(CC) $(LDFLAGS) -o $@ $^ + +$(SUITES_RUNNER_SRC): $(MKMUTEST) $(MUTEST_H) $(TESTS) + $(MKMUTEST) $(MUTEST_H) $(TESTS) > $@ + +factorial.so: factorial_test.c -$(TESTER): $(OBJS) $(TESTS) - ../mkmutest $(TESTS) | gcc -xc -o $(TESTER) -c - +sum.so: sum_test.c + +$(MUTEST): ../mutest.c + $(CC) $(CFLAGS) -c -o mutest.o $^ test: $(TARGET) ./$(TARGET) $(V) +test-py: $(SO) + ../py/mutest $(V) -a + clean: - $(RM) $(TARGET) $(ALL) + $(RM) $(TARGET) $(SO) $(ALL) $(SUITES_RUNNER_SRC) + +.c.so: + $(CC) $(CFLAGS) $(LDFLAGS) -DMUTEST_PY -fPIC -shared -o $@ $^ + +.SUFFIXES: .so .PHONY: all test clean