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

Last change on this file since 2142 was 2142, checked in by stefan, 10 years ago

fake libtool objects to avoid warning and empty archive in static build

  • Property svn:keywords set to Author Date Id Revision
File size: 2.9 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 2142 2011-03-27 17:41:57Z stefan $
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)
24
25# This is for libtool
26libcoinasl_la_LDFLAGS = $(LT_LDFLAGS)
27endif
28
29########################################################################
30#                           Extra Targets                              #
31########################################################################
32
33compdir = compdir
34
35alltargets = stdio1.h arith.h funcadd0.$(OBJEXT)
36
37if COIN_CC_IS_CL
38$(AMPLSOLVER_A):
39        ./compile_MS_ASL
40       
41else
42$(AMPLSOLVER_A):
43        ./compile_Unix_ASL
44
45libcoinasl.la : $(AMPLSOLVER_A)
46        $(mkdir_p) linkdir ; cd linkdir ; \
47        $(AR) x ../$(AMPLSOLVER_A) ; \
48        for i in *.o ; do \
49          lofile=`echo $$i | sed -e 's/.o$$/.lo/'`; \
50          echo "# fake line" > $$lofile ; \
51          echo "# Generated by fake libtool" >> $$lofile ; \
52          echo "pic_object='$$i'" >> $$lofile ; \
53          echo "non_pic_object='$$i'" >> $$lofile ; \
54        done ; cd ..
55        $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ -rpath $(libdir) $(LT_LDFLAGS) linkdir/*.lo
56        rm -rf linkdir
57
58alltargets += libcoinasl.la
59
60thirdpartylibdir = $(libdir)
61thirdpartylib_DATA = libcoinasl.la
62endif
63
64stdio1.h arith.h funcadd0.$(OBJEXT): $(AMPLSOLVER_A)
65
66all-local: $(alltargets)
67
68test:
69        @echo "No test available for ASL."
70
71thirdpartyincludedir = $(includedir)/coin/ThirdParty
72thirdpartyinclude_HEADERS = \
73  solvers/asl.h solvers/asl_pfg.h solvers/asl_pfgh.h solvers/psinfo.h solvers/funcadd.h \
74  solvers/nlp.h solvers/nlp2.h solvers/getstub.h solvers/opcode.hd solvers/r_opn.hd \
75  stdio1.h arith.h
76
77pkgconfiglibdir = $(libdir)/pkgconfig
78pkgconfiglib_DATA = coinasl.pc
79
80CLEANFILES = $(AMPLSOLVER_A) $(alltargets)
81
82########################################################################
83#                         Maintainer Stuff                             #
84########################################################################
85
86# Files that are generated and should be cleaned with make distclean
87DISTCLEANFILES =
88
89include BuildTools/Makemain.inc
Note: See TracBrowser for help on using the repository browser.