Makefile.am 4.9 KB

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