File: Makefile.contribs

package info (click to toggle)
gecode 2.1.1-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 8,432 kB
  • ctags: 8,211
  • sloc: cpp: 60,596; ansic: 6,727; sh: 2,934; perl: 1,800; makefile: 1,382
file content (86 lines) | stat: -rw-r--r-- 3,400 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#  -*-Makefile-*-
#
#  Main authors:
#     Christian Schulte <schulte@gecode.org>
#     Guido Tack <tack@gecode.org>
#     Gr�goire Dooms <dooms@info.ucl.ac.be>
#     
#
#  Copyright:
#     Christian Schulte, 2005
#     Guido Tack, 2005
#     Gr�goire Dooms, 2005 
#
#  Last modified:
#     $Date: 2005-11-01 16:01:21 +0100 (Tue, 01 Nov 2005) $ by $Author: zayenz $
#     $Revision: 2465 $
#
#  This file is part of Gecode, the generic constraint
#  development environment:
#     http://www.gecode.org
#
#  Permission is hereby granted, free of charge, to any person obtaining
#  a copy of this software and associated documentation files (the
#  "Software"), to deal in the Software without restriction, including
#  without limitation the rights to use, copy, modify, merge, publish,
#  distribute, sublicense, and/or sell copies of the Software, and to
#  permit persons to whom the Software is furnished to do so, subject to
#  the following conditions:
#
#  The above copyright notice and this permission notice shall be
#  included in all copies or substantial portions of the Software.
#
#  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
#  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
#  MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
#  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
#  LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
#  OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
#  WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#

CONTRIBS := $(shell ls -d contribs/* 2>/dev/null )
#CONTRIBS := $(shell find contribs -mindepth 1 -maxdepth 1 -type d 2>/dev/null)
CONTRIBCONFIGURES := $(shell ls contribs/*/configure 2>/dev/null | sed 's|/configure||')
CONTRIBVTIS  := $(shell ls contribs/*/vti.ac 2>/dev/null| sed 's|/vti.ac||')
CONTRIBDESCS  := $(shell ls contribs/*/shortdesc.ac 2>/dev/null | sed 's|/shortdesc.ac||')

contribdirs:
	@rm -f configure.ac
	@(echo "dnl This file was generated by Makefile.contribs."; \
	  echo "dnl Do not edit! Modifications will get lost!"; \
	  echo "dnl Edit configure.ac.in instead."; echo ""; \
	  cat configure.ac.in \
	 ) > configure.ac
	@for i in $(CONTRIBS); do \
	  if test ! -d $$i ; then continue ; fi; \
	  if test -f $$i.dis* ; then \
	  	echo "Skipping disabled contrib $$i"; \
	  elif test -f $$i/configure -a '(' -f $$i/vti.ac -o -f $$i/shortdesc.ac ')' ; then \
	    mv configure.ac configure.ac.1; \
	    sed -e "s|\(dnl @SUBDIRS@\)|AC_CONFIG_SUBDIRS($$i) \1|g" \
	    configure.ac.1 > configure.ac; \
		if test -f $$i/vti.ac ; then \
	  		echo "Add variable contrib from $$i"; \
	  		mv configure.ac configure.ac.1; \
	  		(sed -e "s|\(dnl @VTIS@\)|m4_include($$i/vti.ac) \1|g" \
	   		configure.ac.1 > configure.ac); \
	    else \
			mv configure.ac configure.ac.1; \
	  		echo "Add contrib from $$i"; \
			DESC="`head -n 1 $$i/shortdesc.ac`"; \
			sed -e "s|\(dnl @CONTRIBS@\)|AC_GECODE_ENABLE_CONTRIB($${i#*\/},\"$$DESC\",[]) \1|g" \
			configure.ac.1 > configure.ac; \
		fi ;\
	  else \
	    if test ! -f $$i/configure; then \
	  		echo "Skipping contrib $$i : no configure script"; \
	    else \
	  		echo "Skipping contrib $$i : no shortdescr.ac or vti.ac file "; \
	    fi; \
	  fi;\
	done
	@rm -f configure.ac.1
	@echo Running autoconf on generated configure.ac ...
	@autoconf
	@echo done.