Makefile.am 5.3 KB

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