06ae05df3837159e45001fca1ba3f34f84f7c42b
[platform/upstream/curl.git] / lib / Makefile.am
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al.
9 #
10 # This software is licensed as described in the file COPYING, which
11 # you should have received as part of this distribution. The terms
12 # are also available at http://curl.haxx.se/docs/copyright.html.
13 #
14 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
15 # copies of the Software, and permit persons to whom the Software is
16 # furnished to do so, under the terms of the COPYING file.
17 #
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
20 #
21 # $Id$
22 ###########################################################################
23 AUTOMAKE_OPTIONS = foreign nostdinc
24
25 DSP = curllib.dsp
26 VCPROJ = curllib.vcproj
27
28 DOCS = README.encoding README.memoryleak README.ares README.curlx       \
29  README.hostip README.multi_socket README.httpauth README.pipelining
30
31 EXTRA_DIST = Makefile.b32 Makefile.m32 Makefile.vc6 Makefile.riscos     \
32  $(DSP) curllib.dsw config-win32.h config-win32ce.h config-riscos.h     \
33  config-mac.h config.h.in ca-bundle.crt makefile.dj config.dos          \
34  libcurl.framework.make libcurl.plist libcurl.rc config-amigaos.h       \
35  amigaos.c amigaos.h makefile.amiga Makefile.netware nwlib.c nwos.c     \
36  libcurl.imp msvcproj.head msvcproj.foot config-win32ce.h               \
37  config-os400.h setup-os400.h \
38  Makefile.Watcom config-tpf.h $(DOCS) $(VCPROJ)
39
40 CLEANFILES = $(DSP) $(VCPROJ)
41
42 lib_LTLIBRARIES = libcurl.la
43 LIBCURL_LIBS = @LIBCURL_LIBS@
44
45 # we use srcdir/include for the static global include files
46 # we use builddir/lib for the generated lib/config.h file to get found
47 # we use srcdir/lib for the lib-private header files
48
49 INCLUDES = -I$(top_srcdir)/include \
50            -I$(top_builddir)/lib   \
51            -I$(top_srcdir)/lib
52
53 VERSION=-version-info 4:0:0
54
55 # This flag accepts an argument of the form current[:revision[:age]]. So,
56 # passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
57 # 1.
58 #
59 # If either revision or age are omitted, they default to 0. Also note that age
60 # must be less than or equal to the current interface number.
61 #
62 # Here are a set of rules to help you update your library version information:
63 #
64 # 1.Start with version information of 0:0:0 for each libtool library.
65 #
66 # 2.Update the version information only immediately before a public release of
67 # your software. More frequent updates are unnecessary, and only guarantee
68 # that the current interface number gets larger faster.
69 #
70 # 3.If the library source code has changed at all since the last update, then
71 # increment revision (c:r+1:a)
72 #
73 # 4.If any interfaces have been added, removed, or changed since the last
74 # update, increment current, and set revision to 0. (c+1:r=0:a)
75 #
76 # 5.If any interfaces have been added since the last public release, then
77 # increment age. (c:r:a+1)
78 #
79 # 6.If any interfaces have been removed since the last public release, then
80 # set age to 0. (c:r:a=0)
81 #
82
83 if NO_UNDEFINED
84 # The -no-undefined flag is CRUCIAL for this to build fine on Cygwin.
85 UNDEF = -no-undefined
86 endif
87
88 if MIMPURE
89 # This is for gcc on Solaris (8+ ?) to avoid "relocations remain against
90 # allocatable but non-writable sections" problems.
91 MIMPURE = -mimpure-text
92 endif
93
94 libcurl_la_LDFLAGS = $(UNDEF) $(VERSION) $(MIMPURE) $(LIBCURL_LIBS)
95
96 # Makefile.inc provides the CSOURCES and HHEADERS defines
97 include Makefile.inc
98
99 libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
100
101 WIN32SOURCES = $(CSOURCES)
102 WIN32HEADERS = $(HHEADERS) config-win32.h
103
104 BUILT_SOURCES = $(top_builddir)/lib/ca-bundle.h
105
106 $(top_builddir)/lib/ca-bundle.h: Makefile.in Makefile
107         @if test -f $@; then \
108           chmod 0644 $@; \
109         fi
110         echo "/* This file is generated automatically */" > $@
111 if CABUNDLE
112         echo '#define CURL_CA_BUNDLE @CURL_CA_BUNDLE@' >> $@
113 else
114         echo '#undef CURL_CA_BUNDLE /* unknown */' >> $@
115 endif
116
117 install-data-hook:
118         @if test -n "@CURL_CA_BUNDLE@"; then \
119           $(mkinstalldirs) `dirname $(DESTDIR)@CURL_CA_BUNDLE@`; \
120           @INSTALL_DATA@ $(srcdir)/ca-bundle.crt $(DESTDIR)@CURL_CA_BUNDLE@; \
121         fi
122
123 # this hook is mainly for non-unix systems to build even if configure
124 # isn't run
125 dist-hook:
126         chmod 0644 $(distdir)/ca-bundle.h
127         echo "/* ca bundle path set in here*/" > $(distdir)/ca-bundle.h
128
129 DSPOUT = | awk '{printf("%s\r\n", $$0)}' >> $(DSP)
130 VCPROJOUT = | awk '{printf("%s\r\n", $$0)}' >> $(VCPROJ)
131
132 $(DSP): msvcproj.head msvcproj.foot Makefile.am
133         echo "creating $(DSP)"
134         @(cp $(srcdir)/msvcproj.head $(DSP); \
135         echo "# Begin Group \"Source Files\"" $(DSPOUT); \
136         for file in $(WIN32SOURCES); do \
137         echo "# Begin Source File" $(DSPOUT); \
138         echo "" $(DSPOUT); \
139         echo "SOURCE=.\\"$$file $(DSPOUT); \
140         echo "# End Source File" $(DSPOUT); \
141         done; \
142         echo "# End Group" $(DSPOUT); \
143         echo "# Begin Group \"Header Files\"" $(DSPOUT); \
144         for file in $(WIN32HEADERS); do \
145         echo "# Begin Source File" $(DSPOUT); \
146         echo "" $(DSPOUT); \
147         echo "SOURCE=.\\"$$file $(DSPOUT); \
148         echo "# End Source File" $(DSPOUT); \
149         done; \
150         echo "# End Group" $(DSPOUT); \
151         cat $(srcdir)/msvcproj.foot $(DSPOUT) )
152
153 $(VCPROJ): vc8proj.head vc8proj.foot Makefile.am
154         echo "creating $(VCPROJ)"
155         @(cp $(srcdir)/vc8proj.head $(VCPROJ); \
156         for file in $(WIN32SOURCES); do \
157         echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT); \
158         done; \
159         echo "</Filter><Filter  Name=\"Header Files\">" $(VCPROJOUT); \
160         for file in $(WIN32HEADERS); do \
161         echo "<File RelativePath=\""$$file"\"></File>" $(VCPROJOUT); \
162         done; \
163         cat $(srcdir)/vc8proj.foot $(VCPROJOUT) )