Include "setup.h" and not "config.h" since setup.h is made to include
[platform/upstream/curl.git] / src / Makefile.am
1 #***************************************************************************
2 #                                  _   _ ____  _
3 #  Project                     ___| | | |  _ \| |
4 #                             / __| | | | |_) | |
5 #                            | (__| |_| |  _ <| |___
6 #                             \___|\___/|_| \_\_____|
7 #
8 # Copyright (C) 1998 - 2004, 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 # $Id$
22 ###########################################################################
23 AUTOMAKE_OPTIONS = foreign nostdinc
24
25 # we use srcdir/src for "private" includes
26 # we use srcdir/include for the static global include files
27 # we use builddir/src for the generated include files to get found
28 # we use srcdir/lib for the header files we "borrow" from the lib
29 INCLUDES = -I$(top_srcdir)/src -I$(top_srcdir)/include -I$(top_builddir)/src \
30         -I$(top_srcdir)/lib
31
32 bin_PROGRAMS = curl
33
34 # libcurl has sources that provide functions named curlx_* that aren't part of
35 # the official API, but we re-use the code here to avoid duplication.
36 curlx_ones =  $(top_srcdir)/lib/strtoofft.c $(top_srcdir)/lib/timeval.c
37
38 curl_SOURCES = main.c hugehelp.c hugehelp.h urlglob.c writeout.c setup.h   \
39         config-win32.h config-mac.h config-vms.h config-riscos.h urlglob.h \
40         version.h writeout.h writeenv.c writeenv.h getpass.c getpass.h     \
41         homedir.c homedir.h $(curlx_ones)
42
43 curl_LDADD = ../lib/libcurl.la
44 curl_DEPENDENCIES = ../lib/libcurl.la
45 BUILT_SOURCES = hugehelp.c
46 CLEANFILES = hugehelp.c
47 NROFF=@NROFF@ @MANOPT@ # figured out by the configure script
48
49 EXTRA_DIST = mkhelp.pl makefile.dj Makefile.vc6 Makefile.b32 Makefile.m32 \
50         Makefile.riscos config.h.in macos/curl.mcp.xml.sit.hqx            \
51         macos/MACINSTALL.TXT macos/src/curl_GUSIConfig.cpp                \
52         macos/src/macos_main.cpp config-amigaos.h makefile.amiga curl.rc  \
53         Makefile.netware config-netware.h
54
55 MANPAGE=$(top_srcdir)/docs/curl.1
56 README=$(top_srcdir)/docs/MANUAL
57 MKHELP=$(top_srcdir)/src/mkhelp.pl
58 HUGE=hugehelp.c
59
60 if USE_MANUAL
61 # Here are the stuff to create a built-in manual
62
63 if HAVE_LIBZ
64 # This generates the hugehelp.c file in both uncompressed and compressed formats
65 $(HUGE): $(README) $(MANPAGE)  mkhelp.pl
66         echo '#include "setup.h"' > $(HUGE)
67         echo '#ifndef HAVE_LIBZ' >> $(HUGE)
68         $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) $(README) >> $(HUGE)
69         echo '#else' >> $(HUGE)
70         $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) -c $(README) >> $(HUGE)
71         echo '#endif /* HAVE_LIBZ */' >> $(HUGE)
72 else # HAVE_LIBZ
73 # This generates the hugehelp.c file uncompressed only
74 $(HUGE): $(README) $(MANPAGE)  mkhelp.pl
75         echo '#include "setup.h"' > $(HUGE)
76         $(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) $(README) >> $(HUGE)
77 endif
78
79 else # USE_MANUAL
80 # built-in manual has been disabled, make a blank file
81 $(HUGE):
82         echo "/* built-in manual is disabled, blank function */" > $(HUGE)
83         echo '#include "hugehelp.h"' >> $(HUGE)
84         echo "void hugehelp(void) {}" >>$(HUGE)
85 endif