git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH v3 5/6] Makefile: add {program,xdiff,test,git,fuzz}-objs & objects targets

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Feb 23, 2021, 11:41 UTC
Message-ID
<20210223114132.24345-6-avarab@gmail.com>
In-Reply-To
<20210201111715.10200-1-avarab@gmail.com>

Add targets to compile the various *.o files we declared in commonly used *_OBJS variables. This is useful for debugging purposes, to e.g. get to the point where we can compile a git.o. See [1] for a use-case for this target.

https://lore.kernel.org/git/YBCGtd9if0qtuQxx@coredump.intra.peff.net/
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff --git a/Makefile b/Makefile
index 8b087f68b3f..10f7baa74b0 100644
--- a/Makefile
+++ b/Makefile
@@ -662,6 +662,8 @@ ETAGS_TARGET = TAGS
 FUZZ_OBJS += fuzz-commit-graph.o
 FUZZ_OBJS += fuzz-pack-headers.o
 FUZZ_OBJS += fuzz-pack-idx.o
+.PHONY: fuzz-objs
+fuzz-objs: $(FUZZ_OBJS)
 
 # Always build fuzz objects even if not testing, to prevent bit-rot.
 all:: $(FUZZ_OBJS)
@@ -679,6 +681,8 @@ PROGRAM_OBJS += http-backend.o
 PROGRAM_OBJS += imap-send.o
 PROGRAM_OBJS += sh-i18n--envsubst.o
 PROGRAM_OBJS += shell.o
+.PHONY: program-objs
+program-objs: $(PROGRAM_OBJS)
 
 # Binary suffix, set to .exe for Windows builds
 X =
@@ -2372,13 +2376,19 @@ XDIFF_OBJS += xdiff/xmerge.o
 XDIFF_OBJS += xdiff/xpatience.o
 XDIFF_OBJS += xdiff/xprepare.o
 XDIFF_OBJS += xdiff/xutils.o
+.PHONY: xdiff-objs
+xdiff-objs: $(XDIFF_OBJS)
 
 TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
+.PHONY: test-objs
+test-objs: $(TEST_OBJS)
 
 GIT_OBJS += $(LIB_OBJS)
 GIT_OBJS += $(BUILTIN_OBJS)
 GIT_OBJS += common-main.o
 GIT_OBJS += git.o
+.PHONY: git-objs
+git-objs: $(GIT_OBJS)
 
 OBJECTS += $(GIT_OBJS)
 OBJECTS += $(PROGRAM_OBJS)
@@ -2388,6 +2398,8 @@ OBJECTS += $(FUZZ_OBJS)
 ifndef NO_CURL
 	OBJECTS += http.o http-walker.o remote-curl.o
 endif
+.PHONY: objects
+objects: $(OBJECTS)
 
 dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
 dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))
-- 
2.30.0.284.gd98b1dd5eaa7
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 23 of 39 in “Makefile: micro-optimize light non-test builds”
  1. 0/4 Makefile: micro-optimize light non-test buildsÆvar Arnfjörð Bjarmason, Jan 26, 2021
  2. 1/4 Makefile: refactor assignment for subsequent changeÆvar Arnfjörð Bjarmason, Jan 26, 2021
  3. Junio C HamanoJan 27, 2021
  4. 3/4 Makefile: add a NO_TEST_TOOLS flagÆvar Arnfjörð Bjarmason, Jan 26, 2021
  5. 4/4 Makefile: add a NO_{INSTALL_,}SCRIPT_FALLBACKS targetÆvar Arnfjörð Bjarmason, Jan 26, 2021
  6. 2/4 Makefile: refactor for subsequent changeÆvar Arnfjörð Bjarmason, Jan 26, 2021
  7. Jeff KingJan 26, 2021
  8. Junio C HamanoJan 27, 2021
  9. Jeff KingJan 27, 2021
  10. Junio C HamanoJan 27, 2021
  11. 0/6 Makefile: add {program,xdiff,test,git}-objs & objects targetsÆvar Arnfjörð Bjarmason, Jan 28, 2021
  12. 0/6 Makefile: add {program,xdiff,test,git}-objs & objects targetsÆvar Arnfjörð Bjarmason, Feb 1, 2021
  13. Junio C HamanoFeb 3, 2021
  14. Jeff KingFeb 4, 2021
  15. Junio C HamanoFeb 4, 2021
  16. 0/6 Makefile: add {program,xdiff,test,git,fuzz}-objs & objects targetsÆvar Arnfjörð Bjarmason, Feb 23, 2021
  17. Junio C HamanoFeb 23, 2021
  18. Jeff KingFeb 23, 2021
  19. 1/6 Makefile: guard against TEST_OBJS in the environmentÆvar Arnfjörð Bjarmason, Feb 23, 2021
  20. 2/6 Makefile: split up long OBJECTS lineÆvar Arnfjörð Bjarmason, Feb 23, 2021
  21. 4/6 Makefile: split OBJECTS into OBJECTS and GIT_OBJSÆvar Arnfjörð Bjarmason, Feb 23, 2021
  22. 3/6 Makefile: sort OBJECTS assignment for subsequent changeÆvar Arnfjörð Bjarmason, Feb 23, 2021
  23. 5/6 Makefile: add {program,xdiff,test,git,fuzz}-objs & objects targetsÆvar Arnfjörð Bjarmason, Feb 23, 2021
  24. 6/6 Makefile: build "$(FUZZ_OBJS)" in CI, not under "all"Ævar Arnfjörð Bjarmason, Feb 23, 2021
  25. Jeff KingFeb 23, 2021
  26. Junio C HamanoFeb 23, 2021
  27. Ævar Arnfjörð BjarmasonFeb 28, 2021
  28. Jeff KingMar 1, 2021
  29. 1/6 Makefile: remove "all" on "$(FUZZ_OBJS)"Ævar Arnfjörð Bjarmason, Feb 1, 2021
  30. Jeff KingFeb 4, 2021
  31. 3/6 Makefile: split up long OBJECTS lineÆvar Arnfjörð Bjarmason, Feb 1, 2021
  32. 2/6 Makefile: guard against TEST_OBJS in the environmentÆvar Arnfjörð Bjarmason, Feb 1, 2021
  33. 4/6 Makefile: sort OBJECTS assignment for subsequent changeÆvar Arnfjörð Bjarmason, Feb 1, 2021
  34. 6/6 Makefile: add {program,xdiff,test,git}-objs & objects targetsÆvar Arnfjörð Bjarmason, Feb 1, 2021
  35. Junio C HamanoFeb 1, 2021
  36. 5/6 Makefile: split OBJECTS into OBJECTS and GIT_OBJSÆvar Arnfjörð Bjarmason, Feb 1, 2021
  37. 1/6 Makefile: remove "all" on "$(FUZZ_OBJS)"Ævar Arnfjörð Bjarmason, Jan 28, 2021
  38. 2/6 Makefile: guard against TEST_OBJS in the environmentÆvar Arnfjörð Bjarmason, Jan 28, 2021
  39. Junio C HamanoJan 29, 2021

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.