1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
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.haxx.se/docs/copyright.html.
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.
18 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
19 # KIND, either express or implied.
21 ###########################################################################
22 AUTOMAKE_OPTIONS = foreign nostdinc
24 # remove targets if the command fails
27 # Specify our include paths here, and do it relative to $(top_srcdir) and
28 # $(top_builddir), to ensure that these paths which belong to the library
29 # being currently built and tested are searched before the library which
30 # might possibly already be installed in the system.
32 # $(top_srcdir)/include is for libcurl's external include files
33 # $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
34 # $(top_builddir)/src is for curl's generated src/curl_config.h file
35 # $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
36 # $(top_srcdir)/src is for curl's src/tool_setup.h and "curl-private" files
38 AM_CPPFLAGS = -I$(top_srcdir)/include \
39 -I$(top_builddir)/lib \
40 -I$(top_builddir)/src \
48 if USE_CPPFLAG_CURL_STATICLIB
49 AM_CPPFLAGS += -DCURL_STATICLIB
54 # CURL_FILES comes from Makefile.inc
55 curl_SOURCES = $(CURL_FILES)
57 # This might hold -Werror
58 # Enable Position Independent Executable flag
59 CFLAGS += @CURL_CFLAG_EXTRAS@ -fPIE
62 # Prevent LIBS from being used for all link targets
63 LIBS = $(BLANK_AT_MAKETIME)
65 if USE_EXPLICIT_LIB_DEPS
66 curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @LIBCURL_LIBS@
68 curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
71 curl_LDFLAGS = @LIBMETALINK_LDFLAGS@
72 curl_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMETALINK_CPPFLAGS)
75 curl_LDFLAGS += $(CODE_COVERAGE_LDFLAGS)
76 CFLAGS += $(CODE_COVERAGE_CFLAGS)
78 # if unit tests are enabled, build a static library to link them with
80 noinst_LTLIBRARIES = libcurltool.la
81 libcurltool_la_CPPFLAGS = $(LIBMETALINK_CPPFLAGS) $(AM_CPPFLAGS) \
82 -DCURL_STATICLIB -DUNITTESTS
83 libcurltool_la_CFLAGS =
84 libcurltool_la_LDFLAGS = -static $(LINKFLAGS)
85 libcurltool_la_SOURCES = $(curl_SOURCES)
88 CLEANFILES = tool_hugehelp.c
89 # Use the C locale to ensure that only ASCII characters appear in the
91 NROFF=env LC_ALL=C @NROFF@ @MANOPT@ # figured out by the configure script
93 EXTRA_DIST = mkhelp.pl makefile.dj Makefile.b32 \
94 Makefile.m32 macos/curl.mcp.xml.sit.hqx macos/MACINSTALL.TXT \
95 macos/src/curl_GUSIConfig.cpp macos/src/macos_main.cpp makefile.amiga \
96 curl.rc Makefile.netware Makefile.inc Makefile.Watcom CMakeLists.txt
98 # Use absolute directory to disable VPATH
99 MANPAGE=$(abs_top_builddir)/docs/curl.1
100 README=$(top_srcdir)/docs/MANUAL
101 MKHELP=$(top_srcdir)/src/mkhelp.pl
105 # Here are the stuff to create a built-in manual
108 cd $(top_builddir)/docs && $(MAKE)
111 # This generates the tool_hugehelp.c file in both uncompressed and
112 # compressed formats.
113 $(HUGE): $(MANPAGE) $(README) $(MKHELP)
114 echo '#include "tool_setup.h"' > $(HUGE)
115 echo '#ifndef HAVE_LIBZ' >> $(HUGE)
116 $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) $(README) >> $(HUGE)
117 echo '#else' >> $(HUGE)
118 $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) -c $(README) >> $(HUGE)
119 echo '#endif /* HAVE_LIBZ */' >> $(HUGE)
121 # This generates the tool_hugehelp.c file uncompressed only
122 $(HUGE): $(MANPAGE) $(README) $(MKHELP)
123 echo '#include "tool_setup.h"' > $(HUGE)
124 $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) $(README) >> $(HUGE)
128 # built-in manual has been disabled, make a blank file
130 echo "/* built-in manual is disabled, blank function */" > $(HUGE)
131 echo '#include "tool_hugehelp.h"' >> $(HUGE)
132 echo "void hugehelp(void) {}" >>$(HUGE)
135 # ignore tool_hugehelp.c since it is generated source code and it plays
136 # by slightly different rules!
138 @PERL@ $(top_srcdir)/lib/checksrc.pl -D$(srcdir) \
139 -W$(srcdir)/tool_hugehelp.c $(srcdir)/*.[ch]
142 # for debug builds, we scan the sources on all regular make invokes