X-Git-Url: http://git.megacz.com/?p=nestedvm.git;a=blobdiff_plain;f=upstream%2FMakefile;h=bc220670a4fc8d1e43e42e1a8d4786febf06f7aa;hp=43f14a7fb0e9f1b1f95d5538259f953b1cf4d722;hb=031222f07c4ac6549cfdcb0667114ba5476bbbaf;hpb=b11e7c6c29f2b5f7b0828bf93eb741c4a30ec411 diff --git a/upstream/Makefile b/upstream/Makefile index 43f14a7..bc22067 100644 --- a/upstream/Makefile +++ b/upstream/Makefile @@ -32,6 +32,8 @@ tasks/everything: \ darcs_gcclass = http://gcclass.ibex.org/ darcs_classgen = http://classgen.ibex.org/ +git_gcclass = http://gcclass.ibex.org/.git/ +git_classgen = http://classgen.ibex.org/.git/ cross_root := $(usr)/mips-unknown-elf .SECONDARY: # This is broken in gmake < 3.79.1 @@ -100,6 +102,30 @@ tasks/build_darcs_%: tasks/extract_darcs_% cd "build/$*" && $(MAKE) touch $@ +tasks/extract_git_%: + if [ -e $@ ]; then echo "Error: $@ exists. something isn't right"; false; else true; fi + mkdir -p build + if [ -z "$(git_$*)" ]; then echo "No git url for $*" >&2; false; fi + if [ -d "$(root)/.git" ]; then \ + cd build && git clone "$(git_$*)" "$*"; \ + else \ + mkdir -p "build/" && cd "build/"; \ + git clone $(darcs_$*) $*; \ + fi + touch $@ + +update_git_%: tasks/extract_git_% + if [ -d "build/$*/.git" ]; then \ + cd "build/$*" && git fetch; \ + else \ + cd "build/$*" && git clone $(git_$*); \ + fi + rm -f "tasks/build_git_$*" # to force a rebuild + +tasks/build_git_%: tasks/extract_git_% + cd "build/$*" && $(MAKE) + touch $@ + clean_%: rm -rf "build/$(*)"* rm -f "tasks/build_$*" "tasks/patch_$*" "tasks/extract_$*"