Makefile.am 4.9 KB

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