From 7ef6b877a936dd1c1586f6fa787f22b36312c968 Mon Sep 17 00:00:00 2001 From: Sebastian Reimers Date: Thu, 2 Mar 2023 20:34:15 +0100 Subject: [PATCH] mk,cmake: add Makefile helpers and exclude retest from all --- CMakeLists.txt | 2 +- Makefile | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 Makefile diff --git a/CMakeLists.txt b/CMakeLists.txt index 84fd5c98d..a08b90763 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -737,4 +737,4 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libre.pc # Test # -add_subdirectory(test) +add_subdirectory(test EXCLUDE_FROM_ALL) diff --git a/Makefile b/Makefile new file mode 100644 index 000000000..775a099b1 --- /dev/null +++ b/Makefile @@ -0,0 +1,42 @@ +.PHONY: build +build: + [ -d build ] || cmake -B build + cmake --build build --parallel + +.PHONY: ninja +ninja: + [ -d build ] || cmake -B build -G Ninja + make build + +.PHONY: dist +dist: build + cmake --install build --prefix dist + +.PHONY: test +test: build + cmake --build build --parallel -t retest + build/test/retest -rv + +.PHONY: clean +clean: + @rm -Rf build dist CMakeCache.txt CMakeFiles + + +############################################################################### +# +# Documentation section +# +DOX_DIR=../re-dox + +$(DOX_DIR): + @mkdir $@ + +$(DOX_DIR)/Doxyfile: mk/Doxyfile Makefile + @cp $< $@ + @perl -pi -e 's/PROJECT_NUMBER\s*=.*/PROJECT_NUMBER = $(VERSION)/' \ + $(DOX_DIR)/Doxyfile + +.PHONY: +dox: $(DOX_DIR) $(DOX_DIR)/Doxyfile + @doxygen $(DOX_DIR)/Doxyfile 2>&1 | grep -v DEBUG_ ; true + echo "Doxygen docs in $(DOX_DIR)"