starter: Use automake LEX/YACC automatisms.
[strongswan.git] / src / starter / Makefile.am
1 ipsec_PROGRAMS = starter
2 starter_SOURCES = \
3 netkey.c parser.y lexer.l ipsec-parser.h args.h netkey.h \
4 starterwhack.c starterwhack.h starterstroke.c invokepluto.c confread.c \
5 starterstroke.h interfaces.c invokepluto.h confread.h interfaces.h args.c \
6 keywords.c files.h keywords.h cmp.c starter.c cmp.h exec.c invokecharon.c \
7 exec.h invokecharon.h loglite.c klips.c klips.h
8
9 INCLUDES = \
10 -I${linux_headers} \
11 -I$(top_srcdir)/src/libstrongswan \
12 -I$(top_srcdir)/src/libfreeswan \
13 -I$(top_srcdir)/src/libhydra \
14 -I$(top_srcdir)/src/pluto \
15 -I$(top_srcdir)/src/whack \
16 -I$(top_srcdir)/src/stroke
17
18 AM_CFLAGS = \
19 -DIPSEC_DIR=\"${ipsecdir}\" \
20 -DIPSEC_CONFDIR=\"${sysconfdir}\" \
21 -DIPSEC_PIDDIR=\"${piddir}\" \
22 -DIPSEC_EAPDIR=\"${eapdir}\" \
23 -DDEV_RANDOM=\"${random_device}\" \
24 -DDEV_URANDOM=\"${urandom_device}\" \
25 -DDEBUG
26
27 AM_YFLAGS = -v -d
28
29 starter_LDADD = defs.o $(top_builddir)/src/libfreeswan/libfreeswan.a $(top_builddir)/src/libstrongswan/libstrongswan.la $(SOCKLIB)
30 EXTRA_DIST = keywords.txt ipsec.conf
31 MAINTAINERCLEANFILES = keywords.c
32 BUILT_SOURCES = parser.h
33
34 PLUTODIR=$(top_srcdir)/src/pluto
35 SCEPCLIENTDIR=$(top_srcdir)/src/scepclient
36
37 if USE_PLUTO
38   AM_CFLAGS += -DSTART_PLUTO
39 endif
40
41 if USE_CHARON
42   AM_CFLAGS += -DSTART_CHARON
43 endif
44
45 if USE_LOAD_WARNING
46   AM_CFLAGS += -DLOAD_WARNING
47 endif
48
49 keywords.c:     $(srcdir)/keywords.txt $(srcdir)/keywords.h
50                 $(GPERF) -m 10 -C -G -D -t < $(srcdir)/keywords.txt > $@
51
52 defs.o:         $(PLUTODIR)/defs.c $(PLUTODIR)/defs.h
53                 $(COMPILE) -c -o $@ $(PLUTODIR)/defs.c
54
55 install-exec-local :
56                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d" || $(INSTALL) -o -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
66