Makefile.in 3.97 KB
Newer Older
1 2 3 4 5 6
##########################################################################
#                                                                        #
#                 ACG development toolkit                                #
#                                                                        #
#                  Copyright 2008 INRIA                                  #
#                                                                        #
7
#  More information on "http://acg.gforge.inria.fr/"                     #
8 9 10 11 12 13 14 15 16 17 18 19
#  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: config byte opt clean superclean install tar version release test force
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
21

22
BINARIES=acg acg.opt acgc acgc.opt
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
23

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
24
VERSION_FILE = src/utils/version.ml
25
VERSION = 1.0b-$(shell date "+%Y%m%d")
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
26
RELEASE = acg-$(VERSION)
27

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
28 29
TAR_RELEASE =acg-$(TAR_VERSION)

30 31 32
prefix = @prefix@
exec_prefix = @exec_prefix@

33 34 35
ACG_DIR=src/scripting
ACGC_DIR=src/acg-data

36 37
EMACS_DIR=@emacs_dir@

38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
byte: acg acgc

opt: acg.opt acgc.opt

all: byte opt test

acg acg.opt: force
	$(MAKE) -C $(ACG_DIR) $@
	cp $(ACG_DIR)/$@ .

acgc acgc.opt: force
	$(MAKE) -C $(ACGC_DIR) $@
	cp $(ACGC_DIR)/$@ .

force:

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
54

55 56
test:
	$(MAKE) -C src $@
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
57

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
58
clean:
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
59 60
	-if test "$@" = clean ; then $(MAKE) -C config $@ ; fi
	-$(MAKE) -C src $@
61
	rm -rf *.log  *~ autom4te.cache *.tar.gz *.acgo
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
62
	find . -name "*~" -exec rm -f {} \;
63
	-for file in $(BINARIES); do rm -f $$file ; done
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
64

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
65
superclean: clean
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
66
	-find . -path "./*/*.in" -print | sed -e 's/\(.*\)\.in/\1/' | xargs -n 1 rm
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
67

68 69 70 71 72
install:
	for file in $(BINARIES); do if test -x $$file ; then cp $$file @bindir@/. ; fi ; done

uninstall:
	for file in $(BINARIES); do if test -x @bindir@/$$file ; then rm @bindir@/$$file ; fi ; done
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
73

74 75 76 77 78 79 80
install-emacs:
	mkdir -p $(EMACS_DIR) && cp emacs/acg.el $(EMACS_DIR)/.

uninstall-emacs:
	rm $(EMACS_DIR)/acg.el
	rm -r $(EMACS_DIR)

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
81 82 83 84 85

# Part for the auto configuration

config: configure

86
configure: config/configure.ac  config/ac_lib_checking.m4
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
87 88
	cd $(<D) && autoconf && mv configure .. & cd ..

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
89 90 91
tar: TAR_VERSION = $(shell grep "^DEFINE" $(VERSION_FILE) | sed -e 's/DEFINE.* = "\(.*\)"/\1/')

tar: superclean
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
92
	if test -d ../$(TAR_RELEASE) ; then rm ../$(TAR_RELEASE) ; fi
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
93 94
	cd .. && ln -s trunk $(TAR_RELEASE) && cd trunk
	echo $(TAR_RELEASE).tar.gz
95
	tar cvfz ../$(TAR_RELEASE).tar.gz -C ..  -h $(TAR_RELEASE) --exclude="*/.svn*" --exclude "$(TAR_RELEASE)/data" --exclude "$(TAR_RELEASE)/src/data" --exclude "$(TAR_RELEASE)/src/*.old" --exclude "$(TAR_RELEASE)/*.tar.*" --exclude "$(TAR_RELEASE)/TODO" --exclude "$(TAR_RELEASE)/*~" && mv ../$(TAR_RELEASE).tar.gz .
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
96
	if test -d ../$(TAR_RELEASE) ; then rm ../$(TAR_RELEASE) ; fi
97
	./configure
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
98 99

version :
100
	sed -i 's/\(VERSION *= *\)".*"/\1"$(VERSION)"/' $(VERSION_FILE) config/configure.ac
POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
101

POGODALLA Sylvain's avatar
POGODALLA Sylvain committed
102
release : version tar
103
	if svn status -q -u | grep -v "^Status against" | grep -q -v "^\?" ; then printf "\n\nERROR:\nPlease commit before making a release\n\n" ; else svn cp svn+ssh://pogodall@scm.gforge.inria.fr/svn/acg/dev/trunk svn+ssh://pogodall@scm.gforge.inria.fr/svn/acg/dev/tags/release-$(VERSION) -m "Tagging the $(VERSION) release of the 'acg' project" ; cp acg-$(VERSION).tar.gz ~/www-acg/software/. ; 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 ;fi