Imported Upstream version 2.4.2
[platform/upstream/libtool.git] / tests / mdemo / Makefile.am
1 ## Makefile.am -- Process this file with automake to produce Makefile.in
2 ##
3 ##   Copyright (C) 2003, 2004, 2005, 2007, 2008 Free Software Foundation
4 ##   Written by Gary V. Vaughan, 2003
5 ##
6 ##   This file is part of GNU Libtool.
7 ##
8 ## GNU Libtool is free software; you can redistribute it and/or
9 ## modify it under the terms of the GNU General Public License as
10 ## published by the Free Software Foundation; either version 2 of
11 ## the License, or (at your option) any later version.
12 ##
13 ## GNU Libtool is distributed in the hope that it will be useful,
14 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
15 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 ## GNU General Public License for more details.
17 ##
18 ## You should have received a copy of the GNU General Public License
19 ## along with GNU Libtool; see the file COPYING.  If not, a copy
20 ## can be downloaded from  http://www.gnu.org/licenses/gpl.html,
21 ## or obtained by writing to the Free Software Foundation, Inc.,
22 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
23 #####
24
25 AUTOMAKE_OPTIONS = no-dependencies foreign
26 ACLOCAL_AMFLAGS  = -I ../../libltdl/m4
27 AM_CPPFLAGS      = -I$(top_srcdir)/../.. $(INCLTDL)
28
29 lib_LTLIBRARIES = libsub.la foo1.la libfoo2.la libmlib.la
30
31 foo1_la_SOURCES = foo1.c
32 foo1_la_LIBADD = $(LIBM) libsub.la
33 foo1_la_LDFLAGS = -no-undefined -module -avoid-version
34
35 libfoo2_la_SOURCES = foo2.c
36 libfoo2_la_LIBADD = $(LIBM) libsub.la
37 libfoo2_la_LDFLAGS = -no-undefined -module -export-symbols-regex "libfoo2.*"
38
39 libsub_la_SOURCES = sub.c
40 libsub_la_LDFLAGS = -no-undefined
41
42 ## Use -export-symbols-regex here explicitly because libltdl marks
43 ## its exported symbols, and we use libltdl as a convenience archive.
44 ## Thus, on w32, auto-exporting is turned off.
45 libmlib_la_SOURCES = mlib.c
46 libmlib_la_LIBADD = @LIBLTDL@ "-dlopen" foo1.la "-dlopen" libfoo2.la
47 libmlib_la_LDFLAGS = -no-undefined -export-symbols-regex ".*"
48 libmlib_la_DEPENDENCIES = @LIBLTDL@ libsub.la foo1.la libfoo2.la
49
50 noinst_HEADERS = foo.h
51
52 bin_PROGRAMS = mdemo mdemo_static
53
54 ## use @LIBLTDL@ because some broken makes do not accept macros in targets
55 ## we can only do this because our LIBLTDL does not contain ${top_builddir}
56 top_distdir = ../..
57 @LIBLTDL@: $(top_distdir)/libtool \
58     $(top_distdir)/config.h $(srcdir)/$(top_distdir)/libltdl/ltdl.c \
59     $(srcdir)/$(top_distdir)/libltdl/ltdl.h
60         (cd $(top_distdir); $(MAKE) `echo $(LIBLTDL) | sed 's,.*\.\./libltdl/,libltdl/,g'`)
61 # Do not error out if toplevel config.h does not exist:
62 $(top_distdir)/config.h:
63
64 # Create a version of mdemo that does dlopen.
65 mdemo_SOURCES = main.c
66 mdemo_LDFLAGS = -export-dynamic
67 ## The quotes around -dlopen below fool automake into accepting it
68 mdemo_LDADD = @LIBLTDL@ libsub.la "-dlopen" self \
69                 "-dlopen" foo1.la "-dlopen" libfoo2.la
70 mdemo_DEPENDENCIES = @LIBLTDL@ libsub.la foo1.la libfoo2.la
71
72 # Create a statically linked version of mdemo.
73 mdemo_static_SOURCES = $(mdemo_SOURCES)
74 mdemo_static_LDFLAGS = $(STATIC) $(mdemo_LDFLAGS)
75 mdemo_static_LDADD = $(mdemo_LDADD)
76 mdemo_static_DEPENDENCIES = $(mdemo_DEPENDENCIES)
77
78 libtool: $(LIBTOOL_DEPS)
79         $(SHELL) ./config.status --recheck
80
81 # Workaround a bug in Autoconf-2.61 and earlier that don't clean up
82 # file droppings left by many compilers:
83 distclean-local:
84         ac_files="a.out.* a.exe.* a_out.exe.* b.out.* conftest.*"; \
85         for ac_file in $$ac_files; do \
86           case $$ac_file in \
87             *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) rm -rf $$ac_file ;; \
88           esac; \
89         done