From ccfae0c3dc03a46b23e392ffee3d29fc25123995 Mon Sep 17 00:00:00 2001 From: Joakim Ekblad Date: Thu, 17 Aug 2017 14:48:10 +0200 Subject: [PATCH] Refactor top-level make system to be more stable --- Makefile | 68 ++++++++++++------- README.rst | 4 ++ examples/Makefile | 2 + .../Makefile | 6 +- src/cutest.h | 6 +- 5 files changed, 57 insertions(+), 29 deletions(-) diff --git a/Makefile b/Makefile index 20b6cce..c058848 100644 --- a/Makefile +++ b/Makefile @@ -2,59 +2,75 @@ # Makefile to build releases of CUTest # +export COVERAGE=0 VERSION=$(shell grep 'CUTEST_VERSION' src/cutest.h | cut -d'"' -f2) all: @echo "========================" && \ echo "Running regression tests" && \ echo "========================" && \ - make -s regression_tests && \ - make -s README.rst && \ - make -s clean && \ - make -s release + echo "" && \ + $(MAKE) -r --no-print-directory regression_tests && \ + $(MAKE) -r --no-print-directory README.rst && \ + $(MAKE) -r --no-print-directory clean && \ + $(MAKE) -r --no-print-directory release regression_tests: - make -s -C examples && \ - make -s -C examples/complex_directory_structure/my_project_with_a_test_folder_inside_the_src_folder/src && \ - make -s -C examples/complex_directory_structure/my_project_with_separate_src_and_test_folders + @echo "examples:" && \ + $(MAKE) -r --no-print-directory -C examples && echo "OK" && \ + echo "my_project_with_a_test_folder_inside_the_src_folder:" && \ + $(MAKE) -r --no-print-directory -C examples/complex_directory_structure/my_project_with_a_test_folder_inside_the_src_folder/src && echo "OK" && \ + echo "my_project_with_separate_src_and_test_folders:" && \ + $(MAKE) -r --no-print-directory -C examples/complex_directory_structure/my_project_with_separate_src_and_test_folders && echo "OK" && \ + echo "" release: cutest-$(VERSION).tar.gz cutest-$(VERSION).tar.gz: - @echo "Checking git repository for version tag v$(VERSION)" && \ + @echo "==============================================" && \ + echo "Checking git repository for version tag v$(VERSION)" && \ + echo "==============================================" && \ + echo "" && \ git tag -l | grep "v$(VERSION)" && echo "Version v$(VERSION) is already released" && \ git tag -l | grep "v$(VERSION)" && exit 1 || \ - echo "OK, version not found... Creating release" && \ + echo "OK" && \ + echo "" && \ + echo "=================" && \ + echo "Creating tar-ball" && \ + echo "=================" && \ + echo "" && \ mkdir cutest-$(VERSION) && \ cp -r LICENSE examples src cutest-$(VERSION)/. && \ rm -rf cutest-$(VERSION)/.git* && \ rm -rf cutest-$(VERSION)/Makefile && \ tar -c cutest-$(VERSION) | gzip > $@ && \ rm -rf cutest-$(VERSION) && \ - mkdir tmp && \ - cp cutest-$(VERSION).tar.gz tmp/. && \ - cd tmp && \ - tar -xzf cutest-$(VERSION).tar.gz && \ - cd cutest-$(VERSION) && \ - cp ../../Makefile . && \ + echo "OK" && \ + echo "" && \ + tar -xzf cutest-$(VERSION).tar.gz && cp Makefile cutest-$(VERSION)/. && \ echo "========================" && \ echo "Testing tar-ball" && \ echo "========================" && \ - make -s regression_tests && \ - cd ../../ && \ - rm -rf tmp && \ + echo "" && \ + $(MAKE) -r --no-print-directory -C cutest-$(VERSION) regression_tests && \ + rm -rf cutest-$(VERSION) && \ echo "" && \ echo "ALL OK!!! Go ahead and upload the cutest-$(VERSION).tar.gz then inform the public!" && \ echo "" -README.rst: - @cd examples && \ - make -s cutest_help.rst && \ - mv cutest_help.rst ../$@ && \ - make -s clean +examples/cutest_help.rst: + @$(MAKE) -r --no-print-directory -C examples cutest_help.rst +README.rst: examples/cutest_help.rst + @echo "=============================="; \ + echo "Generating new README.rst file"; \ + echo "=============================="; \ + echo "" && \ + mv $^ $@ && echo "OK" && \ + $(MAKE) -r --no-print-directory -C examples clean && \ + echo "" clean: @rm -rf tmp cutest-* *~ && \ - make -s -C examples clean && \ - make -s -C examples/complex_directory_structure/my_project_with_a_test_folder_inside_the_src_folder/src clean && \ - make -s -C examples/complex_directory_structure/my_project_with_separate_src_and_test_folders clean + $(MAKE) -r --no-print-directory -C examples clean && \ + $(MAKE) -r --no-print-directory -C examples/complex_directory_structure/my_project_with_a_test_folder_inside_the_src_folder/src clean && \ + $(MAKE) -r --no-print-directory -C examples/complex_directory_structure/my_project_with_separate_src_and_test_folders clean diff --git a/README.rst b/README.rst index bae272f..989899c 100644 --- a/README.rst +++ b/README.rst @@ -29,6 +29,10 @@ naive, simple and realistic examples of various CUTest usages. Version history --------------- +* v1.0.2 yyyy-mm-dd Release work flow enhancements + + - Fixed the documentation generator to be run before release + * v1.0.1 2017-08-15 Fix-up release - Fixed release date and documentation diff --git a/examples/Makefile b/examples/Makefile index df50e11..f417644 100644 --- a/examples/Makefile +++ b/examples/Makefile @@ -27,7 +27,9 @@ Q=@ all: check include ../src/cutest.mk +ifneq (${COVERAGE},0) include ../src/coverage.mk +endif clean:: $(Q)$(RM) -f *~ diff --git a/examples/complex_directory_structure/my_project_with_separate_src_and_test_folders/Makefile b/examples/complex_directory_structure/my_project_with_separate_src_and_test_folders/Makefile index 60766cb..63a6796 100644 --- a/examples/complex_directory_structure/my_project_with_separate_src_and_test_folders/Makefile +++ b/examples/complex_directory_structure/my_project_with_separate_src_and_test_folders/Makefile @@ -26,7 +26,9 @@ src: @mkdir obj >/dev/null; make -s -C src check: - @make -s -C test + @$(MAKE) -r --no-print-directory -C test clean:: - @rm -f *~ obj; make -s -C src clean; make -s -C test clean + @rm -f *~ obj; \ + $(MAKE) -r --no-print-directory -C src clean; \ + $(MAKE) -r --no-print-directory -C test clean diff --git a/src/cutest.h b/src/cutest.h index 1e21196..e0e3dbd 100644 --- a/src/cutest.h +++ b/src/cutest.h @@ -16,7 +16,7 @@ along with this program. If not, see . */ -#define CUTEST_VERSION "1.0.1" +#define CUTEST_VERSION "1.0.2" /********************************************************************* *:: @@ -50,6 +50,10 @@ * Version history * --------------- * + * * v1.0.2 yyyy-mm-dd Release work flow enhancements + * + * - Fixed the documentation generator to be run before release + * * * v1.0.1 2017-08-15 Fix-up release * * - Fixed release date and documentation