1## @configure_input@
2##
3## \file    Makefile.in
4## \brief   Makefile template for libSBML Perl bindings
5## \author  Mike Hucka
6##
7##
8
9## Copyright 2005 California Institute of Technology and
10## Japan Science and Technology Corporation.
11##
12## This library is free software; you can redistribute it and/or modify it
13## under the terms of the GNU Lesser General Public License as published
14## by the Free Software Foundation; either version 2.1 of the License, or
15## any later version.
16##
17## This library is distributed in the hope that it will be useful, but
18## WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
19## MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
20## documentation provided hereunder is on an "as is" basis, and the
21## California Institute of Technology and Japan Science and Technology
22## Corporation have no obligations to provide maintenance, support,
23## updates, enhancements or modifications.  In no event shall the
24## California Institute of Technology or the Japan Science and Technology
25## Corporation be liable to any party for direct, indirect, special,
26## incidental or consequential damages, including lost profits, arising
27## out of the use of this software and its documentation, even if the
28## California Institute of Technology and/or Japan Science and Technology
29## Corporation have been advised of the possibility of such damage.  See
30## the GNU Lesser General Public License for more details.
31##
32## You should have received a copy of the GNU Lesser General Public License
33## along with this library; if not, write to the Free Software Foundation,
34## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
35##
36## The original code contained here was initially developed by:
37##
38##     Christoph Flamm
39##     Institut fuer Theoretische Chemie
40##     Universitaet Wien
41##     Waehringerstrasse 17/3/308
42##     A-1090 Wien, Austria
43
44## Contributor(s):
45##   Michael Hucka <mhucka@caltech.edu> Wrote this Makefile.in.
46##
47
48
49# -----------------------------------------------------------------------------
50# Configuration variables
51# -----------------------------------------------------------------------------
52# Some of the following are substituted automatically by `configure'.  If
53# you are looking at "Makefile", do not edit these values; instead, run the
54# configure script at the top level of the src tree.  It will recreate
55# "Makefile".
56
57include @top_srcdir@/config/makefile-common-vars.mk
58
59# `srcdir' points to the current directory, but should be set by configure.
60# `subdir' must be set manually to the relative dir under srcdir.  Don't
61# set `subdir' to an absolute path, or some make actions will fail.
62
63srcdir  = @srcdir@
64thisdir = src/bindings/perl
65
66# `sources' are used by the default rules to determine what needs to be
67# compiled.
68
69sources = LibSBML.i LibSBML.pod LibSBML_wrap.cxx LibSBML.pm
70
71# `distfiles' determines the files and directories included in a distribution.
72# `distfiles_exclude' is used to filter out specific items, so that even if
73# they appear in `distfiles', they will not be copied in the distribution.
74
75distfiles =                            \
76  $(sources)                           \
77  CMakeLists.txt                       \
78  LibSBML.i                            \
79  LibSBML.pm                           \
80  LibSBML.pod                          \
81  LibSBML.txt                          \
82  LibSBML_wrap.cxx                     \
83  list_of_fix.i                        \
84  list_get_fix.i                       \
85  local.cpp                            \
86  local.i                              \
87  local-layout.i                       \
88  local-l3v2extendedmath.i                       \
89  local-packages.i.in                  \
90  local-downcast-astplugins.cpp.in     \
91  local-downcast-astplugins-l3v2extendedmath.cpp     \
92  local-downcast-extension-layout.cpp  \
93  local-downcast-extension-l3v2extendedmath.cpp  \
94  local-downcast-extension.cpp.in      \
95  local-downcast-namespaces.cpp.in     \
96  local-downcast-namespaces-layout.cpp \
97  local-downcast-namespaces-l3v2extendedmath.cpp \
98  local-downcast-converters.cpp.in     \
99  local-downcast-converters-layout.cpp \
100  local-downcast-plugins-layout.cpp    \
101  local-downcast-plugins-l3v2extendedmath.cpp    \
102  local-downcast-plugins.cpp.in        \
103  local-downcast-packages-layout.cpp   \
104  local-downcast-packages-l3v2extendedmath.cpp   \
105  local-downcast.cpp.in                \
106  Makefile.in                          \
107  Makefile.PL.in                       \
108  MANIFEST                             \
109  README.txt                           \
110  t/01__LoadModule.t                   \
111  t/02__CreateDocument.t               \
112  t/02__ReadFromFile.t                 \
113  t/02__ReadFromFileL3.t               \
114  t/02__WriteToFile.t                  \
115  t/02__WriteToFileL3.t                \
116  t/03__ChangeValues.t                 \
117  t/03__DowncastRule.t                 \
118  t/03__DowncastSBase.t                \
119  t/03__DowncastSBaseL3.t              \
120  t/04__ListOf.t                       \
121  t/04__ListOfL3.t                     \
122  t/05__AlgebraicRule.t                \
123  t/05__AssignmentRule.t               \
124  t/05__AssignmentRuleL3.t             \
125  t/05__Compartment.t                  \
126  t/05__CompartmentL3.t                \
127  t/05__CompartmentVolumeRule.t        \
128  t/05__EventAssignment.t              \
129  t/05__Event.t                        \
130  t/05__EventL3.t                      \
131  t/05__Formula.t                      \
132  t/05__FunctionDefinition.t           \
133  t/05__KineticLaw.t                   \
134  t/05__KineticLawL3.t                 \
135  t/05__Model.t                        \
136  t/05__ModelL3.t                      \
137  t/05__ModifierSpeciesReference.t     \
138  t/05__ParameterRule.t                \
139  t/05__Parameter.t                    \
140  t/05__ParameterL3.t                  \
141  t/05__RateRule.t                     \
142  t/05__SBMLDocument.t                 \
143  t/05__SBMLDocumentVerbose.t          \
144  t/06__TestReadSBML.t                 \
145  t/06__TestReadSBMLL3.t               \
146  t/06__TestWriteSBMLL3.t              \
147  t/06__TestWriteSBML.t                \
148  t/07__TestCVTerms.t                  \
149  t/07__TestModelHistory.t             \
150  t/07__TestRDFAnnotation2.t           \
151  t/l1v1-branch.xml
152
153extra_distclean = Makefile-perl Makefile-perl.old Makefile Makefile.PL \
154	local-downcast-extension.i local-downcast-extension.cpp \
155	local-downcast-namespaces.i local-downcast-namespaces.cpp \
156	local-packages.i local-downcast-plugins.cpp local-downcast.cpp
157
158
159# -----------------------------------------------------------------------------
160# Primary build actions
161# -----------------------------------------------------------------------------
162
163.SUFFIXES:
164.SUFFIXES: .i .cxx .o .obj
165
166# The default action is to remake everything.
167
168all: Makefile-perl
169ifneq "$(MAKEFLAGS)" ""
170	$(MAKE) -f Makefile-perl -$(MAKEFLAGS)
171else
172	$(MAKE) -f Makefile-perl
173endif
174
175# The Perl-created Makefile is named 'Makefile-perl'.
176
177# -fno-strict-aliasing option is added to CXXFLAGS when using GCC.  As
178# written in the SWIG Manual (section 20.2.4), SWIG generated code could
179# cause crash problems when compiled by GCC with -fstrict-aliasing option
180# (automatically enabled when using -O2 or higher optimization in GCC 3 or
181# later) and the option should be disabled by adding -fno-strict-aliasing
182# option.
183
184ifeq (GCC,$(findstring GCC,$(shell $(CXX) --version)))
185      CXXFLAGS += -fno-strict-aliasing
186endif
187
188
189# If the last run was made with --enable-layout and this one isn't, or
190# vice-versa, the swig wrap files will be wrong for this run.  However, you
191# can't tell just by looking at file mod times, so you can't use normal
192# make dependencies.  So we do this grungy trick of looking inside
193# libsbml_wrap.cpp to see what's inside.
194
195ifdef USE_LAYOUT
196  define check_layout
197    if test ! -f LibSBML_wrap.cxx; then echo "do_reswig"; exit; fi; \
198    if test -z "`grep getListOfLayouts LibSBML_wrap.cxx`"; then echo "do_reswig"; fi;
199  endef
200else
201  define check_layout
202    if test ! -f LibSBML_wrap.cxx; then echo "do_reswig"; exit; fi; \
203    if test -n "`grep getListOfLayouts LibSBML_wrap.cxx`"; then echo "do_reswig"; fi;
204  endef
205endif
206
207ifdef USE_L3V2EXTENDEDMATH
208  define check_l3v2extendedmath
209    if test ! -f LibSBML_wrap.cxx; then echo "do_reswig"; exit; fi;
210  endef
211else
212  define check_l3v2extendedmath
213    if test ! -f LibSBML_wrap.cxx; then echo "do_reswig"; exit; fi;
214  endef
215endif
216
217.PHONY: do_reswig
218
219do_reswig:
220ifndef USE_PERL
221	@ echo "Reconfigure --with-perl in order to build the perl-bindings"
222	exit 1
223else
224	rm -f LibSBML_wrap.cxx
225endif
226
227#
228# Currently, libtool doesn't work for building Perl bindings on Cygwin.
229# So, for the time being, libtool is not used on Cygwin.
230#
231Makefile-perl: Makefile.PL $(shell $(call check_layout)) $(shell $(call check_l3v2extendedmath))
232ifndef USE_PERL
233	@ echo "Reconfigure --with-perl in order to build the perl-bindings"
234	exit 1
235else
236ifeq "$(HOST_TYPE)" "cygwin"
237	$(PERL) Makefile.PL $(if $(LIB),LIB=$(LIB),) \
238	CC="$(CXX)" LD="$(CXX)" CCFLAGS="$(CXXFLAGS)" MYEXTLIB="../../.libs/libsbml.a"
239else
240	$(PERL) Makefile.PL $(if $(LIB),LIB=$(LIB),) \
241	CC="$(LIBTOOL) --mode=compile $(CXX)" CCFLAGS="$(CXXFLAGS)" \
242	LD="$(TOP_SRCDIR)/config/lt_link_helper.sh $(CXX) --libdir $(LIBDIR)" \
243	MYEXTLIB="../../libsbml.la"
244endif
245endif
246
247Makefile.PL: Makefile.PL.in $(TOP_SRCDIR)/configure \
248	     $(TOP_SRCDIR)/config/makefile-common-vars.mk
249	cd $(TOP_BUILDDIR) && $(SHELL) ./config.status $(thisdir)/$@
250
251
252# -----------------------------------------------------------------------------
253# Checking.
254# -----------------------------------------------------------------------------
255
256check: Makefile-perl
257	$(call libsbmlrun, $(MAKE) -f Makefile-perl test)
258
259
260# -----------------------------------------------------------------------------
261# Tags.
262# -----------------------------------------------------------------------------
263
264tags: etags ctags
265
266
267# -----------------------------------------------------------------------------
268# Installation.
269# -----------------------------------------------------------------------------
270
271install: Makefile.PL Makefile-perl
272ifneq "$(MAKEFLAGS)" ""
273	$(MAKE) -f Makefile-perl -$(MAKEFLAGS) pure_install
274else
275	$(MAKE) -f Makefile-perl pure_install
276endif
277
278installcheck:
279
280uninstall:
281ifneq "$(MAKEFLAGS)" ""
282	$(MAKE) -f Makefile-perl -$(MAKEFLAGS) myuninstall
283else
284	$(MAKE) -f Makefile-perl myuninstall
285endif
286
287
288# -----------------------------------------------------------------------------
289# Cleaning.
290# -----------------------------------------------------------------------------
291
292clean: Makefile-perl
293ifneq "$(MAKEFLAGS)" ""
294	$(MAKE) -f Makefile-perl -$(MAKEFLAGS) clean
295else
296	$(MAKE) -f Makefile-perl clean
297endif
298
299distclean: Makefile-perl distclean-normal
300
301mostlyclean:
302
303maintainer-clean:
304
305
306# -----------------------------------------------------------------------------
307# Creating distribution (for libSBML maintainers only)
308# -----------------------------------------------------------------------------
309
310dist: LibSBML_wrap.cxx dist-normal
311
312distcheck: distcheck-normal
313
314
315# -----------------------------------------------------------------------------
316# Miscellaneous
317# -----------------------------------------------------------------------------
318
319include @top_srcdir@/config/makefile-common-actions.mk
320
321
322# -----------------------------------------------------------------------------
323# End.
324# -----------------------------------------------------------------------------
325
326