makefile: refactor "clean" target; add "distclean"
All checks were successful
continuous-integration/drone/push Build is passing

* clean now just removes the object files, dwo debugging objects, .cmake
  and intermediary .bin files but keeps CMakeCache and similar
* a new target - distclean - is introduced to do what was previously
  done by "clean", essentially: completely remove the build folders
This commit is contained in:
surtur 2021-12-05 15:27:47 +01:00
parent 7f05984946
commit b14600c352
Signed by: wanderer
GPG Key ID: 19CE1EC1D9E0486D

View File

@ -14,7 +14,7 @@ v_env = VALGRIND=
v_db = $(d_folder)_valgr
v_rl = $(r_folder)_valgr
.PHONY: check tidy build debug release valgrind san test clean
.PHONY: check tidy build debug release valgrind san test clean distclean
debug:
if [ ! -d "$(d_folder)" ]; then mkdir -pv $(d_folder); fi
@ -62,5 +62,8 @@ build: debug
test: check build
clean:
find . -iwholename '*cmake*' -not -name CMakeLists.txt -delete
@find . -regextype posix-egrep -regex ".*\.(o|dwo|out|bin|cmake)" -delete
distclean:
@find . -iwholename '*cmake*' -not -name CMakeLists.txt -delete