Skip to content

Commit 22f9a50

Browse files
author
Maxim Egorushkin
committed
Makefile compile_commands.json, TAGS tagrets added. Target rtags retired.
1 parent f1e1457 commit 22f9a50

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

Makefile

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) BUILD=debug run_tests
77
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) all run_tests
88
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) run_benchmarks
9-
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TOOLSET=clang-19 BUILD=debug run_tests
9+
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TAGS
10+
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TOOLSET=clang-20 BUILD=debug run_tests
1011
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TOOLSET=clang BUILD=sanitize run_tests
1112
# time make -rC ~/src/atomic_queue -j$(($(nproc)/2)) TOOLSET=clang run_benchmarks
1213
#
@@ -17,10 +18,10 @@
1718

1819
SHELL := /bin/bash
1920

20-
BUILD := release
21-
TOOLSET := gcc
21+
export BUILD := release
22+
export TOOLSET := gcc
2223

23-
BUILD_ROOT := $(or ${BUILD_ROOT},build)
24+
export BUILD_ROOT := $(or ${BUILD_ROOT},build)
2425
build_dir := ${BUILD_ROOT}/${BUILD}/${TOOLSET}
2526

2627
cxx.gcc := g++
@@ -172,11 +173,11 @@ run_benchmarks : ${build_dir}/benchmarks
172173
run_tests : ${build_dir}/tests
173174
@echo -n "$@ "; set -x; $< --log_level=warning
174175

175-
run_% : ${build_dir}/%
176+
run_% : ${build_dir}/% force
176177
@echo -n "$@ "; set -x; $<
177178

178-
rtags :
179-
${MAKE} --always-make --just-print all | { rtags-rc -c -; true; }
179+
compile_commands compile_commands.json TAGS :
180+
bear -- ${MAKE} --always-make --no-print-directory all
180181

181182
clean :
182183
rm -rf ${exes} ${build_dir}
@@ -189,7 +190,11 @@ env :
189190
uname --all
190191
env | sort --ignore-case
191192

192-
.PHONY : update_env_txt env versions rtags run_benchmarks clean all run_%
193+
# Prerequisites of .PHONY are always interpreted as literal target names, never as patterns (even if they contain ‘%’ characters). To always rebuild a pattern rule consider using a "force target".
194+
# If a rule has no prerequisites or recipe, and the target of the rule is a nonexistent file, then make imagines this target to have been updated whenever its rule is run. This implies that all targets depending on this one will always have their recipe run.
195+
force :
196+
197+
.PHONY : update_env_txt env versions run_benchmarks clean all compile_commands compile_commands.json TAGS run_tests
193198
.DELETE_ON_ERROR:
194199
.SECONDARY:
195200
.SUFFIXES:

0 commit comments

Comments
 (0)