starter: Don't directly refer to source files in Makefile for unit tests
authorTobias Brunner <tobias@strongswan.org>
Thu, 19 Jun 2014 09:58:15 +0000 (11:58 +0200)
committerTobias Brunner <tobias@strongswan.org>
Thu, 19 Jun 2014 12:00:49 +0000 (14:00 +0200)
Older versions of automake have trouble recursively cleaning such
constructs properly.

src/starter/Makefile.am
src/starter/tests/Makefile.am

index 1eb834e..04e126d 100644 (file)
@@ -3,11 +3,15 @@ SUBDIRS = . tests
 ipsec_PROGRAMS = starter
 starter_SOURCES = \
 starter.c files.h \
-parser/parser.y parser/lexer.l parser/conf_parser.c parser/conf_parser.h \
 args.c args.h confread.c confread.h keywords.c keywords.h cmp.c cmp.h \
 invokecharon.c invokecharon.h starterstroke.c starterstroke.h \
 netkey.c netkey.h klips.c klips.h
 
+# parser is also used by tests
+noinst_LTLIBRARIES = libstarter.la
+libstarter_la_SOURCES = \
+parser/parser.y parser/lexer.l parser/conf_parser.c parser/conf_parser.h
+
 AM_CPPFLAGS = \
        -I${linux_headers} \
        -I$(top_srcdir)/src/libstrongswan \
@@ -29,6 +33,7 @@ AM_YFLAGS = -v -d
 starter_LDADD = \
        $(top_builddir)/src/libstrongswan/libstrongswan.la \
        $(top_builddir)/src/libhydra/libhydra.la \
+       libstarter.la \
        $(SOCKLIB) $(PTHREADLIB)
 
 EXTRA_DIST = keywords.txt ipsec.conf Android.mk
index 5e188c4..f84327b 100644 (file)
@@ -4,9 +4,6 @@ check_PROGRAMS = $(TESTS)
 
 starter_tests_SOURCES = \
        suites/test_parser.c \
-       ../parser/conf_parser.c \
-       ../parser/lexer.l \
-       ../parser/parser.y \
        starter_tests.h starter_tests.c
 
 starter_tests_CFLAGS = \
@@ -18,4 +15,5 @@ starter_tests_CFLAGS = \
 starter_tests_LDFLAGS = @COVERAGE_LDFLAGS@
 starter_tests_LDADD = \
        $(top_builddir)/src/libstrongswan/libstrongswan.la \
-       $(top_builddir)/src/libstrongswan/tests/libtest.la
+       $(top_builddir)/src/libstrongswan/tests/libtest.la \
+       ../libstarter.la