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