瀏覽代碼

Clean all subdirs on 'make clean'

Eric Andersen 23 年之前
父節點
當前提交
cfcf2c267b
共有 1 個文件被更改,包括 3 次插入2 次删除
  1. 3 2
      libc/stdlib/Makefile

+ 3 - 2
libc/stdlib/Makefile

@@ -25,6 +25,7 @@ include $(TOPDIR)Rules.mak
 LIBC=$(TOPDIR)libc.a
 
 DIRS = $(MALLOC)
+ALL_SUBDIRS = $(shell find * -type d -prune -name [a-z]\*)
 
 MSRC=strto_l.c
 MOBJ=strtol.o strtoul.o strto_l.o
@@ -72,12 +73,12 @@ $(COBJS): %.o : %.c
 $(OBJ): Makefile
 
 subdirs: $(patsubst %, _dir_%, $(DIRS))
-subdirs_clean: $(patsubst %, _dirclean_%, $(DIRS))
+subdirs_clean: $(patsubst %, _dirclean_%, $(ALL_SUBDIRS))
 
 $(patsubst %, _dir_%, $(DIRS)) : dummy
 	$(MAKE) -C $(patsubst _dir_%, %, $@)
 
-$(patsubst %, _dirclean_%, $(DIRS)) : dummy
+$(patsubst %, _dirclean_%, $(ALL_SUBDIRS)) : dummy
 	$(MAKE) -C $(patsubst _dirclean_%, %, $@) clean
 
 clean: subdirs_clean