Split the clean target into clean and clean_reproducible
This commit is contained in:
parent
017b038ac4
commit
239f050a4b
23
Makefile
23
Makefile
|
@ -111,13 +111,23 @@ ${bld}/makefile_file_targets: ${bld}/makefile_non_file_targets ${bld}/makefile_t
|
||||||
@comm -23 ${bld}/makefile_targets ${bld}/makefile_non_file_targets > $@
|
@comm -23 ${bld}/makefile_targets ${bld}/makefile_non_file_targets > $@
|
||||||
|
|
||||||
${built_directories}: ${bld}/check_makefile
|
${built_directories}: ${bld}/check_makefile
|
||||||
${more_built_directories}: Makefile Makefile.example-os Makefile.test-example-os
|
${more_built_directories}: ${Makefiles}
|
||||||
mkdir -p $@ && touch $@
|
mkdir -p $@ && touch $@
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: ${bld}/check_makefile
|
clean: clean_reproducible ${bld}/check_makefile
|
||||||
rm -f ${built_files} ${temp_files} ${bld}/${reproducible_os_filename}
|
rm -f ${built_files} ${temp_files}
|
||||||
if test -d ${bld}/reproducible; then \
|
for d in $$(echo ${more_built_directories} ${temp_directories} | tr ' ' '\n' | sort --reverse); do \
|
||||||
|
if test -e "$$d"; then \
|
||||||
|
rmdir "$$d"; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
|
||||||
|
.PHONY: clean_reproducible
|
||||||
|
clean_reproducible: ${bld}/check_makefile
|
||||||
|
# Calling make unconditionally would cause infinite recursion, so we
|
||||||
|
# first check whether there is anything to remove.
|
||||||
|
if test -d ${bld}/reproducible -o -f ${bld}/${reproducible_os_filename}; then \
|
||||||
unset MAKEFLAGS MAKELEVEL MAKE_TERMERR MFLAGS; \
|
unset MAKEFLAGS MAKELEVEL MAKE_TERMERR MFLAGS; \
|
||||||
make OS_FILENAME=${reproducible_os_filename} \
|
make OS_FILENAME=${reproducible_os_filename} \
|
||||||
BUILD_DIR=${bld}/reproducible \
|
BUILD_DIR=${bld}/reproducible \
|
||||||
|
@ -125,11 +135,6 @@ clean: ${bld}/check_makefile
|
||||||
COMMIT_TIMESTAMP_ISO_8601=${COMMIT_TIMESTAMP_ISO_8601} \
|
COMMIT_TIMESTAMP_ISO_8601=${COMMIT_TIMESTAMP_ISO_8601} \
|
||||||
clean; \
|
clean; \
|
||||||
fi
|
fi
|
||||||
for d in $$(echo ${more_built_directories} ${temp_directories} | tr ' ' '\n' | sort --reverse); do \
|
|
||||||
if test -e "$$d"; then \
|
|
||||||
rmdir "$$d"; \
|
|
||||||
fi; \
|
|
||||||
done
|
|
||||||
|
|
||||||
.gitignore: ${bld}/check_makefile
|
.gitignore: ${bld}/check_makefile
|
||||||
for f in ${built_files}; do echo "/$$f"; done | sort > $@
|
for f in ${built_files}; do echo "/$$f"; done | sort > $@
|
||||||
|
|
Loading…
Reference in New Issue
Block a user