-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile.clean_unmade
19 lines (16 loc) · 992 Bytes
/
Makefile.clean_unmade
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# http://stackoverflow.com/a/18137056/377022
Makefile_mkfile_path := $(abspath $(lastword $(MAKEFILE_LIST)))
Makefile_mkfile_dir := $(patsubst %/,%,$(dir $(Makefile_mkfile_path)))
include $(Makefile_mkfile_dir)/Makefile.vo_closure
RECURSIVELY_ALL_MADE_VO_FILES := $(call vo_closure,$(addsuffix .vo,$(basename $(filter %.vio %.vi %.vo,$(RECURSIVE_TARGETS_WITHOUT_CLEAN_UNMADE)))))
PRE_FILES_TO_REMOVE := $(filter-out $(basename $(RECURSIVELY_ALL_MADE_VO_FILES)),$(basename $(VOFILES)))
FILES_TO_REMOVE := $(wildcard $(addsuffix .vo,$(PRE_FILES_TO_REMOVE)) $(addsuffix .vi,$(PRE_FILES_TO_REMOVE)) $(addsuffix .vio,$(PRE_FILES_TO_REMOVE)))
ifneq (,$(FILES_TO_REMOVE))
clean-unmade::
@ echo "Warning: clean-unmade probably will not do what you want it to; I couldn't get it working"
rm -f $(FILES_TO_REMOVE)
else
clean-unmade::
@ echo "Warning: clean-unmade probably will not do what you want it to; I couldn't get it working"
@ echo "No outdated .vo files which will not be remade"
endif