Rebuild library.lo after changing ./configure options
[strongswan.git] / src / starter / Makefile.am
1 ipsec_PROGRAMS = starter
2 starter_SOURCES = y.tab.c netkey.c y.tab.h parser.h args.h netkey.h \
3 starterwhack.c starterwhack.h starterstroke.c invokepluto.c confread.c \
4 starterstroke.h interfaces.c invokepluto.h confread.h interfaces.h args.c \
5 keywords.c files.h keywords.h cmp.c starter.c cmp.h exec.c invokecharon.c \
6 exec.h invokecharon.h lex.yy.c loglite.c klips.c klips.h
7
8 INCLUDES = \
9 -I${linux_headers} \
10 -I$(top_srcdir)/src/libstrongswan \
11 -I$(top_srcdir)/src/libfreeswan \
12 -I$(top_srcdir)/src/pluto \
13 -I$(top_srcdir)/src/whack \
14 -I$(top_srcdir)/src/stroke
15
16 AM_CFLAGS = \
17 -DIPSEC_DIR=\"${ipsecdir}\" \
18 -DIPSEC_CONFDIR=\"${sysconfdir}\" \
19 -DIPSEC_PIDDIR=\"${piddir}\" \
20 -DIPSEC_EAPDIR=\"${eapdir}\" \
21 -DDEV_RANDOM=\"${random_device}\" \
22 -DDEV_URANDOM=\"${urandom_device}\" \
23 -DDEBUG
24
25 starter_LDADD = defs.o $(top_builddir)/src/libfreeswan/libfreeswan.a $(top_builddir)/src/libstrongswan/libstrongswan.la $(SOCKLIB)
26 EXTRA_DIST = parser.l parser.y keywords.txt ipsec.conf ipsec.conf.5.in
27 dist_man_MANS = ipsec.conf.5 starter.8
28 CLEANFILES = ipsec.conf.5
29 MAINTAINERCLEANFILES = lex.yy.c y.tab.c y.tab.h keywords.c
30
31 PLUTODIR=$(top_srcdir)/src/pluto
32 SCEPCLIENTDIR=$(top_srcdir)/src/scepclient
33
34 if USE_PLUTO
35   AM_CFLAGS += -DSTART_PLUTO
36 endif
37
38 if USE_CHARON
39   AM_CFLAGS += -DSTART_CHARON
40 endif
41
42 if USE_LOAD_WARNING
43   AM_CFLAGS += -DLOAD_WARNING
44 endif
45
46 ipsec.conf.5:   ipsec.conf.5.in
47                 sed \
48                 -e "s:@IPSEC_VERSION@:$(PACKAGE_VERSION):" \
49                 $(srcdir)/$@.in > $@
50
51 lex.yy.c:       $(srcdir)/parser.l $(srcdir)/parser.y $(srcdir)/parser.h y.tab.h
52                 $(LEX) $(srcdir)/parser.l
53
54 y.tab.c:        $(srcdir)/parser.y $(srcdir)/parser.l $(srcdir)/parser.h
55                 $(YACC) -v -d $(srcdir)/parser.y
56
57 y.tab.h:        $(srcdir)/parser.y $(srcdir)/parser.l $(srcdir)/parser.h
58                 $(YACC) -v -d $(srcdir)/parser.y
59
60 keywords.c:     $(srcdir)/keywords.txt $(srcdir)/keywords.h
61                 $(GPERF) -m 10 -C -G -D -t < $(srcdir)/keywords.txt > $@
62
63 defs.o:         $(PLUTODIR)/defs.c $(PLUTODIR)/defs.h
64                 $(COMPILE) -c -o $@ $(PLUTODIR)/defs.c
65
66 install-exec-local :
67                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d "$(DESTDIR)$(sysconfdir)/ipsec.d" || true
68                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/cacerts" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d "$(DESTDIR)$(sysconfdir)/ipsec.d/cacerts" || true
69                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/ocspcerts" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d "$(DESTDIR)$(sysconfdir)/ipsec.d/ocspcerts" || true
70                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/certs" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d "$(DESTDIR)$(sysconfdir)/ipsec.d/certs" || true
71                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/acerts" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d "$(DESTDIR)$(sysconfdir)/ipsec.d/acerts" || true
72                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/aacerts" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d "$(DESTDIR)$(sysconfdir)/ipsec.d/aacerts" || true
73                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/crls" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d "$(DESTDIR)$(sysconfdir)/ipsec.d/crls" || true
74                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/reqs" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d "$(DESTDIR)$(sysconfdir)/ipsec.d/reqs" || true
75                 test -e "$(DESTDIR)${sysconfdir}/ipsec.d/private" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -d -m 750 "$(DESTDIR)$(sysconfdir)/ipsec.d/private" || true
76                 test -e "$(DESTDIR)$(sysconfdir)/ipsec.conf" || $(INSTALL) -o ${ipsecuid} -g ${ipsecgid} -m 644 $(srcdir)/ipsec.conf $(DESTDIR)$(sysconfdir)/ipsec.conf || true
77