Makefile.am 4.08 KB
Newer Older
1 2
# Copyright (C) 2007, 2008, 2009, 2012, 2013, 2014 EPITA Research and
# Development Laboratory (LRDE).
3 4 5 6 7 8 9 10 11 12 13 14 15 16
#
# This file is part of Olena.
#
# Olena is free software: you can redistribute it and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, version 2 of the License.
#
# Olena is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Olena.  If not, see <http://www.gnu.org/licenses/>.
17

18 19 20 21 22 23

SUBDIRS = . $(DOCDIR) mesh tests

if ENABLE_DOC
  SUBDIRS += doc
endif ENABLE_DOC
24 25 26 27

if ENABLE_APPS
  SUBDIRS += apps
endif ENABLE_APPS
28

29 30 31 32
if ENABLE_TOOLS
  SUBDIRS += tools
endif ENABLE_TOOLS

33
.PHONY: pretty-check tests
34

35 36 37
pretty-check:
	cd tests && $(MAKE) $(AM_MAKEFLAGS) $@

38 39 40
tests:
	cd tests && $(MAKE) $(AM_MAKEFLAGS) $@

41 42 43 44
# Regen files recursively.
include $(top_srcdir)/build-aux/regen-recursive.mk
REGEN_SUBDIRS += doc tests

45
# Force the regeneration of `headers.mk'.
46
#
47
# We do not delegate the action of regenerating `headers.mk' to
48
# `regen' like this:
49
#
50
#   $(MAKE) $(AM_MAKEFLAGS) regen
51 52 53 54 55 56 57 58 59 60 61 62 63
#
# to avoid an infinite recursion, since
#
# - the generation of `headers.mk' would trigger the update
#   (regeneration) of `Makefile' (due to the behavior of Automade
#   Makefiles);
#
# and because
#
# - `Makefile' depends on `headers.mk' (because of the `include'
#    statement); and
# - `headers.mk' depends on `generate_dist_headers.sh'.
#
64 65
# Hence the redundant action.  There may be a better solution
regen-am:
66 67
	cd $(srcdir)							\
	  && $(abs_top_srcdir)/build-aux/generate_dist_headers.sh	\
68
	       mln headers.mk
69 70 71 72 73 74 75 76 77 78
# Also regenerate mln/version.hh.  Again, the action is duplicated
# (see target $(srcdir)/mln/version.hh below).  There's probably a
# (portable) way to factor this.
	rm -f $(srcdir)/mln/version.hh $(srcdir)/mln/version.hh.tmp
	srcdir=''; \
	  test -f ./$(srcdir)/mln/version.hh.in || srcdir=$(srcdir)/; \
	  $(edit) $${srcdir}$(srcdir)/mln/version.hh.in \
	    >$(srcdir)/mln/version.hh.tmp
	chmod a-w $(srcdir)/mln/version.hh.tmp
	mv $(srcdir)/mln/version.hh.tmp $(srcdir)/mln/version.hh
79

80 81
# FIXME: Change generate_dist_headers.sh so that the action looks like this:
#
82 83
#	$(top_srcdir)/build-aux/generate_dist_headers.sh \
#         $@.tmp && mv -f $@.tmp $@ && chmod -w $@
84
#
85
$(srcdir)/headers.mk: $(top_srcdir)/build-aux/generate_dist_headers.sh
86 87
	cd $(srcdir)							\
	  && $(abs_top_srcdir)/build-aux/generate_dist_headers.sh	\
88
	       mln headers.mk
89 90

include $(srcdir)/headers.mk
Guillaume Lazzara's avatar
Guillaume Lazzara committed
91

92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107

# Package metadata (mln/version.hh).
#
# Note that contrary to $(top_srcdir)/config.h, mln/version.hh is
# meant to be installed and is part of the library.

edit = sed -e 's,@PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g'	\
           -e 's,@PACKAGE_NAME[@],$(PACKAGE_NAME),g'		\
           -e 's,@PACKAGE_STRING[@],$(PACKAGE_STRING),g'	\
           -e 's,@PACKAGE_VERSION[@],$(PACKAGE_VERSION),g'	\
           -e 's,@PACKAGE_URL[@],$(PACKAGE_URL),g'		\
           -e 's,@PACKAGE_AUTHORS[@],$(PACKAGE_AUTHORS),g'

EXTRA_DIST = mln/version.hh.in
$(srcdir)/mln/version.hh: mln/version.hh.in $(top_srcdir)/configure.ac Makefile.am
	rm -f $@ $@.tmp
108
	$(edit) $@.in >$@.tmp
109 110 111
	chmod a-w $@.tmp
	mv $@.tmp $@

112

113 114
imgdir = $(pkgdatadir)/images
dist_img_DATA =					\
115
  img/README					\
116
  img/bunny.pgm					\
117 118 119
  img/fly.pbm					\
  img/fly.pgm					\
  img/fly.ppm					\
120
  img/fly_ascii.ppm				\
121 122 123 124 125 126 127 128
  img/lena.pbm					\
  img/lena.pgm					\
  img/lena.ppm					\
  img/lena_16.ppm				\
  img/medium.pgm				\
  img/medium.ppm				\
  img/picasso.pbm				\
  img/picasso.pgm				\
Roland Levillain's avatar
Roland Levillain committed
129
  img/picasso.ppm				\
130 131 132 133 134 135 136 137 138 139 140
  img/quite-small.pgm				\
  img/small.pbm					\
  img/small.pgm					\
  img/small.ppm					\
  img/squares-lc.pgm				\
  img/squares.pgm				\
  img/test.fits					\
  img/tiny.pbm					\
  img/tiny.pgm					\
  img/tiny.ppm					\
  img/toto.pbm
141

142
EXTRA_DIST +=					\
143 144 145
  tests/img/test_rgb8.tif			\
  tests/img/test_bw.tif				\
  tests/img/test_gl.tif
146 147 148

# Header file generator.
EXTRA_DIST += new-header