1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-11 03:55:03 -05:00
curl/src/Makefile.am

143 lines
4.9 KiB
Makefile
Raw Normal View History

2004-01-13 03:57:01 -05:00
#***************************************************************************
# _ _ ____ _
# Project ___| | | | _ \| |
# / __| | | | |_) | |
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
1999-12-29 09:20:26 -05:00
#
# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
1999-12-29 09:20:26 -05:00
#
2004-01-13 03:57:01 -05:00
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
# are also available at https://curl.haxx.se/docs/copyright.html.
#
# You may opt to use, copy, modify, merge, publish, distribute and/or sell
# copies of the Software, and permit persons to whom the Software is
2004-01-13 03:57:01 -05:00
# furnished to do so, under the terms of the COPYING file.
#
# This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
# KIND, either express or implied.
#
2004-01-13 03:57:01 -05:00
###########################################################################
2002-02-25 09:08:18 -05:00
AUTOMAKE_OPTIONS = foreign nostdinc
1999-12-29 09:20:26 -05:00
# remove targets if the command fails
.DELETE_ON_ERROR:
2008-07-15 01:46:49 -04:00
# Specify our include paths here, and do it relative to $(top_srcdir) and
# $(top_builddir), to ensure that these paths which belong to the library
# being currently built and tested are searched before the library which
# might possibly already be installed in the system.
#
# $(top_srcdir)/include is for libcurl's external include files
# $(top_builddir)/lib is for libcurl's generated lib/curl_config.h file
# $(top_builddir)/src is for curl's generated src/curl_config.h file
build: fix circular header inclusion with other packages This commit renames lib/setup.h to lib/curl_setup.h and renames lib/setup_once.h to lib/curl_setup_once.h. Removes the need and usage of a header inclusion guard foreign to libcurl. [1] Removes the need and presence of an alarming notice we carried in old setup_once.h [2] ---------------------------------------- 1 - lib/setup_once.h used __SETUP_ONCE_H macro as header inclusion guard up to commit ec691ca3 which changed this to HEADER_CURL_SETUP_ONCE_H, this single inclusion guard is enough to ensure that inclusion of lib/setup_once.h done from lib/setup.h is only done once. Additionally lib/setup.h has always used __SETUP_ONCE_H macro to protect inclusion of setup_once.h even after commit ec691ca3, this was to avoid a circular header inclusion triggered when building a c-ares enabled version with c-ares sources available which also has a setup_once.h header. Commit ec691ca3 exposes the real nature of __SETUP_ONCE_H usage in lib/setup.h, it is a header inclusion guard foreign to libcurl belonging to c-ares's setup_once.h The renaming this commit does, fixes the circular header inclusion, and as such removes the need and usage of a header inclusion guard foreign to libcurl. Macro __SETUP_ONCE_H no longer used in libcurl. 2 - Due to the circular interdependency of old lib/setup_once.h and the c-ares setup_once.h header, old file lib/setup_once.h has carried back from 2006 up to now days an alarming and prominent notice about the need of keeping libcurl's and c-ares's setup_once.h in sync. Given that this commit fixes the circular interdependency, the need and presence of mentioned notice is removed. All mentioned interdependencies come back from now old days when the c-ares project lived inside a curl subdirectory. This commit removes last traces of such fact.
2013-01-06 13:06:49 -05:00
# $(top_srcdir)/lib for libcurl's lib/curl_setup.h and other "borrowed" files
# $(top_srcdir)/src is for curl's src/tool_setup.h and "curl-private" files
AM_CPPFLAGS = -I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_builddir)/src \
-I$(top_srcdir)/lib \
-I$(top_srcdir)/src
1999-12-29 09:20:26 -05:00
bin_PROGRAMS = curl
SUBDIRS = ../docs
if USE_CPPFLAG_CURL_STATICLIB
AM_CPPFLAGS += -DCURL_STATICLIB
endif
include Makefile.inc
1999-12-29 09:20:26 -05:00
# CURL_FILES comes from Makefile.inc
curl_SOURCES = $(CURL_FILES)
# This might hold -Werror
CFLAGS += @CURL_CFLAG_EXTRAS@
# Prevent LIBS from being used for all link targets
LIBS = $(BLANK_AT_MAKETIME)
if USE_EXPLICIT_LIB_DEPS
curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @LIBCURL_LIBS@
else
curl_LDADD = $(top_builddir)/lib/libcurl.la @LIBMETALINK_LIBS@ @NSS_LIBS@ @SSL_LIBS@ @ZLIB_LIBS@ @CURL_NETWORK_AND_TIME_LIBS@
endif
curl_LDFLAGS = @LIBMETALINK_LDFLAGS@
curl_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMETALINK_CPPFLAGS)
@CODE_COVERAGE_RULES@
curl_LDFLAGS += $(CODE_COVERAGE_LDFLAGS)
CFLAGS += $(CODE_COVERAGE_CFLAGS)
# if unit tests are enabled, build a static library to link them with
if BUILD_UNITTESTS
noinst_LTLIBRARIES = libcurltool.la
libcurltool_la_CPPFLAGS = $(LIBMETALINK_CPPFLAGS) $(AM_CPPFLAGS) \
-DCURL_STATICLIB -DUNITTESTS
libcurltool_la_CFLAGS =
libcurltool_la_LDFLAGS = -static $(LINKFLAGS)
libcurltool_la_SOURCES = $(curl_SOURCES)
endif
CLEANFILES = tool_hugehelp.c
# Use the C locale to ensure that only ASCII characters appear in the
# embedded text.
NROFF=env LC_ALL=C @NROFF@ @MANOPT@ # figured out by the configure script
1999-12-29 09:20:26 -05:00
EXTRA_DIST = mkhelp.pl makefile.dj Makefile.b32 \
Makefile.m32 macos/curl.mcp.xml.sit.hqx macos/MACINSTALL.TXT \
macos/src/curl_GUSIConfig.cpp macos/src/macos_main.cpp makefile.amiga \
2016-04-19 02:43:13 -04:00
curl.rc Makefile.netware Makefile.inc Makefile.Watcom CMakeLists.txt
1999-12-29 09:20:26 -05:00
# Use absolute directory to disable VPATH
MANPAGE=$(abs_top_builddir)/docs/curl.1
2000-11-30 03:08:49 -05:00
README=$(top_srcdir)/docs/MANUAL
2000-05-24 18:53:37 -04:00
MKHELP=$(top_srcdir)/src/mkhelp.pl
HUGE=tool_hugehelp.c
2000-05-24 18:53:37 -04:00
2004-02-12 09:46:12 -05:00
if USE_MANUAL
# Here are the stuff to create a built-in manual
$(MANPAGE):
cd $(top_builddir)/docs && $(MAKE)
if HAVE_LIBZ
# This generates the tool_hugehelp.c file in both uncompressed and
# compressed formats.
$(HUGE): $(MANPAGE) $(README) $(MKHELP)
echo '#include "tool_setup.h"' > $(HUGE)
echo '#ifndef HAVE_LIBZ' >> $(HUGE)
$(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) $(README) >> $(HUGE)
echo '#else' >> $(HUGE)
$(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) -c $(README) >> $(HUGE)
echo '#endif /* HAVE_LIBZ */' >> $(HUGE)
2004-02-12 09:46:12 -05:00
else # HAVE_LIBZ
# This generates the tool_hugehelp.c file uncompressed only
$(HUGE): $(MANPAGE) $(README) $(MKHELP)
echo '#include "tool_setup.h"' > $(HUGE)
$(NROFF) $(MANPAGE) | $(PERL) $(MKHELP) $(README) >> $(HUGE)
endif
2004-02-12 09:46:12 -05:00
else # USE_MANUAL
# built-in manual has been disabled, make a blank file
$(HUGE):
echo "/* built-in manual is disabled, blank function */" > $(HUGE)
echo '#include "tool_hugehelp.h"' >> $(HUGE)
echo "void hugehelp(void) {}" >>$(HUGE)
2004-02-12 09:46:12 -05:00
endif
# ignore tool_hugehelp.c since it is generated source code and it plays
# by slightly different rules!
checksrc:
@PERL@ $(top_srcdir)/lib/checksrc.pl -D$(srcdir) \
-W$(srcdir)/tool_hugehelp.c $(srcdir)/*.[ch]
if CURLDEBUG
# for debug builds, we scan the sources on all regular make invokes
all-local: checksrc
endif