1 | #***************************************************************************
|
---|
2 | # _ _ ____ _
|
---|
3 | # Project ___| | | | _ \| |
|
---|
4 | # / __| | | | |_) | |
|
---|
5 | # | (__| |_| | _ <| |___
|
---|
6 | # \___|\___/|_| \_\_____|
|
---|
7 | #
|
---|
8 | # Copyright (C) 1998 - 2022, Daniel Stenberg, <[email protected]>, 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 https://curl.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 | # SPDX-License-Identifier: curl
|
---|
22 | #
|
---|
23 | ###########################################################################
|
---|
24 | AUTOMAKE_OPTIONS = foreign nostdinc
|
---|
25 |
|
---|
26 | CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
|
---|
27 |
|
---|
28 | EXTRA_DIST = Makefile.mk config-win32.h config-win32ce.h config-plan9.h \
|
---|
29 | config-riscos.h config-mac.h curl_config.h.in config-dos.h \
|
---|
30 | libcurl.plist libcurl.rc config-amigaos.h config-win32ce.h \
|
---|
31 | config-os400.h setup-os400.h $(CMAKE_DIST) setup-win32.h .checksrc \
|
---|
32 | Makefile.soname
|
---|
33 |
|
---|
34 | lib_LTLIBRARIES = libcurl.la
|
---|
35 |
|
---|
36 | if BUILD_UNITTESTS
|
---|
37 | noinst_LTLIBRARIES = libcurlu.la
|
---|
38 | else
|
---|
39 | noinst_LTLIBRARIES =
|
---|
40 | endif
|
---|
41 |
|
---|
42 | # This might hold -Werror
|
---|
43 | CFLAGS += @CURL_CFLAG_EXTRAS@
|
---|
44 |
|
---|
45 | # Specify our include paths here, and do it relative to $(top_srcdir) and
|
---|
46 | # $(top_builddir), to ensure that these paths which belong to the library
|
---|
47 | # being currently built and tested are searched before the library which
|
---|
48 | # might possibly already be installed in the system.
|
---|
49 | #
|
---|
50 | # $(top_srcdir)/include is for libcurl's external include files
|
---|
51 | # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
|
---|
52 | # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files
|
---|
53 |
|
---|
54 | AM_CPPFLAGS = -I$(top_srcdir)/include \
|
---|
55 | -I$(top_builddir)/lib \
|
---|
56 | -I$(top_srcdir)/lib
|
---|
57 |
|
---|
58 | # Prevent LIBS from being used for all link targets
|
---|
59 | LIBS = $(BLANK_AT_MAKETIME)
|
---|
60 |
|
---|
61 | include Makefile.soname
|
---|
62 |
|
---|
63 | AM_CPPFLAGS += -DBUILDING_LIBCURL
|
---|
64 | AM_LDFLAGS =
|
---|
65 | AM_CFLAGS =
|
---|
66 |
|
---|
67 | # Makefile.inc provides the CSOURCES and HHEADERS defines
|
---|
68 | include Makefile.inc
|
---|
69 |
|
---|
70 | libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
---|
71 | libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
---|
72 |
|
---|
73 | libcurl_la_CPPFLAGS_EXTRA =
|
---|
74 | libcurl_la_LDFLAGS_EXTRA =
|
---|
75 | libcurl_la_CFLAGS_EXTRA =
|
---|
76 |
|
---|
77 | if CURL_LT_SHLIB_USE_VERSION_INFO
|
---|
78 | libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO)
|
---|
79 | endif
|
---|
80 |
|
---|
81 | if CURL_LT_SHLIB_USE_NO_UNDEFINED
|
---|
82 | libcurl_la_LDFLAGS_EXTRA += -no-undefined
|
---|
83 | endif
|
---|
84 |
|
---|
85 | if CURL_LT_SHLIB_USE_MIMPURE_TEXT
|
---|
86 | libcurl_la_LDFLAGS_EXTRA += -mimpure-text
|
---|
87 | endif
|
---|
88 |
|
---|
89 | if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
|
---|
90 | libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
|
---|
91 | else
|
---|
92 | # if symbol-hiding is enabled, hide them!
|
---|
93 | if DOING_CURL_SYMBOL_HIDING
|
---|
94 | libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
|
---|
95 | endif
|
---|
96 | endif
|
---|
97 |
|
---|
98 | if USE_CPPFLAG_CURL_STATICLIB
|
---|
99 | libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
|
---|
100 | else
|
---|
101 | if HAVE_WINDRES
|
---|
102 | libcurl_la_SOURCES += $(LIB_RCFILES)
|
---|
103 | $(LIB_RCFILES): $(top_srcdir)/include/curl/curlver.h
|
---|
104 | endif
|
---|
105 | endif
|
---|
106 |
|
---|
107 | if DOING_CURL_SYMBOL_HIDING
|
---|
108 | libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
|
---|
109 | libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
|
---|
110 | endif
|
---|
111 |
|
---|
112 | libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA)
|
---|
113 | libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS)
|
---|
114 | libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA)
|
---|
115 |
|
---|
116 | libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
|
---|
117 | libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS)
|
---|
118 | libcurlu_la_CFLAGS = $(AM_CFLAGS)
|
---|
119 |
|
---|
120 | CHECKSRC = $(CS_$(V))
|
---|
121 | CS_0 = @echo " RUN " $@;
|
---|
122 | CS_1 =
|
---|
123 | CS_ = $(CS_0)
|
---|
124 |
|
---|
125 | checksrc:
|
---|
126 | $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
|
---|
127 | -W$(srcdir)/curl_config.h $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] \
|
---|
128 | $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch])
|
---|
129 |
|
---|
130 | if CURLDEBUG
|
---|
131 | # for debug builds, we scan the sources on all regular make invokes
|
---|
132 | all-local: checksrc
|
---|
133 | endif
|
---|
134 |
|
---|
135 | # disable the tests that are mostly causing false positives
|
---|
136 | TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-valist.Uninitialized,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.NullDereference -quiet
|
---|
137 |
|
---|
138 | TIDY:=clang-tidy
|
---|
139 |
|
---|
140 | tidy:
|
---|
141 | $(TIDY) $(CSOURCES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
|
---|
142 |
|
---|
143 | optiontable:
|
---|
144 | perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
|
---|
145 |
|
---|
146 | if HAVE_WINDRES
|
---|
147 | .rc.lo:
|
---|
148 | $(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include $(RCFLAGS) -i $< -o $@
|
---|
149 | endif
|
---|