mirror of
https://git.disroot.org/80486DX2-66/polonium.git
synced 2024-11-08 13:42:31 +05:30
Makefile: add target distclean
This commit is contained in:
parent
5a5d10b67d
commit
f4726c1d27
19
Makefile
19
Makefile
@ -51,6 +51,20 @@ define rmfiles_if_exist
|
||||
done
|
||||
endef
|
||||
|
||||
define rmdirs
|
||||
@for dir in $1; do \
|
||||
if [ -d "$$dir" ]; then \
|
||||
if [ -z "$$(find "$$dir" -mindepth 1 -maxdepth 1 -print -quit)" ]; \
|
||||
then \
|
||||
echo "Removing empty directory $$dir"; \
|
||||
else \
|
||||
echo "Removing non-empty directory $$dir"; \
|
||||
fi; \
|
||||
rm -r $$dir; \
|
||||
fi; \
|
||||
done
|
||||
endef
|
||||
|
||||
define rmdirs_if_empty
|
||||
@for dir in $1; do \
|
||||
if [ -d "$$dir" ]; then \
|
||||
@ -67,4 +81,7 @@ clean:
|
||||
$(call rmfiles_if_exist,$(EXECPATH) $(DEP) $(OBJ))
|
||||
$(call rmdirs_if_empty,$(BINDIR) $(OBJDIR))
|
||||
|
||||
.PHONY: all clean
|
||||
distclean:
|
||||
$(call rmdirs,$(BINDIR) $(OBJDIR))
|
||||
|
||||
.PHONY: all clean distclean
|
||||
|
Loading…
Reference in New Issue
Block a user