automake: replace INCLUDES by AM_CPPFLAGS
[strongswan.git] / src / charon-tkm / Makefile.am
1 SRC = $(top_builddir)/src
2
3 # includes relative to obj directory
4 AM_CPPFLAGS = \
5         -include $(top_builddir)/config.h \
6         -I../$(SRC)/libstrongswan \
7         -I../$(SRC)/libhydra \
8         -I../$(SRC)/libcharon
9
10 LIBLD = \
11         -L$(SRC)/libstrongswan/.libs \
12         -L$(SRC)/libhydra/.libs \
13         -L$(SRC)/libcharon/.libs
14 LIBPT = $(SRC)/libstrongswan/.libs:$(SRC)/libhydra/.libs:$(SRC)/libcharon/.libs
15 LIBFL = -lstrongswan -lhydra -lcharon
16
17 DEFS += -DPLUGINS=\""$(PLUGINS)\"" -DIPSEC_PIDDIR=\"${piddir}\"
18
19 BUILD_OPTS = \
20         -XOBJ_DIR=$(CURDIR)/obj \
21         -cargs $(INCLUDES) $(DEFS) \
22         -largs $(LIBLD) $(LIBFL)
23
24 # plugins to enable
25 PLUGINS = \
26         kernel-netlink \
27         pem \
28         socket-default \
29         openssl \
30         stroke
31
32 all: build_charon
33
34 build_charon: build_charon.gpr src/charon-tkm.c
35         @$(GPRBUILD) -p $< $(BUILD_OPTS)
36
37 build_tests: build_tests.gpr
38         @$(GPRBUILD) -p $< $(BUILD_OPTS) -cargs @CHECK_CFLAGS@ -largs @CHECK_LIBS@
39
40 if UNITTESTS
41 check: build_tests
42         @LD_LIBRARY_PATH=$(LIBPT) obj/test_runner
43 else
44 check:
45         @echo "reconfigure with --enable-unit-tests"
46 endif
47
48 install: build_charon
49         $(INSTALL) -m 755 obj/charon-tkm $(DESTDIR)$(ipsecdir)
50
51 clean:
52         rm -rf obj
53
54 EXTRA_DIST = build_charon.gpr build_common.gpr build_tests.gpr src tests