All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libtracefs: avoid pointless extra DEP stage
@ 2022-06-20 15:03 Jan Engelhardt
  2022-07-08 18:22 ` Steven Rostedt
  0 siblings, 1 reply; 5+ messages in thread
From: Jan Engelhardt @ 2022-06-20 15:03 UTC (permalink / raw)
  To: linux-trace-devel

Call the compiler only once per source file.
Reduces build time from 0.85 to 0.75 seconds for me.

Signed-off-by: Jan Engelhardt <jengelh@inai.de>
---
 scripts/utils.mk |  4 ++--
 src/Makefile     | 14 ++------------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/scripts/utils.mk b/scripts/utils.mk
index 5f43de1..b8a32a3 100644
--- a/scripts/utils.mk
+++ b/scripts/utils.mk
@@ -53,12 +53,12 @@ endif
 
 do_fpic_compile =					\
 	($(print_fpic_compile)				\
-	$(CC) -c $(CPPFLAGS) $(CFLAGS) $(EXT) -fPIC $< -o $@)
+	$(CC) -MMD -MP -c $(CPPFLAGS) $(CFLAGS) $(EXT) -fPIC $< -o $@)
 
 do_compile =							\
 	($(if $(GENERATE_PIC), $(do_fpic_compile),		\
 	 $(print_compile)					\
-	 $(CC) -c $(CPPFLAGS) $(CFLAGS) $(EXT) $< -o $@))
+	 $(CC) -MMD -MP -c $(CPPFLAGS) $(CFLAGS) $(EXT) $< -o $@))
 
 do_app_build =						\
 	($(print_app_build)				\
diff --git a/src/Makefile b/src/Makefile
index 645d518..3cd4263 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -48,24 +48,14 @@ sqlhist-lex.c: sqlhist.l sqlhist.tab.c
 $(bdir)/%.o: %.c
 	$(Q)$(call do_fpic_compile)
 
-$(DEPS): $(bdir)/.%.d: %.c
-	$(Q)$(CC) -M -MT $(bdir)/$*.o $(CPPFLAGS) $(CFLAGS) $< > $@
-
-$(OBJS): $(bdir)/%.o : $(bdir)/.%.d
-
 tracefs-sqlhist.o: sqlhist.tab.h
 
 $(OBJS): | $(bdir)
-$(DEPS): | $(bdir)
 
 clean:
-	$(Q)$(call do_clean,$(OBJS) .*.d)
+	$(Q)$(call do_clean,$(OBJS) *.d)
 
-dep_includes := $(wildcard $(DEPS))
-
-ifneq ($(dep_includes),)
-  include $(dep_includes)
-endif
+-include *.d
 
 $(bdir)/tracefs-sqlhist.o tracefs-sqlhist.o: sqlhist.tab.h
 
-- 
2.36.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-14 14:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-20 15:03 [PATCH] libtracefs: avoid pointless extra DEP stage Jan Engelhardt
2022-07-08 18:22 ` Steven Rostedt
2022-07-11 19:37   ` Jan Engelhardt
2022-07-11 20:52     ` [PATCH v2] " Jan Engelhardt
2022-07-14 14:46       ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.