summaryrefslogtreecommitdiff
path: root/make
diff options
context:
space:
mode:
Diffstat (limited to 'make')
-rw-r--r--make/git.mk10
-rw-r--r--make/rules.mk3
2 files changed, 4 insertions, 9 deletions
diff --git a/make/git.mk b/make/git.mk
index 068e7f3..0059448 100644
--- a/make/git.mk
+++ b/make/git.mk
@@ -17,13 +17,9 @@ update:
$(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" && git checkout "$(branch)" && git merge --no-commit "$(origin)" &&) git checkout "$(master)")
init:
-# Assume that initial cloning is done already when invoking this target
-# git init
-# git remote add -f -t "$(master)" -m "$(master)" origin "$(origin)"
-# git merge origin
+ git init
+ git remote add -f -m "$(master)" origin "$(origin)"
+ git merge origin
# git config remote.origin.push +"refs/heads/$(master)":"refs/heads/$(master)"
- $(if $(filter $(currentbranch),$(master)),,git branch -f "$(master)" "$(origin)/$(master)")
- $(if $(noncurrentbranches),$(foreach branch,$(noncurrentbranches),git branch -f "$(branch)" "$(origin)/$(branch)" &&) true)
- $(if $(filter $(currentbranch),$(master)),,git checkout -f "$(master)")
.PHONY: update init
diff --git a/make/rules.mk b/make/rules.mk
index 2dcfc96..973af61 100644
--- a/make/rules.mk
+++ b/make/rules.mk
@@ -21,14 +21,13 @@ ifneq ($(2),)
$(1): $$(subst module,$(3),$$(masterdir))
endif
-$(1): action = $$(if $(wildcard $(1)/.git),update,init)
$(1): origin = $$(if $(2),$(3),$$(subst MODULE,$(3),$$($(4)_ORIGIN)))
$(1): master = $$(subst -LOCALE,$(2:%=-$(2)),$$($(4)_BRANCH))
$(1): branches = $$(if $(2),,$$(filter-out $$(master),$$($(3)_BRANCHES)))
$(1):
@[ -d "$$(dir $$@)" ] || ( echo mkdir -p "$$(dir $$@)" && mkdir -p "$$(dir $$@)" )
@[ -d "$$@" ] || ( echo git clone "$$(origin)" "$$@" && git clone -o "$(4)" "$$(origin)" "$$@" )
- @$(MAKE) -f "$$(CURDIR)/make/git.mk" -C "$$@" master="$$(master)" branches="$$(branches)" origin="$(4)" "$$(action)"
+ @$(MAKE) -f "$$(CURDIR)/make/git.mk" -C "$$@" master="$$(master)" branches="$$(branches)" origin="$(4)" update
# WARNING: this may wipe unrelated files too!
ultraclean::