aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml6
-rw-r--r--Makefile1
-rw-r--r--src/Makefile8
-rw-r--r--test/Makefile2
-rw-r--r--test/src/Makefile8
5 files changed, 15 insertions, 10 deletions
diff --git a/.travis.yml b/.travis.yml
index da792fc..55210a0 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -26,8 +26,10 @@ before_install:
- wget mirrors.kernel.org/ubuntu/pool/main/r/readline/libreadline7_7.0-0ubuntu2_amd64.deb
- sudo dpkg --force-all -i libreadline7_7.0-0ubuntu2_amd64.deb libpari-gmp-tls5_2.9.3-1_amd64.deb libpari-dev_2.9.3-1_amd64.deb pari-gp_2.9.3-1_amd64.deb
-script:
- - TEST=1 make -j2 unittest
+script: # Test, clean, build for release
+ - TEST=1 make unittest
+ - TEST=1 make clean
+ - make -j2
after_success:
- bash <(curl -s https://codecov.io/bash)
diff --git a/Makefile b/Makefile
index 443d873..303e223 100644
--- a/Makefile
+++ b/Makefile
@@ -11,7 +11,6 @@ all:
clean:
+$(MAKE) -C src clean
+$(MAKE) -C test clean
- rm -rf *.gcov
clean-all:
+$(MAKE) -C lib clean
diff --git a/src/Makefile b/src/Makefile
index 34be0ac..65b0135 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -11,9 +11,9 @@ CFLAGS = -Wall
DEBUG ?= 0
TEST ?= 0
ifeq ($(DEBUG), 1)
- CFLAGS += -DDEBUG -g -Werror -pedantic
+ CFLAGS += -DDEBUG -g -Werror -pedantic
else ifeq ($(TEST), 1)
- CFLAGS += --coverage -g -O0
+ CFLAGS += --coverage -g -O0
else
CFLAGS += -DNDEBUG -O3
endif
@@ -50,12 +50,14 @@ econvert: econvert.o $(ECONVERT_OBJ)
####
-clean-all: clean
+clean-all: clean clean-cov
rm -f ../ecgen
rm -f ../econvert
clean:
find . -type f -name '*.o' -exec rm {} +
+
+clean-cov:
find . -type f -name '*.gcda' -exec rm {} +
find . -type f -name '*.gcno' -exec rm {} +
find . -type f -name '*.gcov' -exec rm {} +
diff --git a/test/Makefile b/test/Makefile
index 0aacdeb..825aa4f 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -23,5 +23,5 @@ clean:
+$(MAKE) -C src clean
clean-all:
- cd lib/criterion && rm -r build
+ cd lib/criterion && rm -rf build
+$(MAKE) -C src clean-all \ No newline at end of file
diff --git a/test/src/Makefile b/test/src/Makefile
index 27e6ea2..33e4bdf 100644
--- a/test/src/Makefile
+++ b/test/src/Makefile
@@ -10,7 +10,7 @@ CC ?= gcc
CFLAGS = -Wall
TEST ?= 0
ifeq ($(TEST), 1)
- CFLAGS += --coverage -g -O0
+ CFLAGS += --coverage -g -O0
endif
LDFLAGS = -L../../lib/parson -L../../lib/sha1 -L../../lib/pari -L../lib/criterion/build
INCLUDES = -I. -I../../src -I../../lib -I../lib/criterion/include
@@ -32,11 +32,13 @@ test_ecgen: $(TEST_OBJ) $(ECGEN_OBJ)
%.o: %.c
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
-clean-all: clean
+clean-all: clean clean-cov
rm -f ./test_ecgen
clean:
find . -type f -name '*.o' -exec rm {} +
+
+clean-cov:
find . -type f -name '*.gcda' -exec rm {} +
find . -type f -name '*.gcno' -exec rm {} +
- find . -type f -name '*.gcov' -exec rm {} +
+ find . -type f -name '*.gcov' -exec rm {} + \ No newline at end of file