curl_CPPFLAGS = $(AM_CPPFLAGS) $(LIBMETALINK_CPPFLAGS)
curl_DEPENDENCIES = $(top_builddir)/lib/libcurl.la
+# if unit tests are enabled, build a static library to link them with
+if BUILD_UNITTESTS
+noinst_LTLIBRARIES = libcurltool.la
+libcurltool_la_CFLAGS = -DUNITTESTS
+libcurltool_la_LDFLAGS = -static $(LINKFLAGS)
+libcurltool_la_SOURCES = $(curl_SOURCES)
+endif
+
BUILT_SOURCES = tool_hugehelp.c
CLEANFILES = tool_hugehelp.c
# Use the C locale to ensure that only ASCII characters appear in the
int vms_show = 0;
#endif
+/* if we build a static library for unit tests, there is no main() function */
+#ifndef UNITTESTS
+
/*
* Ensure that file descriptors 0, 1 and 2 (stdin, stdout, stderr) are
* open before starting to run. Otherwise, the first three network
#endif
}
+#endif /* ndef UNITTESTS */
-I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
+ -I$(top_srcdir)/src \
-I$(top_srcdir)/tests/libtest \
-I$(top_builddir)/ares \
-I$(top_srcdir)/ares
-I$(top_srcdir)/include \
-I$(top_builddir)/lib \
-I$(top_srcdir)/lib \
+ -I$(top_srcdir)/src \
-I$(top_srcdir)/tests/libtest
endif
# Prevent LIBS from being used for all link targets
LIBS = $(BLANK_AT_MAKETIME)
-LDADD = $(top_builddir)/lib/libcurlu.la @LDFLAGS@ @LIBCURL_LIBS@
-DEPENDENCIES = $(top_builddir)/lib/libcurlu.la
+LDADD = $(top_builddir)/src/libcurltool.la \
+ $(top_builddir)/lib/libcurlu.la \
+ @LDFLAGS@ @LIBCURL_LIBS@
+
+DEPENDENCIES = $(top_builddir)/src/libcurltool.la \
+ $(top_builddir)/lib/libcurlu.la
+
AM_CPPFLAGS += -DCURL_STATICLIB -DUNITTESTS
# Makefile.inc provides neat definitions