Makefile.am 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. #***************************************************************************
  2. # _ _ ____ _
  3. # Project ___| | | | _ \| |
  4. # / __| | | | |_) | |
  5. # | (__| |_| | _ <| |___
  6. # \___|\___/|_| \_\_____|
  7. #
  8. # Copyright (C) 1998 - 2021, 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. ###########################################################################
  22. AUTOMAKE_OPTIONS = foreign nostdinc
  23. # remove targets if the command fails
  24. .DELETE_ON_ERROR:
  25. # Specify our include paths here, and do it relative to $(top_srcdir) and
  26. # $(top_builddir), to ensure that these paths which belong to the library
  27. # being currently built and tested are searched before the library which
  28. # might possibly already be installed in the system.
  29. #
  30. # $(top_srcdir)/include is for libcurl's external include files
  31. # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
  32. # $(top_builddir)/src is for curl's generated src/curl_config.h file
  33. # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
  34. # $(top_srcdir)/src is for curl's src/tool_setup.h and "curl-private" files
  35. AM_CPPFLAGS = -I$(top_srcdir)/include \
  36. -I$(top_builddir)/lib \
  37. -I$(top_builddir)/src \
  38. -I$(top_srcdir)/lib \
  39. -I$(top_srcdir)/src
  40. bin_PROGRAMS = curl
  41. SUBDIRS = ../docs
  42. if USE_CPPFLAG_CURL_STATICLIB
  43. AM_CPPFLAGS += -DCURL_STATICLIB
  44. endif
  45. include Makefile.inc
  46. # CURL_FILES comes from Makefile.inc
  47. curl_SOURCES = $(CURL_FILES)
  48. # This might hold -Werror
  49. CFLAGS += @CURL_CFLAG_EXTRAS@
  50. # Prevent LIBS from being used for all link targets
  51. LIBS = $(BLANK_AT_MAKETIME)
  52. if USE_EXPLICIT_LIB_DEPS
  53. curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBCURL_LIBS@
  54. else
  55. curl_LDADD = $(top_builddir)/lib/libcurl.la @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
  56. endif
  57. # if unit tests are enabled, build a static library to link them with
  58. if BUILD_UNITTESTS
  59. noinst_LTLIBRARIES = libcurltool.la
  60. libcurltool_la_CPPFLAGS = $(AM_CPPFLAGS) \
  61. -DCURL_STATICLIB -DUNITTESTS
  62. libcurltool_la_CFLAGS =
  63. libcurltool_la_LDFLAGS = -static $(LINKFLAGS)
  64. libcurltool_la_SOURCES = $(curl_SOURCES)
  65. endif
  66. CLEANFILES = tool_hugehelp.c
  67. # Use the C locale to ensure that only ASCII characters appear in the
  68. # embedded text.
  69. NROFF=env LC_ALL=C @NROFF@ @MANOPT@ # figured out by the configure script
  70. EXTRA_DIST = mkhelp.pl makefile.dj \
  71. Makefile.m32 macos/curl.mcp.xml.sit.hqx macos/MACINSTALL.TXT \
  72. macos/src/curl_GUSIConfig.cpp macos/src/macos_main.cpp makefile.amiga \
  73. curl.rc Makefile.netware Makefile.inc CMakeLists.txt
  74. # Use absolute directory to disable VPATH
  75. MANPAGE=$(abs_top_builddir)/docs/curl.1
  76. MKHELP=$(top_srcdir)/src/mkhelp.pl
  77. HUGE=tool_hugehelp.c
  78. HUGECMD = $(HUGEIT_$(V))
  79. HUGEIT_0 = @echo " HUGE " $@;
  80. HUGEIT_1 =
  81. HUGEIT_ = $(HUGEIT_0)
  82. CHECKSRC = $(CS_$(V))
  83. CS_0 = @echo " RUN " $@;
  84. CS_1 =
  85. CS_ = $(CS_0)
  86. if USE_MANUAL
  87. # Here are the stuff to create a built-in manual
  88. $(MANPAGE):
  89. cd $(top_builddir)/docs && $(MAKE)
  90. if HAVE_LIBZ
  91. # This generates the tool_hugehelp.c file in both uncompressed and
  92. # compressed formats.
  93. $(HUGE): $(MANPAGE) $(MKHELP)
  94. $(HUGECMD) (echo '#include "tool_setup.h"' > $(HUGE); \
  95. echo '#ifndef HAVE_LIBZ' >> $(HUGE); \
  96. $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) >> $(HUGE); \
  97. echo '#else' >> $(HUGE); \
  98. $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) -c >> $(HUGE); \
  99. echo '#endif /* HAVE_LIBZ */' >> $(HUGE) )
  100. else # HAVE_LIBZ
  101. # This generates the tool_hugehelp.c file uncompressed only
  102. $(HUGE): $(MANPAGE) $(MKHELP)
  103. $(HUGECMD)(echo '#include "tool_setup.h"' > $(HUGE); \
  104. $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) >> $(HUGE) )
  105. endif
  106. else # USE_MANUAL
  107. # built-in manual has been disabled, make a blank file
  108. $(HUGE):
  109. $(HUGECMD)(echo "/* built-in manual is disabled, blank function */" > $(HUGE); \
  110. echo '#include "tool_hugehelp.h"' >> $(HUGE); \
  111. echo "void hugehelp(void) {}" >>$(HUGE) )
  112. endif
  113. # ignore tool_hugehelp.c since it is generated source code and it plays
  114. # by slightly different rules!
  115. checksrc:
  116. $(CHECKSRC)(@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(srcdir) \
  117. -W$(srcdir)/tool_hugehelp.c $(srcdir)/*.[ch])
  118. if CURLDEBUG
  119. # for debug builds, we scan the sources on all regular make invokes
  120. all-local: checksrc
  121. endif
  122. # disable the tests that are mostly causing false positives
  123. TIDYFLAGS=-checks=-clang-analyzer-security.insecureAPI.strcpy,-clang-analyzer-optin.performance.Padding,-clang-analyzer-valist.Uninitialized,-clang-analyzer-core.NonNullParamChecker,-clang-analyzer-core.NullDereference
  124. TIDY:=clang-tidy
  125. tidy:
  126. $(TIDY) $(CURL_CFILES) $(TIDYFLAGS) -- $(curl_CPPFLAGS) $(CPPFLAGS) -DHAVE_CONFIG_H