# This file is part of the Coral project.
# Please read the copyright notice in the LICENSE file.
ifeq ($(CORAL_VERSION),)
CORAL_VERSION:=0.$(shell date '+%Y%m%d')
endif
export CORAL_VERSION

tmpdir=/tmp

build:
	(cd ../..; \
	 cp LICENSE coral/modeler/doc/license.html; \
	 b=$$(basename $$(pwd)); \
	 (cd coral; make -f makefile.swig); \
	 cd ..; \
	 mv $$b coral-$(CORAL_VERSION); \
	 tar zcf $(tmpdir)/coral-$(CORAL_VERSION).tar.gz \
	 --exclude .svn \
	 --exclude "*.exe" \
	 --exclude "*.o" \
	 --exclude "*.log" \
	 --exclude "*.so" \
	 --exclude "version.py" \
	 --exclude "*.pyc" \
	 --exclude "*~" \
	 --exclude "cgiserver"\
	 --exclude "Makefile.CoralInternal" \
	 --exclude "LICENSE.*" \
	 --exclude "qa" \
	 coral-$(CORAL_VERSION); \
	 mv coral-$(CORAL_VERSION) $$b)
	echo "Created .tar.gz package in $(tmpdir)/coral-$(CORAL_VERSION)"

