88210908adb94d40af80648e3926ccb8061a3def
[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_LIBNTTFFT
52   deps += $(top_builddir)/src/libstrongswan/math/libnttfft/libnttfft.la
53   libs += $(DESTDIR)$(ipseclibdir)/libnttfft.so
54 endif
55
56 if USE_LIBPTTLS
57   deps += $(top_builddir)/src/libpttls/libpttls.la
58   libs += $(DESTDIR)$(ipseclibdir)/libpttls.so
59 endif
60
61 if USE_LIBTPMTSS
62   deps += $(top_builddir)/src/libtpmtss/libtpmtss.la
63   libs += $(DESTDIR)$(ipseclibdir)/libtpmtss.so
64 endif
65
66 if USE_LIBTNCCS
67   deps += $(top_builddir)/src/libtnccs/libtnccs.la
68   libs += $(DESTDIR)$(ipseclibdir)/libtnccs.so
69 if !MONOLITHIC
70   AM_CPPFLAGS += -DT_PLUGINS=\""${t_plugins}\""
71 endif
72 endif
73
74 if USE_SIMAKA
75   deps += $(top_builddir)/src/libsimaka/libsimaka.la
76   libs += $(DESTDIR)$(ipseclibdir)/libsimaka.so
77 endif
78
79 if USE_IMCV
80   deps += $(top_builddir)/src/libimcv/libimcv.la
81   libs += $(DESTDIR)$(ipseclibdir)/libimcv.so
82 endif
83
84 if USE_CHARON
85   deps += $(top_builddir)/src/libcharon/libcharon.la
86   libs += $(DESTDIR)$(ipseclibdir)/libcharon.so
87   exes += $(DESTDIR)$(ipsecdir)/charon
88 if !MONOLITHIC
89   AM_CPPFLAGS += -DC_PLUGINS=\""${c_plugins}\""
90 endif
91 endif
92
93 if USE_CMD
94   exes += $(DESTDIR)$(sbindir)/charon-cmd
95 endif
96
97 if USE_SYSTEMD
98   exes += $(DESTDIR)$(sbindir)/charon-systemd
99 endif
100
101 if USE_SCEPCLIENT
102   exes += $(DESTDIR)$(ipsecdir)/scepclient
103 endif
104
105 if USE_PKI
106   exes += $(DESTDIR)$(bindir)/pki
107 endif
108
109 if USE_SWANCTL
110   exes += $(DESTDIR)$(sbindir)/swanctl
111 endif
112
113 if USE_ATTR_SQL
114   exes += $(DESTDIR)$(ipsecdir)/pool
115 endif
116
117 if USE_IMV_ATTESTATION
118   exes += $(DESTDIR)$(ipsecdir)/attest
119 endif
120
121 checksum.c : checksum_builder $(deps) $(exes)
122                 ./checksum_builder $(libs) $(exes) > checksum.c
123
124 install-data-hook : $(EXTRA_LTLIBRARIES)
125         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' install-ipseclibLTLIBRARIES
126
127 uninstall-hook :
128         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' uninstall-ipseclibLTLIBRARIES
129
130 clean-local :
131         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' clean-ipseclibLTLIBRARIES