Diff options
Diffstat (limited to '')
-rw-r--r--Makefile16
1 file changed, 12 insertions, 4 deletions
diff --git a/Makefile b/Makefile
index ac07b26..9f8d0f4 100644
--- a/Makefile
+++ b/Makefile
@@ -67,6 +67,7 @@ INSTALL = install
export CGIT_VERSION CGIT_SCRIPT_NAME CGIT_SCRIPT_PATH
export CGIT_DATA_PATH CGIT_CONFIG CACHE_ROOT
+.PHONY: all
all: cgit
# NO_GETTEXT and NO_TCLTK leave out Git's translations and its Tcl tools, none
@@ -84,30 +85,36 @@ GIT_BUILD_FLAGS = NO_CURL=1 NO_GETTEXT=1 NO_OPENSSL=1 NO_RUST=1 NO_TCLTK=1 prefi
# two builds of the same sources would differ.
export ZERO_AR_DATE = 1
+.PHONY: cgit
cgit:
+@$(MAKE) -C $(GITDIR) -f $(CGIT_ROOT)/$(SRCDIR)/cgit.mk \
$(CGIT_ROOT)/$(BUILDDIR)/cgit $(EXTRA_GIT_TARGETS) $(GIT_BUILD_FLAGS)
# The same program without Lua, built beside the full one so a change cannot
# break that configuration unnoticed. The suite runs both.
+.PHONY: cgit-nolua
cgit-nolua:
+@$(MAKE) -C $(GITDIR) -f $(CGIT_ROOT)/$(SRCDIR)/cgit.mk \
$(CGIT_ROOT)/$(BUILDDIR)/nolua/cgit NO_LUA=1 BUILDDIR=$(BUILDDIR)/nolua $(GIT_BUILD_FLAGS)
+.PHONY: sparse
sparse:
+@$(MAKE) -C $(GITDIR) -f $(CGIT_ROOT)/$(SRCDIR)/cgit.mk $(GIT_BUILD_FLAGS) cgit-sparse
# The two builds share the Git tree, so they are made one after the other
# even under -j.
+.PHONY: test
test: cgit-with-git
+@$(MAKE) cgit-nolua
+@$(MAKE) -C tests all
# The test helpers link against a fully built Git tree, so this asks the sub
# make for Git's own all target alongside cgit.
+.PHONY: cgit-with-git
cgit-with-git:
+@$(MAKE) cgit EXTRA_GIT_TARGETS=all
+.PHONY: install
install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(CGIT_SCRIPT_PATH)
$(INSTALL) -m 0755 $(BUILDDIR)/cgit $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
@@ -116,6 +123,7 @@ install: all
$(INSTALL) -m 0755 -d $(DESTDIR)$(filterdir)
$(INSTALL) -m 0644 $(addprefix $(EXTDIR)/,$(FILTER_FILES)) $(DESTDIR)$(filterdir)
+.PHONY: uninstall
uninstall:
$(RM) $(DESTDIR)$(CGIT_SCRIPT_PATH)/$(CGIT_SCRIPT_NAME)
$(RM) $(addprefix $(DESTDIR)$(CGIT_DATA_PATH)/,$(ASSETS))
@@ -125,15 +133,18 @@ uninstall:
# cleaning removes both. The descent into tests is guarded because
# tests/Makefile includes git's config.mak.uname, which needs the submodule
# present.
+.PHONY: clean
clean:
$(RM) -r $(BUILDDIR)
@if test -e $(GITDIR)/config.mak.uname; then $(MAKE) -C tests clean; fi
+.PHONY: cleanall
cleanall: clean
@if test -e $(GITDIR)/Makefile; then $(MAKE) -C $(GITDIR) clean; fi
# The tarball is checked against its sum before anything is unpacked from it.
# An older macOS has no sha256sum, but its shasum reads the same format.
+.PHONY: get-git
get-git:
mkdir -p $(dir $(GITDIR))
curl -fL -o $(GIT_TARBALL) $(GIT_URL)
@@ -142,10 +153,7 @@ get-git:
tar -xJf $(GIT_TARBALL) && rm -rf $(GITDIR) && mv git-$(GIT_VERSION) $(GITDIR)
$(RM) $(GIT_TARBALL)
+.PHONY: tags
tags:
@mkdir -p $(BUILDDIR)
find $(SRCDIR) -name '*.[ch]' | xargs ctags -f $(BUILDDIR)/tags
-
-.PHONY: all cgit cgit-with-git cgit-nolua sparse test
-.PHONY: install uninstall
-.PHONY: clean cleanall get-git tags