Skip to content

Commit

Permalink
Merge pull request #9 from make-files/simplify-clean
Browse files Browse the repository at this point in the history
Refactor "make clean" to use git clean
  • Loading branch information
ezzatron authored Jan 30, 2020
2 parents c155ee7 + 0c22f6c commit c56f5b5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion include/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ GENERATED_FILES +=
# the files in GENERATED_FILES are up-to-date.
CI_VERIFY_GENERATED_FILES ?= true

# CLEAN_EXCLUSIONS is a space separated list of gitignore patterns to exclude
# from being removed by "make clean".
CLEAN_EXCLUSIONS +=

# GIT_HEAD_HASH_FULL is the full-length hash of the HEAD commit.
#
# GIT_HEAD_HASH is the abbreviated (7-character) hash of the HEAD commit.
Expand Down Expand Up @@ -85,7 +89,8 @@ endif
# global ignore configurations.
.PHONY: clean-ignored
clean-ignored::
git-find-ignored '*' | xargs -t -n1 rm -rf --
$(eval _EXCLUSION_ARGS := $(foreach EXCLUSION,$(CLEAN_EXCLUSIONS),--exclude "!$(EXCLUSION)"))
git -c core.excludesfile= clean -dX --force $(_EXCLUSION_ARGS)

# regenerate --- Removes and regenerates all files in the GENERATED_FILES list.
.PHONY: regenerate
Expand Down

0 comments on commit c56f5b5

Please sign in to comment.