Skip to content

Commit

Permalink
mk,cmake: add Makefile helpers and exclude retest from all
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Mar 3, 2023
1 parent e7bada4 commit 7ef6b87
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -737,4 +737,4 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libre.pc
# Test
#

add_subdirectory(test)
add_subdirectory(test EXCLUDE_FROM_ALL)
42 changes: 42 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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)"

0 comments on commit 7ef6b87

Please sign in to comment.