2
0

Makefile.am 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2022, 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. ###########################################################################
  24. AUTOMAKE_OPTIONS = foreign nostdinc
  25. CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
  26. EXTRA_DIST = Makefile.m32 config-win32.h config-win32ce.h config-plan9.h \
  27. config-riscos.h config-mac.h curl_config.h.in makefile.dj config-dos.h \
  28. libcurl.plist libcurl.rc config-amigaos.h makefile.amiga config-win32ce.h \
  29. config-os400.h setup-os400.h $(CMAKE_DIST) setup-win32.h .checksrc
  30. lib_LTLIBRARIES = libcurl.la
  31. if BUILD_UNITTESTS
  32. noinst_LTLIBRARIES = libcurlu.la
  33. else
  34. noinst_LTLIBRARIES =
  35. endif
  36. # This might hold -Werror
  37. CFLAGS += @CURL_CFLAG_EXTRAS@
  38. # Specify our include paths here, and do it relative to $(top_srcdir) and
  39. # $(top_builddir), to ensure that these paths which belong to the library
  40. # being currently built and tested are searched before the library which
  41. # might possibly already be installed in the system.
  42. #
  43. # $(top_srcdir)/include is for libcurl's external include files
  44. # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
  45. # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files
  46. AM_CPPFLAGS = -I$(top_srcdir)/include \
  47. -I$(top_builddir)/lib \
  48. -I$(top_srcdir)/lib
  49. # Prevent LIBS from being used for all link targets
  50. LIBS = $(BLANK_AT_MAKETIME)
  51. VERSIONINFO=-version-info 12:0:8
  52. # This flag accepts an argument of the form current[:revision[:age]]. So,
  53. # passing -version-info 3:12:1 sets current to 3, revision to 12, and age to
  54. # 1.
  55. #
  56. # Here's the simplified rule guide on how to change -version-info:
  57. # (current version is C:R:A)
  58. #
  59. # 1. if there are only source changes, use C:R+1:A
  60. # 2. if interfaces were added use C+1:0:A+1
  61. # 3. if interfaces were removed, then use C+1:0:0
  62. #
  63. # For the full guide on libcurl ABI rules, see docs/libcurl/ABI
  64. AM_CPPFLAGS += -DBUILDING_LIBCURL
  65. AM_LDFLAGS =
  66. AM_CFLAGS =
  67. # Makefile.inc provides the CSOURCES and HHEADERS defines
  68. include Makefile.inc
  69. libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
  70. libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
  71. libcurl_la_CPPFLAGS_EXTRA =
  72. libcurl_la_LDFLAGS_EXTRA =
  73. libcurl_la_CFLAGS_EXTRA =
  74. if CURL_LT_SHLIB_USE_VERSION_INFO
  75. libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO)
  76. endif
  77. if CURL_LT_SHLIB_USE_NO_UNDEFINED
  78. libcurl_la_LDFLAGS_EXTRA += -no-undefined
  79. endif
  80. if CURL_LT_SHLIB_USE_MIMPURE_TEXT
  81. libcurl_la_LDFLAGS_EXTRA += -mimpure-text
  82. endif
  83. if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
  84. libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
  85. else
  86. # if symbol-hiding is enabled, hide them!
  87. if DOING_CURL_SYMBOL_HIDING
  88. libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
  89. endif
  90. endif
  91. if USE_CPPFLAG_CURL_STATICLIB
  92. libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
  93. else
  94. if OS_WINDOWS
  95. libcurl_la_SOURCES += $(LIB_RCFILES)
  96. $(LIB_RCFILES): $(top_srcdir)/include/curl/curlver.h
  97. endif
  98. endif
  99. if DOING_CURL_SYMBOL_HIDING
  100. libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
  101. libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
  102. endif
  103. libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA)
  104. libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(LDFLAGS) $(LIBCURL_LIBS)
  105. libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA)
  106. libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
  107. libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS)
  108. libcurlu_la_CFLAGS = $(AM_CFLAGS)
  109. CHECKSRC = $(CS_$(V))
  110. CS_0 = @echo " RUN " $@;
  111. CS_1 =
  112. CS_ = $(CS_0)
  113. checksrc:
  114. $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
  115. -W$(srcdir)/curl_config.h $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] \
  116. $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch])
  117. if CURLDEBUG
  118. # for debug builds, we scan the sources on all regular make invokes
  119. all-local: checksrc
  120. endif
  121. # disable the tests that are mostly causing false positives
  122. 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
  123. TIDY:=clang-tidy
  124. tidy:
  125. $(TIDY) $(CSOURCES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
  126. optiontable:
  127. perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
  128. if OS_WINDOWS
  129. .rc.lo:
  130. $(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include $(RCFLAGS) -i $< -o $@
  131. endif