Skip to content

Commit 029bac0

Browse files
avargitster
authored andcommitted
Makefile: add {program,xdiff,test,git,fuzz}-objs & objects targets
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/[email protected]/ Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent abc3c87 commit 029bac0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,8 @@ ETAGS_TARGET = TAGS
669669
FUZZ_OBJS += fuzz-commit-graph.o
670670
FUZZ_OBJS += fuzz-pack-headers.o
671671
FUZZ_OBJS += fuzz-pack-idx.o
672+
.PHONY: fuzz-objs
673+
fuzz-objs: $(FUZZ_OBJS)
672674

673675
# Always build fuzz objects even if not testing, to prevent bit-rot.
674676
all:: $(FUZZ_OBJS)
@@ -686,6 +688,8 @@ PROGRAM_OBJS += http-backend.o
686688
PROGRAM_OBJS += imap-send.o
687689
PROGRAM_OBJS += sh-i18n--envsubst.o
688690
PROGRAM_OBJS += shell.o
691+
.PHONY: program-objs
692+
program-objs: $(PROGRAM_OBJS)
689693

690694
# Binary suffix, set to .exe for Windows builds
691695
X =
@@ -2386,13 +2390,19 @@ XDIFF_OBJS += xdiff/xmerge.o
23862390
XDIFF_OBJS += xdiff/xpatience.o
23872391
XDIFF_OBJS += xdiff/xprepare.o
23882392
XDIFF_OBJS += xdiff/xutils.o
2393+
.PHONY: xdiff-objs
2394+
xdiff-objs: $(XDIFF_OBJS)
23892395

23902396
TEST_OBJS := $(patsubst %$X,%.o,$(TEST_PROGRAMS)) $(patsubst %,t/helper/%,$(TEST_BUILTINS_OBJS))
2397+
.PHONY: test-objs
2398+
test-objs: $(TEST_OBJS)
23912399

23922400
GIT_OBJS += $(LIB_OBJS)
23932401
GIT_OBJS += $(BUILTIN_OBJS)
23942402
GIT_OBJS += common-main.o
23952403
GIT_OBJS += git.o
2404+
.PHONY: git-objs
2405+
git-objs: $(GIT_OBJS)
23962406

23972407
OBJECTS += $(GIT_OBJS)
23982408
OBJECTS += $(PROGRAM_OBJS)
@@ -2402,6 +2412,8 @@ OBJECTS += $(FUZZ_OBJS)
24022412
ifndef NO_CURL
24032413
OBJECTS += http.o http-walker.o remote-curl.o
24042414
endif
2415+
.PHONY: objects
2416+
objects: $(OBJECTS)
24052417

24062418
dep_files := $(foreach f,$(OBJECTS),$(dir $f).depend/$(notdir $f).d)
24072419
dep_dirs := $(addsuffix .depend,$(sort $(dir $(OBJECTS))))

0 commit comments

Comments
 (0)