Makefile 5.42 KB
Newer Older
1 2 3 4
##########################################################################
#                                                                        #
#                 ACG development toolkit                                #
#                                                                        #
5
#                  Copyright 2008-2018 INRIA                             #
6 7 8 9 10 11 12 13 14 15 16 17 18 19
#                                                                        #
#  More information on "http://acg.gforge.inria.fr/"                     #
#  License: CeCILL, see the LICENSE file or "http://www.cecill.info"     #
#  Authors: see the AUTHORS file                                         #
#                                                                        #
#                                                                        #
#                                                                        #
#                                                                        #
#  $Rev::                              $:  Revision of last commit       #
#  $Author::                           $:  Author of last commit         #
#  $Date::                             $:  Date of last commit           #
#                                                                        #
##########################################################################

20
.PHONY: clean install uninstall tar www release test-www-acg opam-meta opam version set_log_level
21 22 23 24 25 26 27 28 29 30

VERSION_BASENAME=$(shell cat acgtk.version)
VERSION = $(VERSION_BASENAME)-$(shell date "+%Y%m%d")
RELEASE = acg-$(VERSION)

TAR_RELEASE = $(RELEASE)

ACGtk_DIR = $(shell basename `pwd`)

clean:
31
	dune clean
32 33
	find . -name "*~" -exec rm -f {} \;

34
set_log_level:
35 36
#	find . -name "dune" -exec sed -i -e 's/-level \([^ ]*\)/-level TRACE/' {} \;
	find . -name "dune" -exec sed -i -e 's/-level \([^ ]*\)/-level NONE/' {} \;
37 38


39
install:
40
	dune install
41 42

uninstall:
43
	dune uninstall
44 45 46 47 48 49 50 51 52 53 54

tar:
	if test -d ../$(TAR_RELEASE) ; then rm ../$(TAR_RELEASE) ; fi
	cd .. && ln -s $(ACGtk_DIR) $(TAR_RELEASE) && cd $(ACGtk_DIR)
	echo Building $(TAR_RELEASE).tar.gz
	tar --exclude="*/.git*" --exclude "*/_build" --exclude "$(TAR_RELEASE)/data" --exclude "$(TAR_RELEASE)/src/data" --exclude "$(TAR_RELEASE)/*.tar.*" --exclude "$(TAR_RELEASE)/TODO" --exclude "*~" --exclude "opam-package" -zcvf $(TAR_RELEASE).tar.gz -C ..  -h $(TAR_RELEASE) 
	if test -d ../$(TAR_RELEASE) ; then rm ../$(TAR_RELEASE) ; fi

www:
	cp acg-$(VERSION).tar.gz ~/www-acg/software/.
	scp acg-$(VERSION).tar.gz pogodall@loria.loria.fr:www-acg/software/.
55
	scp acg-$(VERSION).tar.gz pogodall@loria.loria.fr:www-calligramme-acg/software/.
56
	scp INSTALL pogodall@loria.loria.fr:www-acg/software/.
57
	scp INSTALL pogodall@loria.loria.fr:www-calligramme-acg/software/.
58
	scp README pogodall@loria.loria.fr:www-acg/software/.
59
	scp README pogodall@loria.loria.fr:www-calligramme-acg/software/.
60 61 62 63
	cp INSTALL ~/www-acg/software/.
	cp README ~/www-acg/software/.
	sed -i -e 's/acg-[^-]*-[0-9]*\.tar\.gz/acg-$(VERSION).tar.gz/' ~/www-acg/index.html
	scp ~/www-acg/index.html pogodall@loria.loria.fr:www-acg/.
64 65
	scp ~/www-acg/index.html pogodall@loria.loria.fr:www-calligramme-acg/.

66 67 68 69
version:src/utils/version.ml acgtkLib.version

acgtkLib.version: acgtk.version
	cp $< $@
70

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
71
src/utils/version.ml: FORCE
72
	sed -i -e 's/version = "[^"]*"/version = "$(VERSION)"/g' $@
73

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
74 75
FORCE:

76 77 78 79 80 81 82 83 84 85 86 87 88 89 90
release : version tar www
	if svn status -q -u | grep -v "^Status against" | grep -q -v "opam-package/url" | grep -q -v "^\?" ; \
	then  \
	printf "\n\nERROR:\nPlease commit before making a release\n\n" ; \
	else \
	if svn list ^/dev/tags/release-$(VERSION) > /dev/null ; then \
	printf "\n\nERROR: the svn tag directory already exists\n" ; \
	else \
	svn cp ^/dev/trunk ^/dev/tags/release-$(VERSION) -m "Tagging the $(VERSION) release of the 'acg' project" ; \
	fi \
	fi

OPAM_TESTING_DIR=~/work/dev/opam-contrib/testing/packages
OPAM_GIT_REPO_DIR=~/work/dev/opam-contrib/opam-repository/packages
OPAM_ACG_REPO_DIR=~/www-acg/software/opam-acg
91
OPAM_CALLIGRAMME_ACG_REPO_DIR=~/www-calligramme-acg/software/opam-acg
92 93 94 95 96

opam-package/url: tar
	md5sum acg-$(VERSION).tar.gz | cut -d " " -f 1 | xargs -i printf "archive: \"http://calligramme.loria.fr/acg/software/acg-$(VERSION).tar.gz\"\nchecksum: \"%s\"\n" {} > $@

test-www-acg:
97
	cd $(OPAM_ACG_REPO_DIR) && opam-admin make && rsync -vaz --rsh="ssh -l pogodall" ../opam-acg pogodall@loria.loria.fr:$(OPAM_ACG_REPO_DIR) && rsync -vaz --rsh="ssh -l pogodall" ../opam-acg pogodall@loria.loria.fr:$(OPAM_CALLIGRAMME_ACG_REPO_DIR)
98

99
opam-meta: tar
100 101
	cp -rT opam-package $(OPAM_TESTING_DIR)/acgtk/acgtk.$(VERSION_BASENAME)
	cp -rT opam-package $(OPAM_GIT_REPO_DIR)/acgtk/acgtk.$(VERSION_BASENAME)
102
	cp -rT opam-package $(OPAM_ACG_REPO_DIR)/packages/acgtk/acgtk.$(VERSION_BASENAME) && cd $(OPAM_ACG_REPO_DIR) && opam-admin make && rsync -vaz --rsh="ssh -l pogodall" ../opam-acg pogodall@loria.loria.fr:$(OPAM_ACG_REPO_DIR) && rsync -vaz --rsh="ssh -l pogodall" ../opam-acg pogodall@loria.loria.fr:$(OPAM_CALLIGRAMME_ACG_REPO_DIR)
103 104


105 106
opam:opam-package/url www version
	opam lint opam-package/opam
107 108
	cp -rT opam-package $(OPAM_TESTING_DIR)/acgtk/acgtk.$(VERSION_BASENAME)
	cp -rT opam-package $(OPAM_GIT_REPO_DIR)/acgtk/acgtk.$(VERSION_BASENAME)
109
	cp -rT opam-package $(OPAM_ACG_REPO_DIR)/packages/acgtk/acgtk.$(VERSION_BASENAME) && cd $(OPAM_ACG_REPO_DIR) && opam-admin make && rsync -vaz --rsh="ssh -l pogodall" ../opam-acg pogodall@loria.loria.fr:$(OPAM_ACG_REPO_DIR) && rsync -vaz --rsh="ssh -l pogodall" ../opam-acg pogodall@loria.loria.fr:$(OPAM_CALLIGRAMME_ACG_REPO_DIR)