Skip to content

Commit ffbd489

Browse files
committed
Break makefile targets into smaller steps
1 parent e80cb8c commit ffbd489

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

Makefile

+11-4
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,15 @@ all: $(BINARY)
2323
$(BINARY): build-libgit2
2424
$(GOCMD) build $(GRV_BUILD_FLAGS) -o $(BINARY) $(GRV_SOURCE_DIR)
2525

26+
.PHONY: build-only
27+
build-only:
28+
make -C $(GIT2GO_DIR) install-static
29+
$(GOCMD) build $(GRV_BUILD_FLAGS) -o $(BINARY) $(GRV_SOURCE_DIR)
30+
31+
.PHONY: build-libgit2
32+
build-libgit2: apply-git2go-patch
33+
make -C $(GIT2GO_DIR) install-static
34+
2635
.PHONY: install
2736
install: $(BINARY)
2837
install -m755 -d $(GOBIN_DIR)
@@ -37,13 +46,11 @@ update-test:
3746
$(GOCMD) get github.com/golang/lint/golint
3847
$(GOCMD) get github.com/stretchr/testify/mock
3948

40-
.PHONY: build-libgit2
41-
build-libgit2: update
49+
.PHONY: apply-git2go-patch
50+
apply-git2go-patch: update
4251
if patch --dry-run -N -d $(GIT2GO_DIR) -p1 < $(GIT2GO_PATCH) >/dev/null; then \
4352
patch -d $(GIT2GO_DIR) -p1 < $(GIT2GO_PATCH); \
4453
fi
45-
cd $(GIT2GO_DIR) && git submodule update --init;
46-
make -C $(GIT2GO_DIR) install-static
4754

4855
# Only tested on Ubuntu.
4956
# Requires dependencies static library versions to be present alongside dynamic ones

0 commit comments

Comments
 (0)