Makefile.am 4.8 KB

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