Makefile.am 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  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 libcurl.rc \
  28. config-amigaos.h config-win32ce.h config-os400.h setup-os400.h \
  29. $(CMAKE_DIST) setup-win32.h .checksrc Makefile.soname
  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. include Makefile.soname
  52. AM_CPPFLAGS += -DBUILDING_LIBCURL
  53. AM_LDFLAGS =
  54. AM_CFLAGS =
  55. # Makefile.inc provides the CSOURCES and HHEADERS defines
  56. include Makefile.inc
  57. libcurl_la_SOURCES = $(CSOURCES) $(HHEADERS)
  58. libcurlu_la_SOURCES = $(CSOURCES) $(HHEADERS)
  59. libcurl_la_CPPFLAGS_EXTRA =
  60. libcurl_la_LDFLAGS_EXTRA =
  61. libcurl_la_CFLAGS_EXTRA =
  62. if CURL_LT_SHLIB_USE_VERSION_INFO
  63. libcurl_la_LDFLAGS_EXTRA += $(VERSIONINFO)
  64. endif
  65. if CURL_LT_SHLIB_USE_NO_UNDEFINED
  66. libcurl_la_LDFLAGS_EXTRA += -no-undefined
  67. endif
  68. if CURL_LT_SHLIB_USE_MIMPURE_TEXT
  69. libcurl_la_LDFLAGS_EXTRA += -mimpure-text
  70. endif
  71. if CURL_LT_SHLIB_USE_VERSIONED_SYMBOLS
  72. libcurl_la_LDFLAGS_EXTRA += -Wl,--version-script=libcurl.vers
  73. else
  74. # if symbol-hiding is enabled, hide them!
  75. if DOING_CURL_SYMBOL_HIDING
  76. libcurl_la_LDFLAGS_EXTRA += -export-symbols-regex '^curl_.*'
  77. endif
  78. endif
  79. if USE_CPPFLAG_CURL_STATICLIB
  80. libcurl_la_CPPFLAGS_EXTRA += -DCURL_STATICLIB
  81. else
  82. if HAVE_WINDRES
  83. libcurl_la_SOURCES += $(LIB_RCFILES)
  84. $(LIB_RCFILES): $(top_srcdir)/include/curl/curlver.h
  85. endif
  86. endif
  87. if DOING_CURL_SYMBOL_HIDING
  88. libcurl_la_CPPFLAGS_EXTRA += -DCURL_HIDDEN_SYMBOLS
  89. libcurl_la_CFLAGS_EXTRA += $(CFLAG_CURL_SYMBOL_HIDING)
  90. endif
  91. libcurl_la_CPPFLAGS = $(AM_CPPFLAGS) $(libcurl_la_CPPFLAGS_EXTRA)
  92. libcurl_la_LDFLAGS = $(AM_LDFLAGS) $(libcurl_la_LDFLAGS_EXTRA) $(CURL_LDFLAGS_LIB) $(LIBCURL_LIBS)
  93. libcurl_la_CFLAGS = $(AM_CFLAGS) $(libcurl_la_CFLAGS_EXTRA)
  94. libcurlu_la_CPPFLAGS = $(AM_CPPFLAGS) -DCURL_STATICLIB -DUNITTESTS
  95. libcurlu_la_LDFLAGS = $(AM_LDFLAGS) -static $(LIBCURL_LIBS)
  96. libcurlu_la_CFLAGS = $(AM_CFLAGS)
  97. CHECKSRC = $(CS_$(V))
  98. CS_0 = @echo " RUN " $@;
  99. CS_1 =
  100. CS_ = $(CS_0)
  101. checksrc:
  102. $(CHECKSRC)(@PERL@ $(top_srcdir)/scripts/checksrc.pl -D$(srcdir) \
  103. -W$(srcdir)/curl_config.h $(srcdir)/*.[ch] $(srcdir)/vauth/*.[ch] \
  104. $(srcdir)/vtls/*.[ch] $(srcdir)/vquic/*.[ch] $(srcdir)/vssh/*.[ch])
  105. if CURLDEBUG
  106. # for debug builds, we scan the sources on all regular make invokes
  107. all-local: checksrc
  108. endif
  109. # disable the tests that are mostly causing false positives
  110. 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
  111. TIDY:=clang-tidy
  112. tidy:
  113. $(TIDY) $(CSOURCES) $(TIDYFLAGS) -- $(AM_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H
  114. optiontable:
  115. perl optiontable.pl < $(top_srcdir)/include/curl/curl.h > easyoptions.c
  116. if HAVE_WINDRES
  117. .rc.lo:
  118. $(LIBTOOL) --tag=RC --mode=compile $(RC) -I$(top_srcdir)/include $(RCFLAGS) -i $< -o $@
  119. endif