1 | #***************************************************************************
|
---|
2 | # _ _ ____ _
|
---|
3 | # Project ___| | | | _ \| |
|
---|
4 | # / __| | | | |_) | |
|
---|
5 | # | (__| |_| | _ <| |___
|
---|
6 | # \___|\___/|_| \_\_____|
|
---|
7 | #
|
---|
8 | # Copyright (C) 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 | CHECKSRC_DIST = .checksrc vauth/.checksrc vquic/.checksrc vssh/.checksrc \
|
---|
29 | vtls/.checksrc
|
---|
30 |
|
---|
31 | EXTRA_DIST = Makefile.mk config-win32.h config-win32ce.h config-plan9.h \
|
---|
32 | config-riscos.h config-mac.h curl_config.h.in config-dos.h libcurl.rc \
|
---|
33 | config-amigaos.h config-win32ce.h config-os400.h setup-os400.h \
|
---|
34 | $(CMAKE_DIST) setup-win32.h Makefile.soname optiontable.pl libcurl.def \
|
---|
35 | $(CHECKSRC_DIST)
|
---|
36 |
|
---|
37 | lib_LTLIBRARIES = libcurl.la
|
---|
38 |
|
---|
39 | if BUILD_UNITTESTS
|
---|
40 | noinst_LTLIBRARIES = libcurlu.la
|
---|
41 | else
|
---|
42 | noinst_LTLIBRARIES =
|
---|
43 | endif
|
---|
44 |
|
---|
45 | # This might hold -Werror
|
---|
46 | CFLAGS += @CURL_CFLAG_EXTRAS@
|
---|
47 |
|
---|
48 | # Specify our include paths here, and do it relative to $(top_srcdir) and
|
---|
49 | # $(top_builddir), to ensure that these paths which belong to the library
|
---|
50 | # being currently built and tested are searched before the library which
|
---|
51 | # might possibly already be installed in the system.
|
---|
52 | #
|
---|
53 | # $(top_srcdir)/include is for libcurl's external include files
|
---|
54 | # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
|
---|
55 | # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files
|
---|
56 |
|
---|
57 | AM_CPPFLAGS = -I$(top_srcdir)/include \
|
---|
58 | -I$(top_builddir)/lib \
|
---|
59 | -I$(top_srcdir)/lib
|
---|
60 |
|
---|
61 | # Prevent LIBS from being used for all link targets
|
---|
62 | LIBS = $(BLANK_AT_MAKETIME)
|
---|
63 |
|
---|
64 | include Makefile.soname
|
---|
65 |
|
---|
66 | AM_CPPFLAGS += -DBUILDING_LIBCURL
|
---|
67 | AM_LDFLAGS =
|
---|
68 | AM_CFLAGS =
|
---|
69 |
|
---|
70 | # Makefile.inc provides the CSOURCES and HHEADERS defines
|
---|
71 | include Makefile.inc
|
---|
72 |
|
---|
73 | if USE_UNITY
|
---|
74 | # Keep these separate to avoid duplicate definitions when linking libtests
|
---|
75 | # in static mode.
|
---|
76 | curl_EXCLUDE = curl_threads.c timediff.c warnless.c
|
---|
77 | if DEBUGBUILD
|
---|
78 | # We must compile these sources separately to avoid memdebug.h redefinitions
|
---|
79 | # applying to them.
|
---|
80 | curl_EXCLUDE += memdebug.c curl_multibyte.c
|
---|
81 | endif
|
---|
82 | libcurl_unity.c: $(top_srcdir)/scripts/mk-unity.pl $(CSOURCES)
|
---|
83 | @PERL@ $(top_srcdir)/scripts/mk-unity.pl $(srcdir) $(CSOURCES) --exclude $(curl_EXCLUDE) > libcurl_unity.c
|
---|
84 |
|
---|
85 | nodist_libcurl_la_SOURCES = libcurl_unity.c
|
---|
86 | libcurl_la_SOURCES = $(curl_EXCLUDE)
|
---|
87 | nodist_libcurlu_la_SOURCES = libcurl_unity.c
|
---|
88 | libcurlu_la_SOURCES = $(curl_EXCLUDE)
|
---|
89 | CLEANFILES = libcurl_unity.c
|
---|
90 | else
|
---|
91 | libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
---|
92 | libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
|
---|
93 | endif
|
---|
94 |
|
---|
95 | libcurl_la_CPPFLAGS_EXTRA =
|
---|
96 | libcurl_la_LDFLAGS_EXTRA =
|
---|
97 | libcurl_la_CFLAGS_EXTRA =
|
---|
98 |
|
---|
99 | if CURL_LT_SHLIB_USE_VERSION_INFO
|
---|
100 | libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO)
|
---|
101 | endif
|
---|
102 |
|
---|
103 | if CURL_LT_SHLIB_USE_NO_UNDEFINED
|
---|
104 | libcurl_la_LDFLAGS_EXTRA += -no-undefined
|
---|
105 | endif
|
---|
106 |
|
---|
107 | if CURL_LT_SHLIB_USE_MIMPURE_TEXT
|
---|
108 | libcurl_la_LDFLAGS_EXTRA += -mimpure-text
|
---|
109 | endif
|
---|
110 |
|
---|
111 | if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
|
---|
112 | libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
|
---|
113 | else
|
---|
114 | # if symbol-hiding is enabled, hide them!
|
---|
115 | if DOING_CURL_SYMBOL_HIDING
|
---|
116 | libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
|
---|
117 | endif
|
---|
118 | endif
|
---|
119 |
|
---|
120 | if USE_CPPFLAG_CURL_STATICLIB
|
---|
121 | libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
|
---|
122 | else
|
---|
123 | if HAVE_WINDRES
|
---|
124 | libcurl_la_SOURCES += $(LIB_RCFILES)
|
---|
125 | $(LIB_RCFILES): $(top_srcdir)/include/curl/curlver.h
|
---|
126 | endif
|
---|
127 | endif
|
---|
128 |
|
---|
129 | if DOING_CURL_SYMBOL_HIDING
|
---|
130 | libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
|
---|
131 | libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
|
---|
132 | endif
|
---|
133 |
|
---|
134 | libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA)
|
---|
135 | libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(CURL_LDFLAGS_LIB) $(LIBCURL_PC_LIBS_PRIVATE)
|
---|
136 | libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA)
|
---|
137 |
|
---|
138 | libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
|
---|
139 | libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_PC_LIBS_PRIVATE)
|
---|
140 | libcurlu_la_CFLAGS = $(AM_CFLAGS)
|
---|
141 |
|
---|
142 | CHECKSRC = $(CS_$(V))
|
---|
143 | CS_0 = @echo " RUN " $@;
|
---|
144 | CS_1 =
|
---|
145 | CS_ = $(CS_0)
|
---|
146 |
|
---|
147 | checksrc:
|
---|
148 | $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
|
---|
149 | -W$(srcdir)/curl_config.h $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] \
|
---|
150 | $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch])
|
---|
151 |
|
---|
152 | if DEBUGBUILD
|
---|
153 | # for debug builds, we scan the sources on all regular make invokes
|
---|
154 | all-local: checksrc
|
---|
155 | endif
|
---|
156 |
|
---|
157 | # disable the tests that are mostly causing false positives
|
---|
158 | 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
|
---|
159 |
|
---|
160 | TIDY:=clang-tidy
|
---|
161 |
|
---|
162 | tidy:
|
---|
163 | $(TIDY) $(CSOURCES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
|
---|
164 |
|
---|
165 | optiontable:
|
---|
166 | perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
|
---|
167 |
|
---|
168 | if HAVE_WINDRES
|
---|
169 | .rc.lo:
|
---|
170 | $(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include $(RCFLAGS) -i $< -o $@
|
---|
171 | endif
|
---|