3
3
# This file contains Makefile targets for the cloe project.
4
4
#
5
5
6
+ CLOE_ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST ) ) ) )
7
+ CLOE_LAUNCH := PYTHONPATH="${CLOE_ROOT}/cli" python3 -m cloe_launch
8
+
9
+ include ${CLOE_ROOT}/Makefile.help
10
+
6
11
# Set the clang-format command line to use:
7
12
CLANG_FORMAT := $(shell command -v clang-format 2>/dev/null)
8
13
CLANG_FORMAT_ARGS := -style=file
@@ -13,15 +18,6 @@ AG := $(or \
13
18
"grep -r" \
14
19
)
15
20
16
- define print_header
17
- @printf "________________________________________"
18
- @printf "________________________________________\n"
19
- @printf ":: %s\n" ${1}
20
- endef
21
-
22
- CLOE_ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST ) ) ) )
23
- CLOE_LAUNCH := PYTHONPATH="${CLOE_ROOT}/cli" python3 -m cloe_launch
24
-
25
21
# Build configuration:
26
22
BUILD_DIR := build
27
23
LOCKFILE_SOURCE := conanfile.py
@@ -34,26 +30,28 @@ CONAN_OPTIONS :=
34
30
.DEFAULT : help
35
31
.SILENT : help
36
32
help ::
37
- echo " Usage: make <target> "
33
+ $( call print_help_usage)
38
34
echo
39
35
36
+ # Setup targets ---------------------------------------------------------------
40
37
include Makefile.setup
41
- include Makefile.all
42
38
43
39
# Workspace targets -----------------------------------------------------------
44
40
.PHONY : lockfile status deploy sphinx doxygen docker-all docker-test docker-release purge-all export-cli smoketest smoketest-deps
45
41
help ::
46
- echo " Available workspace targets:"
47
- echo " smoketest to run BATS system tests"
48
- echo " sphinx to generate Sphinx documentation"
49
- echo " doxygen to generate Doxygen documentation"
50
- echo " deploy to deploy Cloe to INSTALL_DIR [=${INSTALL_DIR} ]"
51
- echo " deploy-cli to install cloe-launch with pip"
52
- echo " export-cli to export cloe-launch-profile conan recipe"
42
+ $(call print_help_section, "Available workspace targets")
43
+ $(call print_help_target, status, "show status of each of the Conan packages")
44
+ $(call print_help_target, smoketest-deps, "build system test pre-requisites")
45
+ $(call print_help_target, smoketest, "run system tests")
46
+ $(call print_help_target, sphinx, "generate Sphinx documentation")
47
+ $(call print_help_target, doxygen, "generate Doxygen documentation")
48
+ $(call print_help_target, deploy, "deploy Cloe to INSTALL_DIR [=${INSTALL_DIR}]")
49
+ $(call print_help_target, deploy-cli, "install ${_yel}cloe-launch${_rst} with ${_dim}${PIPX}${_rst}")
50
+ $(call print_help_target, export-cli, "export ${_yel}cloe-launch-profile${_rst} Conan recipe")
53
51
echo
54
- echo " docker-test to build only a single Docker image"
55
- echo " docker-all to build all Docker images"
56
- echo " docker-release to upload all Conan packages from Docker images"
52
+ $( call print_help_target, docker-test, " build only a single Docker image")
53
+ $( call print_help_target, docker-all, " build all Docker images")
54
+ $( call print_help_target, docker-release, " upload all Conan packages from Docker images")
57
55
echo
58
56
59
57
${BUILD_LOCKFILE} :
@@ -97,16 +95,14 @@ sphinx:
97
95
mkdir -p ${BUILD_DIR} /sphinx
98
96
${MAKE} -C docs html
99
97
100
- doxygen :
98
+ doxygen :keyboard tilt
101
99
$(call print_header, "Generating Doxygen documentation...")
102
100
mkdir -p ${BUILD_DIR} /doxygen
103
101
doxygen Doxyfile
104
102
105
103
smoketest-deps : export-cli smoketest-deps-select
106
- # Call this target with WITH_VTD=1 to include VTD binding tests.
107
104
108
105
smoketest : smoketest-select
109
- # Call this target with WITH_VTD=1 to include VTD binding tests.
110
106
111
107
purge-all :
112
108
$(call print_header, "Removing all cloe Conan packages...")
@@ -117,13 +113,17 @@ purge-all:
117
113
# Development targets ---------------------------------------------------------
118
114
.PHONY : format todos find-missing-eol sanitize-files
119
115
help ::
120
- echo " Available development targets:"
121
- echo " status to show current workspace status"
122
- echo " format to format Cloe source code with clang-format"
123
- echo " todos to show all TODOs in Cloe source code"
116
+ $(call print_help_section, "Available development targets")
117
+ $(call print_help_target, format, "format Cloe source code with clang-format")
118
+ $(call print_help_target, todos, "show all TODOs in Cloe source code")
124
119
echo
125
120
126
121
format :
122
+ # When you do this, isolate the change in a single commit and then add the
123
+ # commit hash to a file such as .git-blame-ignore-revs, so that git-blame
124
+ # continues to work as expected.
125
+ #
126
+ # See: https://www.moxio.com/blog/43/ignoring-bulk-change-commits-with-git-blame
127
127
find . -type f -not -path ' */\.git/*' -and \( -name ' *.cpp' -o -name ' *.hpp' \) -exec ${CLANG_FORMAT} ${CLANG_FORMAT_ARGS} -i {} \;
128
128
129
129
todos :
@@ -139,3 +139,6 @@ find-missing-eol:
139
139
140
140
sanitize-files :
141
141
git grep --cached -Ilz ' ' | while IFS= read -rd ' ' f; do tail -c1 < " $$ f" | read -r _ || echo >> " $$ f" ; done
142
+
143
+ # Build targets ---------------------------------------------------------------
144
+ include Makefile.all
0 commit comments