trace-cmd: Fix build dependencies
PATCH 1/1 trace-cmd: Fix build dependencies
From: "Steven Rostedt (VMware)" <[email protected]>
After having trace-cmd break because not all proper files are being compiled when needed, I looked into why the dependencies were not working. I found that the .foo.d files that were being created required having the full path of the object file in them. Without that, the dependencies were being ignored.
By adding "-MT $(bdir)/$*.o", to the dependency creating rules, the full path would be added to targets for the object files, and this makes the depencies work again.
Fixes 60f0a40bb ("trace-cmd: Make libtraceevent buildable out-of-tree")
Signed-off-by Steven Rostedt (VMware) <[email protected]>
--- lib/trace-cmd/Makefile | 2 +- lib/trace-cmd/plugins/Makefile | 2 +- lib/traceevent/Makefile | 2 +- lib/traceevent/plugins/Makefile | 2 +- lib/tracefs/Makefile | 2 +- tracecmd/Makefile | 2 +- utest/Makefile | 1 + 7 files changed, 7 insertions(+), 6 deletions(-)
lib/trace-cmd/Makefile +1 -1
@@ -45,7 +45,7 @@ $(bdir)/%.o: %.c $(Q)$(call do_fpic_compile) $(DEPS): $(bdir)/.%.d: %.c - $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@ + $(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@ $(OBJS): $(bdir)/%.o : $(bdir)/.%.d
lib/trace-cmd/plugins/Makefile +1 -1
@@ -26,7 +26,7 @@ $(PLUGIN_BUILD): $(bdir)/%.so: $(bdir)/%.o $(Q)$(do_plugin_build) $(DEPS): $(bdir)/.%.d: %.c - $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@ + $(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@ $(PLUGIN_OBJS): $(bdir)/%.o : $(bdir)/.%.d
lib/traceevent/Makefile +1 -1
@@ -37,7 +37,7 @@ $(bdir)/%.o: %.c $(Q)$(call do_fpic_compile) $(DEPS): $(bdir)/.%.d: %.c - $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@ + $(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@ $(OBJS): $(bdir)/%.o : $(bdir)/.%.d
lib/traceevent/plugins/Makefile +1 -1
@@ -40,7 +40,7 @@ $(PLUGIN_BUILD): $(bdir)/%.so: $(bdir)/%.o $(Q)$(do_plugin_build) $(DEPS): $(bdir)/.%.d: %.c - $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@ + $(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@ $(PLUGIN_OBJS): $(bdir)/%.o : $(bdir)/.%.d
lib/tracefs/Makefile +1 -1
@@ -34,7 +34,7 @@ $(bdir)/%.o: %.c $(Q)$(call do_fpic_compile) $(DEPS): $(bdir)/.%.d: %.c - $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@ + $(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@ $(OBJS): $(bdir)/%.o : $(bdir)/.%.d
tracecmd/Makefile +1 -1
@@ -70,7 +70,7 @@ $(bdir)/%.o: %.c $(Q)$(call do_compile) $(all_deps): $(bdir)/.%.d: %.c - $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@ + $(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@ $(all_deps): $(TC_VERSION)
utest/Makefile +1 -0
@@ -30,6 +30,7 @@ $(bdir)/%.o: %.c $(DEPS): $(bdir)/.%.d: %.c $(Q)$(CC) -M $(CPPFLAGS) $(CFLAGS) $< > $@ + $(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@ $(OBJS): $(bdir)/%.o : $(bdir)/.%.d
Signature · 1 line
2.25.4