Commit 75b7234d authored by Niels Möller's avatar Niels Möller

Dependency tracking also for C++ files.

parent 17c2ee26
2012-09-20 Niels Möller <nisse@lysator.liu.se>
* configure.ac: New substitution IF_CXX, replacing CXX_TESTS.
(dummy-dep-files): Handle .cxx files.
* testsuite/Makefile.in: Use IF_CXX. Include dependency file for
cxx-test.o.
2012-09-19 Niels Möller <nisse@lysator.liu.se>
From Tim Rühsen:
......
......@@ -91,8 +91,8 @@ fi
AC_PROG_CXX
AC_LANG_PUSH(C++)
AC_TRY_COMPILE([],[return 0;],[CXX_TESTS='cxx-test$(EXEEXT)'], [CXX_TESTS=''])
AC_SUBST([CXX_TESTS])
AC_TRY_COMPILE([],[return 0;],[IF_CXX=''], [IF_CXX='#'])
AC_SUBST([IF_CXX])
AC_LANG_POP
AC_PROG_MAKE_SET
......@@ -121,8 +121,8 @@ if test x$enable_dependency_tracking = xyes ; then
# actually needed.
AC_CONFIG_COMMANDS([dummy-dep-files],
[(cd "$srcdir" && find . -name '*.c' -print) \
| sed 's/\.c$//' | (while read f; do echo > "$f.o.d"; echo > "$f.po.d"; done)
[(cd "$srcdir" && find . '(' -name '*.c' -o -name '*.cxx' ')' -print) \
| sed 's/\.c\(xx\|\)$//' | (while read f; do echo > "$f.o.d"; echo > "$f.po.d"; done)
])
fi
......
......@@ -35,22 +35,26 @@ TS_HOGWEED_SOURCES = sexp-test.c sexp-format-test.c \
dsa-test.c dsa-keygen-test.c
TS_SOURCES = $(TS_NETTLE_SOURCES) @IF_HOGWEED@ $(TS_HOGWEED_SOURCES)
CXX_SOURCES = @IF_CXX@ cxx-test.cxx
TS_NETTLE = $(TS_NETTLE_SOURCES:.c=$(EXEEXT))
TS_HOGWEED = $(TS_HOGWEED_SOURCES:.c=$(EXEEXT))
TS_C = $(TS_NETTLE) @IF_HOGWEED@ $(TS_HOGWEED)
TS_CXX = @CXX_TESTS@
TS_CXX = $(CXX_SOURCES:.cxx=$(EXEEXT))
TARGETS = $(TS_C) $(TS_CXX)
TS_SH = sexp-conv-test pkcs1-conv-test symbols-test
TS_ALL = $(TARGETS) $(TS_SH)
EXTRA_SOURCES = sha1-huge-test.c
EXTRA_TARGETS = $(EXTRA_SOURCES:.c=$(EXEEXT))
SOURCES = $(TS_SOURCES) testutils.c
# C source files to be built
SOURCES = $(TS_SOURCES) $(EXTRA_SOURCES) testutils.c
DISTFILES = $(SOURCES) $(EXTRA_SOURCES) cxx-test.cxx Makefile.in .test-rules.make \
$(TS_SH) setup-env teardown-env \
gold-bug.txt testutils.h
# Includes all C source files, regardless of configuration
DISTFILES = $(TS_NETTLE_SOURCES) $(TS_HOGWEED_SOURCES) \
$(EXTRA_SOURCES) cxx-test.cxx Makefile.in .test-rules.make \
$(TS_SH) setup-env teardown-env \
gold-bug.txt testutils.h
all: $(TARGETS) $(EXTRA_TARGETS)
......@@ -116,4 +120,5 @@ distclean: clean
tags:
etags -o $(srcdir)/TAGS --include $(top_srcdir) $(srcdir)/*.c $(srcdir)/*.h
@DEP_INCLUDE@ $(SOURCES:.c=.$(OBJEXT).d)
DEP_FILES = $(SOURCES:.c=.$(OBJEXT).d) $(CXX_SOURCES:.cxx=.$(OBJEXT).d)
@DEP_INCLUDE@ $(DEP_FILES)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment