27bc09491e6185f2c03358320d6ad9c074c23961
[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/libhydra/libhydra.la \
12         $(top_builddir)/src/libcharon/libcharon.la \
13         $(DLLIB)
14 checksum_builder_LDFLAGS = -rpath '$(DESTDIR)$(ipseclibdir)'
15
16 CLEANFILES = checksum.c $(EXTRA_PROGRAMS)
17
18 AM_CPPFLAGS = \
19         -I$(top_srcdir)/src/libstrongswan \
20         -I$(top_srcdir)/src/libhydra \
21         -I$(top_srcdir)/src/libcharon \
22         -DPLUGINDIR=\"${DESTDIR}${plugindir}\"
23
24 AM_CFLAGS = \
25         $(PLUGIN_CFLAGS)
26
27 # we keep track of build dependencies in deps and use libs to store the paths
28 # to the installed libraries. for executables we use the built files directly
29 # as these are not relinked during installation.
30 deps = $(top_builddir)/src/libstrongswan/libstrongswan.la
31 libs = $(DESTDIR)$(ipseclibdir)/libstrongswan.so
32 exes =
33
34 if !MONOLITHIC
35   AM_CPPFLAGS += -DS_PLUGINS=\""${s_plugins}\""
36 endif
37
38 if USE_LIBHYDRA
39   deps += $(top_builddir)/src/libhydra/libhydra.la
40   libs += $(DESTDIR)$(ipseclibdir)/libhydra.so
41 if !MONOLITHIC
42   AM_CPPFLAGS += -DH_PLUGINS=\""${h_plugins}\""
43 endif
44 endif
45
46 if USE_LIBIPSEC
47   deps += $(top_builddir)/src/libipsec/libipsec.la
48   libs += $(DESTDIR)$(ipseclibdir)/libipsec.so
49 endif
50
51 if USE_TLS
52   deps += $(top_builddir)/src/libtls/libtls.la
53   libs += $(DESTDIR)$(ipseclibdir)/libtls.so
54 endif
55
56 if USE_RADIUS
57   deps += $(top_builddir)/src/libradius/libradius.la
58   libs += $(DESTDIR)$(ipseclibdir)/libradius.so
59 endif
60
61 if USE_LIBPTTLS
62   deps += $(top_builddir)/src/libpttls/libpttls.la
63   libs += $(DESTDIR)$(ipseclibdir)/libpttls.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_PTS
85   deps += $(top_builddir)/src/libpts/libpts.la
86   libs += $(DESTDIR)$(ipseclibdir)/libpts.so
87 endif
88
89 if USE_CHARON
90   deps += $(top_builddir)/src/libcharon/libcharon.la
91   libs += $(DESTDIR)$(ipseclibdir)/libcharon.so
92   exes += $(DESTDIR)$(ipsecdir)/charon
93 if !MONOLITHIC
94   AM_CPPFLAGS += -DC_PLUGINS=\""${c_plugins}\""
95 endif
96 endif
97
98 if USE_CMD
99   exes += $(DESTDIR)$(sbindir)/charon-cmd
100 endif
101
102 if USE_TOOLS
103   exes += $(DESTDIR)$(ipsecdir)/scepclient
104 endif
105
106 if USE_PKI
107   exes += $(DESTDIR)$(bindir)/pki
108 endif
109
110 if USE_SWANCTL
111   exes += $(DESTDIR)$(sbindir)/swanctl
112 endif
113
114 if USE_ATTR_SQL
115   exes += $(DESTDIR)$(ipsecdir)/pool
116 endif
117
118 if USE_IMV_ATTESTATION
119   exes += $(DESTDIR)$(ipsecdir)/attest
120 endif
121
122 checksum.c : checksum_builder $(deps) $(exes)
123                 ./checksum_builder $(libs) $(exes) > checksum.c
124
125 install-data-hook : $(EXTRA_LTLIBRARIES)
126         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' install-ipseclibLTLIBRARIES
127
128 uninstall-hook :
129         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' uninstall-ipseclibLTLIBRARIES
130
131 clean-local :
132         $(MAKE) $(AM_MAKEFLAGS) LIBCHECKSUM_LIBS='$(EXTRA_LTLIBRARIES)' clean-ipseclibLTLIBRARIES