build: simplify commands for clean target
authorMans Rullgard <mans@mansr.com>
Fri, 3 Jun 2011 14:50:14 +0000 (15:50 +0100)
committerMans Rullgard <mans@mansr.com>
Fri, 3 Jun 2011 18:33:32 +0000 (19:33 +0100)
Signed-off-by: Mans Rullgard <mans@mansr.com>
subdir.mak

index 7fdeddc..1d5824b 100644 (file)
@@ -50,12 +50,12 @@ endif
 
 clean::
        $(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
-           $(addprefix $(SUBDIR), $(foreach suffix,$(CLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS)))) \
+           $(foreach dir,$(DIRS),$(CLEANSUFFIXES:%=$(SUBDIR)$(dir)/%)) \
            $(HOSTOBJS) $(HOSTPROGS)
 
 distclean:: clean
-       $(RM)  $(addprefix $(SUBDIR),$(DISTCLEANSUFFIXES)) \
-            $(addprefix $(SUBDIR), $(foreach suffix,$(DISTCLEANSUFFIXES),$(addsuffix /$(suffix),$(DIRS))))
+       $(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) \
+           $(foreach dir,$(DIRS),$(DISTCLEANSUFFIXES:%=$(SUBDIR)$(dir)/%))
 
 install-lib$(NAME)-shared: $(SUBDIR)$(SLIBNAME)
        $(Q)mkdir -p "$(SHLIBDIR)"