Permalink
Browse files

Makefile: add more git support

  • Loading branch information...
1 parent 69fd4cb commit 595b7112dff54e4d3b4d6a2c1ee8525ecaf22fc4 @presbrey presbrey committed Mar 9, 2012
Showing with 19 additions and 4 deletions.
  1. +19 −4 Makefile
View
@@ -1,11 +1,24 @@
-all: update
+all: update_submodules
make -C js/rdf all
make -C js/mashup all
-.PHONY: all update
+update: pull
-update:
- git submodule update --init
+update_submodules:
+ @@if [ -d .git ]; then \
+ if git submodule status | grep -q -E '^-'; then \
+ git submodule update --init --recursive; \
+ else \
+ git submodule update --init --recursive --merge; \
+ fi; \
+ fi;
+
+pull_submodules:
+ @@git submodule foreach "git pull \$$(git config remote.origin.url)"
+ @@git submodule summary
+
+pull: pull_submodules
+ @@git pull ${REMOTE} ${BRANCH}
gh-pages: all
git branch -D gh-pages ||:
@@ -28,3 +41,5 @@ status:
writable:
@sed -i -re 's/git:\/\/github.com\//git@github.com:/' .git/config
@make -sC js/rdf writable
+
+.PHONY: all clean update update_submodules pull_submodules pull

0 comments on commit 595b711

Please sign in to comment.