a55891a2982b32b3e873858cdd711e33073e5ce6
[strongswan.git] / src / checksum / Makefile.am
1 # this lib is not built until make install is called (see rules at the bottom)
2 EXTRA_LTLIBRARIES = libchecksum.la
3 ipseclib_LTLIBRARIES = $(LIBCHECKSUM_LIBS)
4 nodist_libchecksum_la_SOURCES = checksum.c
5 libchecksum_la_LDFLAGS = -module -avoid-version -rpath '$(ipseclibdir)'
6
7 noinst_PROGRAMS = checksum_builder
8 checksum_builder_SOURCES = checksum_builder.c
9 checksum_builder_LDADD = \
10         $(top_builddir)/src/libstrongswan/libstrongswan.la \
11         $(top_builddir)/src/libhydra/libhydra.la \
12         $(top_builddir)/src/libcharon/libcharon.la \
13         $(DLLIB)
14
15 CLEANFILES = checksum.c
16 INCLUDES = \
17         -I$(top_srcdir)/src/libstrongswan \
18         -I$(top_srcdir)/src/libhydra \
19         -I$(top_srcdir)/src/libcharon
20 AM_CFLAGS = \
21         -DPLUGINDIR=\"${plugindir}\" \
22         -rdynamic
23
24 # we keep track of build dependencies in deps and use libs to store the paths
25 # to the installed libraries. for executables we use the built files directly
26 # as these are not relinked during installation.
27 deps = $(top_builddir)/src/libstrongswan/libstrongswan.la
28 libs = $(DESTDIR)$(ipseclibdir)/libstrongswan.so
29 exes =
30
31 if !MONOLITHIC
32   AM_CFLAGS += -DS_PLUGINS=\""${s_plugins}\""
33 endif
34
35 if USE_LIBHYDRA
36   deps += $(top_builddir)/src/libhydra/libhydra.la
37   libs += $(DESTDIR)$(ipseclibdir)/libhydra.so
38 if !MONOLITHIC
39   AM_CFLAGS += -DH_PLUGINS=\""${h_plugins}\""
40 endif
41 endif
42
43 if USE_TLS
44   deps += $(top_builddir)/src/libtls/libtls.la
45   libs += $(DESTDIR)$(ipseclibdir)/libtls.so
46 endif
47
48 if USE_LIBTNCCS
49   deps += $(top_builddir)/src/libtnccs/libtnccs.la
50   libs += $(DESTDIR)$(ipseclibdir)/libtnccs.so
51 endif
52
53 if USE_SIMAKA
54   deps += $(top_builddir)/src/libsimaka/libsimaka.la
55   libs += $(DESTDIR)$(ipseclibdir)/libsimaka.so
56 endif
57
58 if USE_IMCV
59   deps += $(top_builddir)/src/libimcv/libimcv.la
60   libs += $(DESTDIR)$(ipseclibdir)/libimcv.so
61 endif
62
63 if USE_PTS
64   deps += $(top_builddir)/src/libpts/libpts.la
65   libs += $(DESTDIR)$(ipseclibdir)/libpts.so
66 endif
67
68 if USE_CHARON
69   deps += $(top_builddir)/src/libcharon/libcharon.la
70   libs += $(DESTDIR)$(ipseclibdir)/libcharon.so
71   exes += $(top_builddir)/src/charon/.libs/charon
72 if !MONOLITHIC
73   AM_CFLAGS += -DC_PLUGINS=\""${c_plugins}\""
74 endif
75 endif
76
77 if USE_PLUTO
78   exes += $(top_builddir)/src/pluto/.libs/pluto
79   AM_CFLAGS += -DP_PLUGINS=\""${p_plugins}\""
80 endif
81
82 if USE_TOOLS
83   exes += $(top_builddir)/src/openac/.libs/openac
84   exes += $(top_builddir)/src/pki/.libs/pki
85   exes += $(top_builddir)/src/scepclient/.libs/scepclient
86 endif
87
88 if USE_ATTR_SQL
89   exes += $(top_builddir)/src/libhydra/plugins/attr_sql/.libs/pool
90 endif
91
92 if USE_IMV_ATTESTATION
93   exes += $(top_builddir)/src/libpts/plugins/imv_attestation/.libs/attest
94 endif
95
96 checksum.c : checksum_builder $(deps) $(exes)
97                 ./checksum_builder $(libs) $(exes) > checksum.c
98
99 install-data-hook : $(EXTRA_LTLIBRARIES)
100         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' install-ipseclibLTLIBRARIES
101
102 uninstall-hook :
103         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' uninstall-ipseclibLTLIBRARIES
104
105 clean-local :
106         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' clean-ipseclibLTLIBRARIES