Makefile.am 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. ###########################################################################
  24. AUTOMAKE_OPTIONS = foreign nostdinc
  25. CMAKE_DIST = CMakeLists.txt curl_config.h.cmake
  26. EXTRA_DIST = Makefile.mk config-win32.h config-win32ce.h config-plan9.h \
  27. config-riscos.h config-mac.h curl_config.h.in config-dos.h \
  28. libcurl.plist libcurl.rc config-amigaos.h config-win32ce.h \
  29. config-os400.h setup-os400.h $(CMAKE_DIST) setup-win32.h .checksrc \
  30. Makefile.soname
  31. lib_LTLIBRARIES = libcurl.la
  32. if BUILD_UNITTESTS
  33. noinst_LTLIBRARIES = libcurlu.la
  34. else
  35. noinst_LTLIBRARIES =
  36. endif
  37. # This might hold -Werror
  38. CFLAGS += @CURL_CFLAG_EXTRAS@
  39. # Specify our include paths here, and do it relative to $(top_srcdir) and
  40. # $(top_builddir), to ensure that these paths which belong to the library
  41. # being currently built and tested are searched before the library which
  42. # might possibly already be installed in the system.
  43. #
  44. # $(top_srcdir)/include is for libcurl's external include files
  45. # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
  46. # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "private" files
  47. AM_CPPFLAGS = -I$(top_srcdir)/include \
  48. -I$(top_builddir)/lib \
  49. -I$(top_srcdir)/lib
  50. # Prevent LIBS from being used for all link targets
  51. LIBS = $(BLANK_AT_MAKETIME)
  52. include Makefile.soname
  53. AM_CPPFLAGS += -DBUILDING_LIBCURL
  54. AM_LDFLAGS =
  55. AM_CFLAGS =
  56. # Makefile.inc provides the CSOURCES and HHEADERS defines
  57. include Makefile.inc
  58. libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
  59. libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
  60. libcurl_la_CPPFLAGS_EXTRA =
  61. libcurl_la_LDFLAGS_EXTRA =
  62. libcurl_la_CFLAGS_EXTRA =
  63. if CURL_LT_SHLIB_USE_VERSION_INFO
  64. libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO)
  65. endif
  66. if CURL_LT_SHLIB_USE_NO_UNDEFINED
  67. libcurl_la_LDFLAGS_EXTRA += -no-undefined
  68. endif
  69. if CURL_LT_SHLIB_USE_MIMPURE_TEXT
  70. libcurl_la_LDFLAGS_EXTRA += -mimpure-text
  71. endif
  72. if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
  73. libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
  74. else
  75. # if symbol-hiding is enabled, hide them!
  76. if DOING_CURL_SYMBOL_HIDING
  77. libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
  78. endif
  79. endif
  80. if USE_CPPFLAG_CURL_STATICLIB
  81. libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
  82. else
  83. if HAVE_WINDRES
  84. libcurl_la_SOURCES += $(LIB_RCFILES)
  85. $(LIB_RCFILES): $(top_srcdir)/include/curl/curlver.h
  86. endif
  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) $(CURL_LDFLAGS_LIB) $(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. CHECKSRC = $(CS_$(V))
  99. CS_0 = @echo " RUN " $@;
  100. CS_1 =
  101. CS_ = $(CS_0)
  102. checksrc:
  103. $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
  104. -W$(srcdir)/curl_config.h $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] \
  105. $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch])
  106. if CURLDEBUG
  107. # for debug builds, we scan the sources on all regular make invokes
  108. all-local: checksrc
  109. endif
  110. # disable the tests that are mostly causing false positives
  111. 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
  112. TIDY:=clang-tidy
  113. tidy:
  114. $(TIDY) $(CSOURCES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
  115. optiontable:
  116. perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
  117. if HAVE_WINDRES
  118. .rc.lo:
  119. $(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include $(RCFLAGS) -i $< -o $@
  120. endif