source: ThirdParty/ASL/trunk/Makefile.am @ 3280

Last change on this file since 3280 was 3129, checked in by tkr, 6 years ago

Changes so linker flag is only added in CYGWIN

  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1# Copyright (C) 2003, 2007 International Business Machines and others.
2# All Rights Reserved.
3# This file is distributed under the Eclipse Public License.
4
5## $Id: Makefile.am 3129 2013-12-10 14:22:43Z tkr $
6
7# the idea is to use the ASL Makefiles to build a static $(AMPLSOLVER_A) library via the compile_*_ASL scripts
8# from this library, we create a libcoinasl.la libtool library
9# in a MS VC build, we assume static libraries are used, so we can use the usual libtool machinery via LIBADD
10# in a normal build, we build the libcoinasl.la library by extracting the $(AMPLSOLVER_A) library and relinking it via libtool
11#    in a shared library build, this should give a shared libcoinasl.so library
12#    further, configure should have taken care of adding -fPIC -DPIC to the CFLAGS when compiling the ASL sources
13#    to avoid a failure when building static libraries and a libtool warning, we additionally create .lo files for each object
14
15AUTOMAKE_OPTIONS = foreign
16
17EXTRA_DIST = get.ASL INSTALL.ASL
18
19if COIN_CC_IS_CL
20lib_LTLIBRARIES = libcoinasl.la
21
22libcoinasl_la_SOURCES =
23libcoinasl_la_LIBADD = $(AMPLSOLVER_A)
24libcoinasl_la_DEPENDENCIES = $(AMPLSOLVER_A)
25
26# This is for libtool
27libcoinasl_la_LDFLAGS = $(LT_LDFLAGS)
28
29else
30libcoinasl_la_LIBADD =
31libcoinasl_la_LDFLAGS =
32endif
33
34if DEPENDENCY_LINKING
35libcoinasl_la_LIBADD += $(ASL_PCLIBS)
36if HOST_IS_CYGWIN
37libcoinasl_la_LDFLAGS += -Wl,--export-all-symbols
38endif
39endif
40
41########################################################################
42#                           Extra Targets                              #
43########################################################################
44
45compdir = compdir
46
47alltargets = stdio1.h arith.h funcadd0.$(OBJEXT)
48
49if COIN_CC_IS_CL
50$(AMPLSOLVER_A):
51        ./compile_MS_ASL
52else
53$(AMPLSOLVER_A):
54        ./compile_Unix_ASL
55
56libcoinasl.la : $(AMPLSOLVER_A)
57        $(mkdir_p) linkdir ; cd linkdir ; \
58        $(AR) x ../$(AMPLSOLVER_A) ; \
59        for i in *.o ; do \
60          lofile=`echo $$i | sed -e 's/.o$$/.lo/'`; \
61          echo "# fake line" > $$lofile ; \
62          echo "# Generated by fake libtool" >> $$lofile ; \
63          echo "pic_object='$$i'" >> $$lofile ; \
64          echo "non_pic_object='$$i'" >> $$lofile ; \
65        done ; cd ..
66        $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -rpath $(libdir) $(LT_LDFLAGS) linkdir/*.lo $(libcoinasl_la_LIBADD) $(libcoinasl_la_LDFLAGS)
67        rm -rf linkdir
68
69install-exec-local: libcoinasl.la
70        test -z "$(libdir)" || $(mkdir_p) "$(DESTDIR)$(libdir)"
71        if test -f libcoinasl.la; then \
72          $(LIBTOOL) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) libcoinasl.la "$(DESTDIR)$(libdir)/libcoinasl.la"; \
73        fi
74
75uninstall-local:
76        $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/libcoinasl.la"
77
78alltargets += libcoinasl.la
79
80endif
81
82stdio1.h arith.h funcadd0.$(OBJEXT): $(AMPLSOLVER_A)
83
84all-local: $(alltargets)
85
86test:
87        @echo "No test available for ASL."
88
89thirdpartyincludedir = $(includedir)/coin/ThirdParty
90thirdpartyinclude_HEADERS = \
91  solvers/asl.h solvers/asl_pfg.h solvers/asl_pfgh.h solvers/psinfo.h solvers/funcadd.h \
92  solvers/nlp.h solvers/nlp2.h solvers/getstub.h solvers/opcode.hd solvers/r_opn.hd \
93  stdio1.h arith.h
94
95pkgconfiglibdir = $(libdir)/pkgconfig
96pkgconfiglib_DATA = coinasl.pc
97
98CLEANFILES = $(AMPLSOLVER_A) $(alltargets)
99
100########################################################################
101#                         Maintainer Stuff                             #
102########################################################################
103
104# Files that are generated and should be cleaned with make distclean
105DISTCLEANFILES =
106
107include BuildTools/Makemain.inc
Note: See TracBrowser for help on using the repository browser.