build: fix 'clean' target

This fixes removal of TOOLS as well as HOSTPROGS declared in the
top-level Makefile.  The clean target in common.mak needs to be
eval'd since the variables used within are reset for each library.

(cherry picked from commit 395c3feb3b)

Conflicts:

	common.mak
	library.mak

Signed-off-by: Diego Biurrun <diego@biurrun.de>
This commit is contained in:
Diego Biurrun 2013-01-03 15:30:22 +01:00
parent dcf8f259d1
commit 26b177b8f7
3 changed files with 10 additions and 3 deletions

View File

@ -172,7 +172,6 @@ uninstall-data:
clean::
$(RM) $(ALLPROGS)
$(RM) $(CLEANSUFFIXES)
$(RM) $(TOOLS)
$(RM) $(CLEANSUFFIXES:%=tools/%)
distclean::

View File

@ -49,4 +49,13 @@ CLEANSUFFIXES = *.d *.o *~ *.ho *.map *.ver
DISTCLEANSUFFIXES = *.pc
LIBSUFFIXES = *.a *.lib *.so *.so.* *.dylib *.dll *.def *.dll.a *.exp
define RULES
clean::
$(RM) $(OBJS) $(OBJS:.o=.d)
$(RM) $(HOSTPROGS)
$(RM) $(TOOLS)
endef
$(eval $(RULES))
-include $(wildcard $(OBJS:.o=.d) $(TESTOBJS:.o=.d))

View File

@ -47,8 +47,7 @@ $(SUBDIR)$(SLIBNAME_WITH_MAJOR): $(OBJS) $(SUBDIR)lib$(NAME).ver $(DEP_LIBS)
clean::
$(RM) $(addprefix $(SUBDIR),*-example$(EXESUF) *-test$(EXESUF) $(CLEANFILES) $(CLEANSUFFIXES) $(LIBSUFFIXES)) \
$(foreach dir,$(DIRS),$(CLEANSUFFIXES:%=$(SUBDIR)$(dir)/%)) \
$(HOSTOBJS) $(HOSTPROGS)
$(foreach dir,$(DIRS),$(CLEANSUFFIXES:%=$(SUBDIR)$(dir)/%))
distclean:: clean
$(RM) $(DISTCLEANSUFFIXES:%=$(SUBDIR)%) \