3
3
# This file contains Makefile targets for the cloe project.
4
4
#
5
5
6
+ # Make configuration:
7
+ SHELL := /bin/bash
8
+ GNUMAKEFLAGS := --no-print-directory
9
+ SUBMAKEFLAGS :=
10
+
6
11
CLOE_ROOT := $(shell dirname $(realpath $(firstword $(MAKEFILE_LIST ) ) ) )
7
12
CLOE_LAUNCH := PYTHONPATH="${CLOE_ROOT}/cli" python3 -m cloe_launch
8
13
@@ -20,78 +25,98 @@ AG := $(or \
20
25
21
26
# Build configuration:
22
27
BUILD_DIR := build
23
- LOCKFILE_SOURCE := conanfile.py
24
- BUILD_LOCKFILE := ${BUILD_DIR}/conan.lock
25
- LOCKFILE_OPTION := --lockfile="${CLOE_ROOT}/${BUILD_LOCKFILE}"
26
28
INSTALL_DIR := /usr/local
29
+ DEPLOY_DIR := deploy
27
30
CONAN_OPTIONS :=
28
31
32
+ # Lockfile for cloe-deployment:
33
+ DEPLOY_LOCKFILE_SOURCE := tests/conanfile_deployment.py
34
+ DEPLOY_BUILD_LOCKFILE := ${DEPLOY_DIR}/conan.lock
35
+ DEPLOY_LOCKFILE_OPTION := --lockfile="${CLOE_ROOT}/${DEPLOY_BUILD_LOCKFILE}"
36
+
29
37
.DEFAULT_GOAL := help
30
38
.PHONY : help
31
39
.SILENT : help
32
40
help ::
33
41
$(call print_help_usage)
34
42
echo
43
+ $(call print_help_section, "Default target")
44
+ $(call print_help_target, help, "show this help on available targets")
45
+ echo
35
46
36
47
# Setup targets ---------------------------------------------------------------
37
48
include Makefile.setup
38
49
50
+ ${DEPLOY_BUILD_LOCKFILE} :
51
+ mkdir -p " ${DEPLOY_DIR} "
52
+ conan lock create --lockfile-out " ${DEPLOY_BUILD_LOCKFILE} " --build -- " ${DEPLOY_LOCKFILE_SOURCE} "
53
+
54
+ .PHONY : lockfile
55
+ lockfile : ${DEPLOY_BUILD_LOCKFILE}
56
+
39
57
# Workspace targets -----------------------------------------------------------
40
58
help ::
41
59
$(call print_help_section, "Available workspace targets")
42
- $(call print_help_target, status, "show status of each of the Conan packages")
43
- $(call print_help_target, smoketest-deps, "build system test pre-requisites")
44
- $(call print_help_target, smoketest, "run system tests")
45
- $(call print_help_target, docs, "generate documentation")
46
- $(call print_help_target, deploy, "deploy Cloe to INSTALL_DIR [=${INSTALL_DIR}]")
47
- $(call print_help_target, deploy-cli, "install ${_yel}cloe-launch${_rst} with ${_dim}${PIPX}${_rst}")
48
- $(call print_help_target, export-cli, "export ${_yel}cloe-launch-profile${_rst} Conan recipe")
60
+ $(call print_help_target, docs, "generate Doxygen and Sphinx documentation")
49
61
echo
50
62
51
- ${BUILD_LOCKFILE} :
52
- ${MAKE} -f Makefile.package SOURCE_CONANFILE=/dev/null LOCKFILE_SOURCE=${LOCKFILE_SOURCE} ${BUILD_LOCKFILE}
53
-
54
- .PHONY : lockfile
55
- lockfile : ${BUILD_LOCKFILE}
63
+ .PHONY : docs
64
+ docs :
65
+ $(call print_header, "Generating Doxygen documentation...")
66
+ ${MAKE} -C docs doxygen
67
+ $(call print_header, "Generating Sphinx documentation...")
68
+ ${MAKE} -C docs html
56
69
57
- .PHONY : status
58
- status : ${BUILD_LOCKFILE}
59
- @for pkg in ${ALL_PKGS} ; do \
60
- [ -d $$ {pkg} ] || continue ; \
61
- ${MAKE} LOCKFILE_SOURCE=" " LOCKFILE_OPTION=${LOCKFILE_OPTION} -C $$ {pkg} status || true ; \
62
- done
70
+ help ::
71
+ $(call print_help_target, export-cli, "export ${_yel}cloe-launch-profile${_rst} Conan recipe")
72
+ $(call print_help_target, deploy-cli, "install ${_yel}cloe-launch${_rst} with ${_dim}${PIPX}${_rst}")
73
+ echo
63
74
64
- .PHONY : deploy
65
- deploy :
66
- $(call print_header, "Deploying binaries to ${INSTALL_DIR}...")
67
- conan install ${CONAN_OPTIONS} --install-folder ${BUILD_DIR} /deploy -g deploy .
68
- mkdir -p ${INSTALL_DIR}
69
- cp -r ${BUILD_DIR} /deploy/cloe-* /* ${INSTALL_DIR} /
75
+ .PHONY : export-cli
76
+ export-cli :
77
+ ${MAKE} -C cli export
70
78
71
79
.PHONY : deploy-cli
72
80
deploy-cli :
73
81
$(call print_header, "Deploying cloe-launch binary with pip...")
74
82
${MAKE} -C cli install
75
83
76
- .PHONY : export-cli
77
- export-cli :
78
- ${MAKE} -C cli export
84
+ help ::
85
+ $(call print_help_target, lockfile, "create a lockfile for cloe deployment packages")
86
+ $(call print_help_target, package-all, "package all cloe deployment packages")
87
+ $(call print_help_target, status-all, "show status of each of the Conan packages")
88
+ $(call print_help_target, export-all, "export all package sources to Conan cache")
89
+ $(call print_help_target, build-all, "build individual packages locally in-source")
90
+ $(call print_help_target, deploy-all, "deploy Cloe to INSTALL_DIR [=${INSTALL_DIR}]")
91
+ $(call print_help_target, clean-all, "clean entire repository of temporary files")
92
+ $(call print_help_target, purge-all, "remove all cloe packages (in any version) from Conan cache" )
93
+ echo
79
94
80
- export : export-cli
81
- package : export-cli
95
+ .PHONY : build-all
96
+ build-all : lockfile
97
+ ${MAKE} all-select CONAN_OPTIONS=" ${CONAN_OPTIONS} ${DEPLOY_LOCKFILE_OPTION} "
82
98
83
- .PHONY : docs
84
- docs :
85
- $(call print_header, "Generating Doxygen documentation...")
86
- ${MAKE} -C docs doxygen
87
- $(call print_header, "Generating Sphinx documentation...")
88
- ${MAKE} -C docs html
99
+ .PHONY : status-all
100
+ status-all : ${DEPLOY_BUILD_LOCKFILE}
101
+ @for pkg in ${ALL_PKGS} ; do \
102
+ ${MAKE} LOCKFILE_SOURCE=" " LOCKFILE_OPTION=${DEPLOY_LOCKFILE_OPTION} -C $$ {pkg} status || true ; \
103
+ done
89
104
90
- .PHONY : smoketest-deps
91
- smoketest-deps : export-cli smoketest-deps-select
105
+ .PHONY : export-all
106
+ export-all :
107
+ $(call print_header, "Exporting all cloe Conan packages...")
108
+ ${MAKE} export-select export-cli export
109
+
110
+ .PHONY : deploy-all
111
+ deploy-all :
112
+ $(call print_header, "Deploying binaries to ${INSTALL_DIR}...")
113
+ conan install ${CONAN_OPTIONS} --install-folder ${DEPLOY_DIR} -g deploy .
114
+ mkdir -p ${INSTALL_DIR}
115
+ cp -r ${DEPLOY_DIR} /cloe-* /* ${INSTALL_DIR} /
92
116
93
- .PHONY : smoketest
94
- smoketest : smoketest-select
117
+ .PHONY : clean-all
118
+ clean-all :
119
+ ${MAKE} clean clean-select
95
120
96
121
.PHONY : purge-all
97
122
purge-all :
@@ -100,6 +125,10 @@ purge-all:
100
125
conan remove -f ' cloe'
101
126
conan remove -f ' fable'
102
127
128
+ .PHONY : package-all
129
+ package-all :
130
+ conan install ${CONAN_OPTIONS} --install-folder ${DEPLOY_DIR} --build=missing --build=outdated ${DEPLOY_LOCKFILE_SOURCE}
131
+
103
132
# Development targets ---------------------------------------------------------
104
133
help ::
105
134
$(call print_help_section, "Available development targets")
@@ -122,10 +151,15 @@ todos:
122
151
${AG} FIXME
123
152
${AG} XXX
124
153
154
+ # Hidden development targets --------------------------------------------------
155
+
125
156
.PHONY : grep-uuids
126
157
grep-uuids :
127
158
${AG} " \b[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}\b"
128
159
160
+ grep-conan-requires :
161
+ @rg -t py ' ^.*requires\(f?["](.+/[0-9]+\.[^)]+)["].*\).*$$' -r ' $$1' -I --no-heading --no-line-number | sort | uniq
162
+
129
163
.PHONY : find-missing-eol
130
164
find-missing-eol :
131
165
find . -type f -size +0 -exec gawk ' ENDFILE{if ($0 == "") print FILENAME}' {} \;
@@ -134,5 +168,12 @@ find-missing-eol:
134
168
sanitize-files :
135
169
git grep --cached -Ilz ' ' | while IFS= read -rd ' ' f; do tail -c1 < " $$ f" | read -r _ || echo >> " $$ f" ; done
136
170
137
- # Build targets --------------- ------------------------------------------------
171
+ # Micro-packages build targets ------------------------------------------------
138
172
include Makefile.all
173
+
174
+ # Mono-package build targets --------------------------------------------------
175
+ DISABLE_HELP_PREAMBLE := true
176
+ help ::
177
+ @printf " Available $( _yel) cloe$( _rst) package targets:\n"
178
+
179
+ include Makefile.package
0 commit comments