#3670: bzr_checkout.mk from brettgrand

This commit is contained in:
Ken Conley 2011-09-13 18:00:38 +00:00
parent fa52b7f904
commit 40ec1f8426
1 changed files with 30 additions and 0 deletions

30
core/mk/bzr_checkout.mk Normal file
View File

@ -0,0 +1,30 @@
# This file can be used to automate cloning and patching of 3rd
# party software.
#
# Before including this file, e.g.:
# include $(shell rospack find mk)/bzr_checkout.mk
# define the following make variables:
# BZR_DIR: name of directory into which you want to clone to
# BZR_URL: full URL to download
# BZR_PATCH: your (list of) patch file(s) to patch the downloaded software
# BZR_REVISION: a bzr revisionspec string
ifneq ($(BZR_REVISION),)
BZR_REV='-r $(BZR_REVISION)'
else
BZR_REV=
endif
$(BZR_DIR):
bzr branch $(BZR_REV) $(BZR_URL) $(BZR_DIR)
touch rospack_nosubdirs
patched: $(BZR_DIR) $(BZR_PATCH) Makefile
cd $(BZR_DIR) && bzr revert $(BZR_REV)
ifneq ($(strip $(BZR_PATCH)),)
$(foreach PATCH, $(BZR_PATCH), patch -d $(BZR_DIR) -p1 < $(PATCH) && ) echo patched
touch rospack_nosubdirs
touch patched
endif
download: $(BZR_DIR) patched