source: trunk/build_support/Makefile.am @ 1892

Last change on this file since 1892 was 1892, checked in by Peter, 12 years ago

Removed dependency to cblas in libyat. There are three new make
variables: YAT_LIBS, YAT_LIBS_WITHOUT_CLAS and YAT_CBLAS_LIB.

  • The variable YAT_LIBS is created as follows: First the LIBS provided

by user is saved (most often empty). Then when detecting libs, they
are added to the variable LIBS and in the end of the configure run
YAT_LIBS is created as the difference between LIBS and the original
LIBS.

  • YAT_CLAS_LIB is detected as before.
  • YAT_LIBS_WITHOUT_CLAS is copied from YAT_LIBS but ignoring YAT_CLAS_LIB

I also changed the name of some variables to make the code clearer (I
hope). The prefix INTERNAL_ is used for flags that should only be used
when building yat and not needed for a user building against
yat. Flags that should be propagated have no prefix, for example,
CPPFLAGS.

In the end of configure these flags are used to create YAT_CPPFLAGS
using the same mechanism as when creating YAT_LIBS.

In the last step variables such as AM_CPPFLAGS is created as the
'union' of YAT_CPPFLAGS and INTERNAL_CPPFLAGS and these are propagated
to the Makefiles where they are used by Automake generated rules.

refs #518

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.9 KB
Line 
1## Process this file with automake to produce Makefile.in
2##
3## $Id: Makefile.am 1892 2009-04-13 22:33:37Z peter $
4
5# Copyright (C) 2008, 2009 Peter Johansson
6#
7# This file is part of the yat library, http://dev.thep.lu.se/yat
8#
9# The yat library is free software; you can redistribute it and/or
10# modify it under the terms of the GNU General Public License as
11# published by the Free Software Foundation; either version 3 of the
12# License, or (at your option) any later version.
13#
14# The yat library is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17# General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License
20# along with yat. If not, see <http://www.gnu.org/licenses/>.
21
22bin_SCRIPTS=yat-config
23
24pkgconfigdir = $(libdir)/pkgconfig
25pkgconfig_DATA= yat.pc
26
27CLEANFILES = yat.pc yat-config
28
29EXTRA_DIST =  move-if-change yat-config.in yat.pc.in
30
31
32
33edit = $(SED) \
34  -e 's|@SHELL[@]|$(SHELL)|g' \
35  -e 's|@prefix[@]|$(prefix)|g' \
36  -e 's|@exec_prefix[@]|$(exec_prefix)|g' \
37  -e 's|@bindir[@]|$(bindir)|g' \
38  -e 's|@libdir[@]|$(libdir)|g' \
39  -e 's|@includedir[@]|$(includedir)|g' \
40  -e 's|@CXX[@]|$(CXX)|g' \
41  -e 's|@CXXCPP[@]|$(CXXCPP)|g' \
42  -e 's|@CPPFLAGS[@]|$(CPPFLAGS)|g' \
43  -e 's|@CXXFLAGS[@]|$(CXXFLAGS)|g' \
44  -e 's|@LDFLAGS[@]|$(LDFLAGS)|g' \
45  -e 's|@LIBS[@]|$(LIBS)|g' \
46  -e 's|@YAT_CBLAS_LIB[@]|$(YAT_CBLAS_LIB)|g' \
47  -e 's|@YAT_CPPFLAGS[@]|$(YAT_CPPFLAGS)|g' \
48  -e 's|@YAT_CXXFLAGS[@]|$(YAT_CXXFLAGS)|g' \
49  -e 's|@YAT_LDFLAGS[@]|$(YAT_LDFLAGS)|g' \
50  -e 's|@YAT_LIBS[@]|$(YAT_LIBS)|g' \
51  -e 's|@PACKAGE[@]|$(PACKAGE)|g' \
52  -e 's|@PACKAGE_BUGREPORT[@]|$(PACKAGE_BUGREPORT)|g' \
53  -e 's|@ECHO[@]|$(ECHO)|g' \
54  -e 's|@VERSION[@]|$(VERSION)|g' \
55  -e 's|@YAT_MAJOR_VERSION[@]|$(YAT_MAJOR_VERSION)|g' \
56  -e 's|@YAT_MINOR_VERSION[@]|$(YAT_MINOR_VERSION)|g' \
57  -e 's|@YAT_PATCH_VERSION[@]|$(YAT_PATCH_VERSION)|g' \
58  -e 's|@YAT_DEV_BUILD[@]|$(YAT_DEV_BUILD)|g' \
59  -e 's|@YAT_LIBNAME[@]|$(YAT_LIBNAME)|g' \
60  -e 's|@gsl_version[@]|$(gsl_version)|g' \
61  -e 's|@abs_top_srcdir[@]|$(abs_top_srcdir)|g' \
62  -e 's|@abs_top_builddir[@]|$(abs_top_builddir)|g' \
63  -e 's|@boost_version[@]|$(boost_version)|g'
64
65yat-config: Makefile $(srcdir)/yat-config.in
66  @rm -f $@ $@.tmp
67  @$(ECHO) "#! $(SHELL)" > $@.tmp
68  @$(ECHO) "# $@ generated by make from yat-config.in" >> $@.tmp
69  @$(edit) '$(srcdir)/$@.in' >>$@.tmp
70  @chmod +x $@.tmp
71  @chmod a-w $@.tmp
72  @mv $@.tmp $@
73  @$(ECHO) creating $@
74
75yat.pc: Makefile $(srcdir)/yat.pc.in
76  @rm -f $@ $@.tmp
77  @$(ECHO) "# $@ generated by make from yat.pc.in" > $@.tmp
78  @$(edit) '$(srcdir)/$@.in' >>$@.tmp
79  @chmod a-w $@.tmp
80  @mv $@.tmp $@
81  @$(ECHO) creating $@
82
83install-exec-hook:
84  $(SED) 's|installed=no|installed=yes|g' \
85  $(DESTDIR)/$(bindir)/yat-config > $(DESTDIR)/$(bindir)/yat-config.tmp
86  $(INSTALL) $(DESTDIR)/$(bindir)/yat-config.tmp $(DESTDIR)/$(bindir)/yat-config
87  rm -f $(DESTDIR)/$(bindir)/yat-config.tmp
88
Note: See TracBrowser for help on using the repository browser.