From 0a47a506c73f56a003d478c6b27f147d2a2ecb31 Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Fri, 2 Nov 2007 13:33:04 +0100 Subject: Extend Makefile to support updating repositories with subsequent bare make invocations. --- Makefile | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 9775eb1..b2072eb 100644 --- a/Makefile +++ b/Makefile @@ -19,10 +19,16 @@ all: $(underlays) $(dummies) $(underlays): locale=$(if $(filter l10n/,$(lastword $(subst _, ,$(dir $@)))),$(notdir $@)) $(underlays): underlay=$(@:%_l10n/$(locale)=%) $(underlays): - mkdir -p $@ - cd $@ && git init - cd $@ && git remote add -f -t $(master) -m $(master) origin $(origin) - cd $@ && git merge origin + @mkdir -p $@ + @if [ -d "$@/.git" ]; then \ + cd $@ && \ + git pull; \ + else \ + cd $@ && \ + git init && \ + git remote add -f -t $(master) -m $(master) origin $(origin) && \ + git merge origin; \ + fi $(dummies): mkdir -p $@ @@ -32,3 +38,5 @@ ultraclean: rm -rf $(underlays) rm -rf $(dir $(underlays_l10n)) rm -rf $(dummies) + +.PHONY: $(underlays) -- cgit v1.2.3