9cc5fb6b21dc39e51760b9667635f7ea0313579f
[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 EXTRA_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/libcharon/libcharon.la \
12         $(DLLIB)
13 checksum_builder_LDFLAGS = -rpath '$(DESTDIR)$(ipseclibdir)'
14
15 CLEANFILES = checksum.c $(EXTRA_PROGRAMS)
16
17 AM_CPPFLAGS = \
18         -I$(top_srcdir)/src/libstrongswan \
19         -I$(top_srcdir)/src/libcharon \
20         -DPLUGINDIR=\"${DESTDIR}${plugindir}\"
21
22 AM_CFLAGS = \
23         $(PLUGIN_CFLAGS)
24
25 # we keep track of build dependencies in deps and use libs to store the paths
26 # to the installed libraries. for executables we use the built files directly
27 # as these are not relinked during installation.
28 deps = $(top_builddir)/src/libstrongswan/libstrongswan.la
29 libs = $(DESTDIR)$(ipseclibdir)/libstrongswan.so
30 exes =
31
32 if !MONOLITHIC
33   AM_CPPFLAGS += -DS_PLUGINS=\""${s_plugins}\""
34 endif
35
36 if USE_LIBIPSEC
37   deps += $(top_builddir)/src/libipsec/libipsec.la
38   libs += $(DESTDIR)$(ipseclibdir)/libipsec.so
39 endif
40
41 if USE_TLS
42   deps += $(top_builddir)/src/libtls/libtls.la
43   libs += $(DESTDIR)$(ipseclibdir)/libtls.so
44 endif
45
46 if USE_RADIUS
47   deps += $(top_builddir)/src/libradius/libradius.la
48   libs += $(DESTDIR)$(ipseclibdir)/libradius.so
49 endif
50
51 if USE_LIBPTTLS
52   deps += $(top_builddir)/src/libpttls/libpttls.la
53   libs += $(DESTDIR)$(ipseclibdir)/libpttls.so
54 endif
55
56 if USE_LIBTNCCS
57   deps += $(top_builddir)/src/libtnccs/libtnccs.la
58   libs += $(DESTDIR)$(ipseclibdir)/libtnccs.so
59 if !MONOLITHIC
60   AM_CPPFLAGS += -DT_PLUGINS=\""${t_plugins}\""
61 endif
62 endif
63
64 if USE_SIMAKA
65   deps += $(top_builddir)/src/libsimaka/libsimaka.la
66   libs += $(DESTDIR)$(ipseclibdir)/libsimaka.so
67 endif
68
69 if USE_IMCV
70   deps += $(top_builddir)/src/libimcv/libimcv.la
71   libs += $(DESTDIR)$(ipseclibdir)/libimcv.so
72 endif
73
74 if USE_CHARON
75   deps += $(top_builddir)/src/libcharon/libcharon.la
76   libs += $(DESTDIR)$(ipseclibdir)/libcharon.so
77   exes += $(DESTDIR)$(ipsecdir)/charon
78 if !MONOLITHIC
79   AM_CPPFLAGS += -DC_PLUGINS=\""${c_plugins}\""
80 endif
81 endif
82
83 if USE_CMD
84   exes += $(DESTDIR)$(sbindir)/charon-cmd
85 endif
86
87 if USE_SCEPCLIENT
88   exes += $(DESTDIR)$(ipsecdir)/scepclient
89 endif
90
91 if USE_PKI
92   exes += $(DESTDIR)$(bindir)/pki
93 endif
94
95 if USE_SWANCTL
96   exes += $(DESTDIR)$(sbindir)/swanctl
97 endif
98
99 if USE_ATTR_SQL
100   exes += $(DESTDIR)$(ipsecdir)/pool
101 endif
102
103 if USE_IMV_ATTESTATION
104   exes += $(DESTDIR)$(ipsecdir)/attest
105 endif
106
107 checksum.c : checksum_builder $(deps) $(exes)
108                 ./checksum_builder $(libs) $(exes) > checksum.c
109
110 install-data-hook : $(EXTRA_LTLIBRARIES)
111         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' install-ipseclibLTLIBRARIES
112
113 uninstall-hook :
114         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' uninstall-ipseclibLTLIBRARIES
115
116 clean-local :
117         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' clean-ipseclibLTLIBRARIES