diff mbox series

[4/6] libtraceevent: Have make clean honor the output (O=foo) directory

Message ID 20201209042120.699002789@goodmis.org (mailing list archive)
State Accepted
Headers show
Series libtraceevent: Clean up source directory | expand

Commit Message

Steven Rostedt Dec. 9, 2020, 4:19 a.m. UTC
From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

If "make O=/some/dir clean" is performed, the O=/some/dir is not honored,
and the clean is performed on the current directory. If O= is specified on
the command line, then the clean should perform the cleaning to that
directory.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 Makefile         | 4 ++--
 plugins/Makefile | 5 +++--
 2 files changed, 5 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 3f96c1c7b4d6..330c8339f023 100644
--- a/Makefile
+++ b/Makefile
@@ -255,8 +255,8 @@  install: install_lib
 
 clean: clean_plugins
 	$(call QUIET_CLEAN, libtraceevent) \
-		$(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd; \
-		$(RM) TRACEEVENT-CFLAGS tags TAGS; \
+		$(RM) $(OUTPUT)*.o $(OUTPUT)*~ $(TARGETS) $(OUTPUT)*.a $(OUTPUT)*.so $(VERSION_FILES) $(OUTPUT).*.d $(OUTPUT).*.cmd; \
+		$(RM) TRACEEVENT-CFLAGS $(OUTPUT)tags $(OUTPUT)TAGS; \
 		$(RM) $(PKG_CONFIG_FILE)
 
 PHONY += doc
diff --git a/plugins/Makefile b/plugins/Makefile
index 8ae3882f9051..a8868d01b09b 100644
--- a/plugins/Makefile
+++ b/plugins/Makefile
@@ -210,8 +210,9 @@  install: $(PLUGINS)
 
 clean:
 	$(call QUIET_CLEAN, trace_plugins) \
-		$(RM) *.o *~ $(TARGETS) *.a *.so $(VERSION_FILES) .*.d .*.cmd; \
-		$(RM) $(OUTPUT)libtraceevent-dynamic-list \
+		$(RM) $(OUTPUT)*.o $(OUTPUT)*~ $(TARGETS) $(OUTPUT)*.a $(OUTPUT)*.so $(VERSION_FILES) .*.d .*.cmd; \
+		$(RM) $(OUTPUT)libtraceevent-dynamic-list; \
+		$(RM) $(PLUGINS); \
 		$(RM) TRACEEVENT-CFLAGS tags TAGS;
 
 PHONY += force plugins