@@ -365,11 +365,12 @@ samples: $(LIBTRACEFS_STATIC) force
$(Q)$(call descend,$(src)/samples,all)
clean:
- $(MAKE) -C $(src)/utest clean
- $(MAKE) -C $(src)/src clean
- $(MAKE) -C $(src)/samples clean
- $(RM) $(TARGETS) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.so.* $(bdir)/*.o $(bdir)/.*.d
- $(RM) $(PKG_CONFIG_FILE)
- $(RM) $(VERSION_FILE)
+ $(Q)$(MAKE) -C $(src)/utest clean
+ $(Q)$(MAKE) -C $(src)/src clean
+ $(Q)$(MAKE) -C $(src)/samples clean
+ $(Q)$(call do_clean, \
+ $(TARGETS) $(bdir)/*.a $(bdir)/*.so $(bdir)/*.so.* $(bdir)/*.o $(bdir)/.*.d \
+ $(PKG_CONFIG_FILE) \
+ $(VERSION_FILE))
.PHONY: clean
@@ -66,4 +66,4 @@ $(EXAMPLES): $(patsubst %,$(bdir)/%,$(TARGETS))
$(CC) -g -Wall $(CFLAGS) -c -o $@ $^ -I../include/ $(LIBTRACEEVENT_INCLUDES)
clean:
- $(RM) $(bdir)/*
+ $(Q)$(call do_clean,$(bdir)/*)
@@ -2,9 +2,11 @@
# Utils
+ PWD := $(shell /bin/pwd)
GOBJ = $(notdir $(strip $@))
BASE1 = $(notdir $(strip $1))
BASE2 = $(notdir $(strip $2))
+ BASEPWD = $(notdir $(strip $(PWD)))
ifeq ($(VERBOSE),1)
@@ -27,6 +29,7 @@ ifeq ($(findstring 1,$(SILENT)$(VERBOSE)),1)
print_uninstall =
print_update =
print_descend =
+ print_clean =
else
print_compile = echo ' COMPILE '$(GOBJ);
print_app_build = echo ' BUILD '$(GOBJ);
@@ -39,6 +42,7 @@ else
print_uninstall = echo ' UNINSTALL $(DESTDIR_SQ)$1';
print_update = echo ' UPDATE '$(GOBJ);
print_descend = echo ' DESCEND '$(BASE1) $(BASE2);
+ print_clean = echo ' CLEAN '$(BASEPWD);
endif
do_fpic_compile = \
@@ -78,6 +82,10 @@ do_python_plugin_build = \
($(print_plugin_build) \
$(CC) $< -shared $(LDFLAGS) $(PYTHON_LDFLAGS) -o $@)
+do_clean = \
+ ($(print_clean) \
+ $(RM) $1)
+
ifneq ($(findstring $(MAKEFLAGS), w),w)
PRINT_DIR = --no-print-directory
else
@@ -61,7 +61,7 @@ $(OBJS): | $(bdir)
$(DEPS): | $(bdir)
clean:
- $(RM) $(OBJS)
+ $(Q)$(call do_clean,$(OBJS))
dep_includes := $(wildcard $(DEPS))
@@ -40,4 +40,4 @@ dep_includes := $(wildcard $(DEPS))
test: $(TARGETS)
clean:
- $(RM) $(TARGETS) $(bdir)/*.o $(bdir)/.*.d
+ $(Q)$(call do_clean,$(TARGETS) $(bdir)/*.o $(bdir)/.*.d)