# rules for SVN download and update
# variables
# 	PRODUCT		Name of the product to be used in paths
#	SVNURL		The svn URL

.PRECIOUS: $(CONFIGDIR)/$(PRODUCT)/downloaded

$(CONFIGDIR)/$(PRODUCT)/downloaded:
	@if [ -d $(SRCDIR)/$(PRODUCT)/.svn ]; then \
		echo $(PRODUCT): Updating from SVN repository; \
		(cd $(SRCDIR)/$(PRODUCT); svn update) ;\
	else \
		echo $(PRODUCT): Checking out from SVN repository; \
		[ -d $(SRCDIR)/$(PRODUCT) ] || mkdir -p $(SRCDIR)/$(PRODUCT); \
		(cd $(SRCDIR); \
		 svn co $(SVNURL) $(PRODUCT) \
		);\
	fi
	@mkdir -p $(CONFIGDIR)/$(PRODUCT)
	@touch $(CONFIGDIR)/$(PRODUCT)/downloaded
