starter: Add tests for ipsec.conf parser
[strongswan.git] / src / starter / Makefile.am
1 SUBDIRS = . tests
2
3 ipsec_PROGRAMS = starter
4 starter_SOURCES = \
5 starter.c files.h \
6 parser/parser.y parser/lexer.l parser/conf_parser.c parser/conf_parser.h \
7 parser.y lexer.l ipsec-parser.h args.c args.h \
8 confread.c confread.h keywords.c keywords.h cmp.c cmp.h \
9 invokecharon.c invokecharon.h starterstroke.c starterstroke.h \
10 netkey.c netkey.h klips.c klips.h
11
12 AM_CPPFLAGS = \
13         -I${linux_headers} \
14         -I$(top_srcdir)/src/libstrongswan \
15         -I$(top_srcdir)/src/libhydra \
16         -I$(top_srcdir)/src/starter \
17         -I$(top_srcdir)/src/stroke \
18         -DIPSEC_DIR=\"${ipsecdir}\" \
19         -DIPSEC_CONFDIR=\"${sysconfdir}\" \
20         -DIPSEC_PIDDIR=\"${piddir}\" \
21         -DIPSEC_EAPDIR=\"${eapdir}\" \
22         -DIPSEC_SCRIPT=\"${ipsec_script}\" \
23         -DDEV_RANDOM=\"${random_device}\" \
24         -DDEV_URANDOM=\"${urandom_device}\" \
25         -DPLUGINS=\""${starter_plugins}\"" \
26         -DDEBUG
27
28 AM_YFLAGS = -v -d
29
30 starter_LDADD = \
31         $(top_builddir)/src/libstrongswan/libstrongswan.la \
32         $(top_builddir)/src/libhydra/libhydra.la \
33         $(SOCKLIB) $(PTHREADLIB)
34
35 EXTRA_DIST = keywords.txt ipsec.conf Android.mk
36 MAINTAINERCLEANFILES = keywords.c
37 BUILT_SOURCES = keywords.c parser.h parser/parser.h
38
39 if USE_CHARON
40   AM_CPPFLAGS += -DSTART_CHARON
41 endif
42
43 if USE_LOAD_WARNING
44   AM_CPPFLAGS += -DLOAD_WARNING
45 endif
46
47 if USE_TOOLS
48   AM_CPPFLAGS += -DGENERATE_SELFCERT
49 endif
50
51 keywords.c:     $(srcdir)/keywords.txt $(srcdir)/keywords.h
52                 $(AM_V_GEN) \
53                 $(GPERF) -m 10 -C -G -D -t < $(srcdir)/keywords.txt > $@
54
55 install-exec-local :
56                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d" || true
57                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/cacerts" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d/cacerts" || true
58                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/ocspcerts" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d/ocspcerts" || true
59                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/certs" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d/certs" || true
60                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/acerts" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d/acerts" || true
61                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/aacerts" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d/aacerts" || true
62                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/crls" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d/crls" || true
63                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/reqs" || $(INSTALL) -d "$(DESTDIR)$(sysconfdir)/ipsec.d/reqs" || true
64                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/private" || $(INSTALL) -d -m 750 "$(DESTDIR)$(sysconfdir)/ipsec.d/private" || true
65                 test -e "$(DESTDIR)$(sysconfdir)/ipsec.conf" || $(INSTALL) -m 644 $(srcdir)/ipsec.conf $(DESTDIR)$(sysconfdir)/ipsec.conf || true