Don't clean folders without Makefile

This commit is contained in:
2020-03-17 12:09:42 +01:00
parent 61894c4588
commit 14408c1993
+28 -24
View File
@@ -179,18 +179,20 @@ clean:
true; \
else \
for dir in $(SUBDIRS); do \
depth=$(MAKELEVEL); \
while [ $${depth} -gt 0 ] ; do \
echo -n " "; \
depth=`expr $$depth - 1`; \
done; \
echo " <$$dir>"; \
$(MAKE) -s -S -C $$dir $@ $(ARCH); \
while [ $${depth} -gt 0 ] ; do \
echo -n " "; \
depth=`expr $$depth - 1`; \
done; \
echo " </$$dir>"; \
if [ -e "$$dir/Makefile" ]; then \
depth=$(MAKELEVEL); \
while [ $${depth} -gt 0 ] ; do \
echo -n " "; \
depth=`expr $$depth - 1`; \
done; \
echo " <$$dir>"; \
$(MAKE) -s -S -C $$dir $@ $(ARCH); \
while [ $${depth} -gt 0 ] ; do \
echo -n " "; \
depth=`expr $$depth - 1`; \
done; \
echo " </$$dir>"; \
fi \
done; \
for target in $(TARGETS); do \
rm -f $$target.$(ARCH); \
@@ -210,18 +212,20 @@ cleandeps:
true; \
else \
for dir in $(SUBDIRS); do \
depth=$(MAKELEVEL); \
while [ $${depth} -gt 0 ] ; do \
echo -n " "; \
depth=`expr $$depth - 1`; \
done; \
echo " <$$dir>"; \
$(MAKE) -s -S -C $$dir $@ $(ARCH); \
while [ $${depth} -gt 0 ] ; do \
echo -n " "; \
depth=`expr $$depth - 1`; \
done; \
echo " </$$dir>"; \
if [ -e "$$dir/Makefile" ]; then \
depth=$(MAKELEVEL); \
while [ $${depth} -gt 0 ] ; do \
echo -n " "; \
depth=`expr $$depth - 1`; \
done; \
echo " <$$dir>"; \
$(MAKE) -s -S -C $$dir $@ $(ARCH); \
while [ $${depth} -gt 0 ] ; do \
echo -n " "; \
depth=`expr $$depth - 1`; \
done; \
echo " </$$dir>"; \
fi \
done; \
for target in $(TARGETS); do \
rm -f $$target.$(ARCH); \