1#*************************************************************************** 2# _ _ ____ _ 3# Project ___| | | | _ \| | 4# / __| | | | |_) | | 5# | (__| |_| | _ <| |___ 6# \___|\___/|_| \_\_____| 7# 8# Copyright (C) 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 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########################################################################### 24AUTOMAKE_OPTIONS = foreign nostdinc 25 26CMAKE_DIST = CMakeLists.txt curl_config.h.cmake 27 28EXTRA_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 34lib_LTLIBRARIES = libcurl.la 35 36if BUILD_UNITTESTS 37noinst_LTLIBRARIES = libcurlu.la 38else 39noinst_LTLIBRARIES = 40endif 41 42# This might hold -Werror 43CFLAGS += @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 54AM_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 59LIBS = $(BLANK_AT_MAKETIME) 60 61include Makefile.soname 62 63AM_CPPFLAGS += -DBUILDING_LIBCURL 64AM_LDFLAGS = 65AM_CFLAGS = 66 67# Makefile.inc provides the CSOURCES and HHEADERS defines 68include Makefile.inc 69 70libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS) 71libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS) 72 73libcurl_la_CPPFLAGS_EXTRA = 74libcurl_la_LDFLAGS_EXTRA = 75libcurl_la_CFLAGS_EXTRA = 76 77if CURL_LT_SHLIB_USE_VERSION_INFO 78libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO) 79endif 80 81if CURL_LT_SHLIB_USE_NO_UNDEFINED 82libcurl_la_LDFLAGS_EXTRA += -no-undefined 83endif 84 85if CURL_LT_SHLIB_USE_MIMPURE_TEXT 86libcurl_la_LDFLAGS_EXTRA += -mimpure-text 87endif 88 89if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS 90libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers 91else 92# if symbol-hiding is enabled, hide them! 93if DOING_CURL_SYMBOL_HIDING 94libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*' 95endif 96endif 97 98if USE_CPPFLAG_CURL_STATICLIB 99libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB 100else 101if HAVE_WINDRES 102libcurl_la_SOURCES += $(LIB_RCFILES) 103$(LIB_RCFILES): $(top_srcdir)/include/curl/curlver.h 104endif 105endif 106 107if DOING_CURL_SYMBOL_HIDING 108libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS 109libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING) 110endif 111 112libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA) 113libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS) 114libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA) 115 116libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS 117libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS) 118libcurlu_la_CFLAGS = $(AM_CFLAGS) 119 120CHECKSRC = $(CS_$(V)) 121CS_0 = @echo " RUN " $@; 122CS_1 = 123CS_ = $(CS_0) 124 125checksrc: 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 130if CURLDEBUG 131# for debug builds, we scan the sources on all regular make invokes 132all-local: checksrc 133endif 134 135# disable the tests that are mostly causing false positives 136TIDYFLAGS=-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 138TIDY:=clang-tidy 139 140tidy: 141 $(TIDY) $(CSOURCES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H 142 143optiontable: 144 perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c 145 146if HAVE_WINDRES 147.rc.lo: 148 $(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include $(RCFLAGS) -i $< -o $@ 149endif 150