1231793f30102c3e2e982f347347c5026a899c11
[trust_router.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2 DISTCHECK_CONFIGURE_FLAGS = \
3         --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
4 bin_PROGRAMS= tr/trust_router tr/trpc tid/example/tidc tid/example/tids common/tests/tr_dh_test common/tests/mq_test \
5               common/tests/thread_test trp/msgtst trp/test/rtbl_test trp/test/ptbl_test common/tests/cfg_test \
6               common/tests/commtest common/tests/name_test common/tests/filt_test mon/tests/test_mon_req_encode \
7               mon/tests/test_mon_req_decode mon/tests/test_mon_resp_encode tr/trmon
8 AM_CPPFLAGS=-I$(srcdir)/include $(GLIB_CFLAGS)
9 AM_CFLAGS = -Wall -Werror=missing-prototypes -Werror -Wno-parentheses $(GLIB_CFLAGS)
10 SUBDIRS = gsscon 
11 common_srcs = common/tr_name.c \
12         common/tr_constraint.c \
13         common/jansson_iterators.h \
14         common/tr_msg.c \
15         common/tr_dh.c \
16     common/tr_debug.c \
17         common/tr_util.c \
18         common/tr_apc.c \
19         common/tr_comm.c \
20         common/tr_comm_encoders.c \
21         common/tr_rp.c \
22         common/tr_rp_client.c \
23         common/tr_rp_client_encoders.c \
24         common/tr_idp.c \
25         common/tr_idp_encoders.c \
26         common/tr_filter.c \
27         common/tr_filter_encoders.c \
28         common/tr_gss_names.c \
29         common/tr_socket.c \
30         $(mon_srcs)
31
32 tid_srcs = tid/tid_resp.c \
33 tid/tid_req.c \
34 tid/tids.c \
35 tid/tidc.c \
36 common/tr_rand_id.c
37
38 trp_srcs = trp/trp_conn.c \
39 trp/trps.c \
40 trp/trpc.c \
41 trp/trp_peer.c \
42 trp/trp_peer_encoders.c \
43 trp/trp_ptable.c \
44 trp/trp_ptable_encoders.c \
45 trp/trp_route.c \
46 trp/trp_route_encoders.c \
47 trp/trp_rtable.c \
48 trp/trp_rtable_encoders.c \
49 trp/trp_req.c \
50 trp/trp_upd.c \
51 common/tr_mq.c \
52 $(config_srcs)
53
54 # configuration parsing sources
55 config_srcs = \
56     common/tr_config.c \
57     common/tr_config_comms.c \
58     common/tr_config_encoders.c \
59     common/tr_config_filters.c \
60     common/tr_config_internal.c \
61     common/tr_config_orgs.c \
62     common/tr_config_realms.c \
63     common/tr_config_rp_clients.c
64
65 # general monitoring message sources
66 mon_srcs =                   \
67     mon/mon_common.c         \
68     mon/mon_req.c            \
69     mon/mon_req_encode.c     \
70     mon/mon_req_decode.c     \
71     mon/mon_resp.c           \
72     mon/mon_resp_decode.c    \
73     mon/mon_resp_encode.c
74
75 # monitoring server sources
76 mons_srcs = \
77     mon/mons.c \
78     mon/mons_handlers.c
79
80 check_PROGRAMS = common/t_constraint
81 TESTS = common/t_constraint
82 TEST_CFLAGS = -Wno-missing-prototypes
83
84 lib_LTLIBRARIES = libtr_tid.la
85
86 libtr_tid_la_SOURCES = $(tid_srcs) \
87 $(common_srcs) \
88 trp/trp_req.c \
89 trp/trp_upd.c
90
91 libtr_tid_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
92 libtr_tid_la_LIBADD = gsscon/libgsscon.la $(GLIB_LIBS)
93 libtr_tid_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:1:2 -no-undefined
94
95 common_t_constraint_SOURCES = common/t_constraint.c \
96 common/tr_debug.c \
97 common/tr_name.c \
98 common/tr_constraint.c \
99 common/tr_dh.c \
100 common/tr_rand_id.c \
101 tid/tid_req.c \
102 tid/tid_resp.c
103
104 common_t_constraint_CPPFLAGS = $(AM_CPPFLAGS) -DTESTS=\"$(srcdir)/common/tests.json\"
105 common_t_constraint_LDADD = gsscon/libgsscon.la 
106
107 tr_trust_router_SOURCES =tr/tr_main.c \
108 tr/tr.c \
109 tr/tr_event.c \
110 tr/tr_cfgwatch.c \
111 tr/tr_tid.c \
112 tr/tr_tid_mons.c \
113 tr/tr_trp.c \
114 tr/tr_trp_mons.c \
115 tr/tr_mon.c \
116 common/tr_gss.c \
117 common/tr_gss_client.c \
118 $(tid_srcs) \
119 $(trp_srcs) \
120 $(common_srcs) \
121 $(mons_srcs)
122
123 tr_trust_router_LDFLAGS = $(AM_LDFLAGS) -levent_pthreads -pthread
124 tr_trust_router_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
125
126 tr_trpc_SOURCES =tr/trpc_main.c \
127 tr/tr_trp.c \
128 common/tr_gss.c \
129 common/tr_gss_client.c \
130 $(trp_srcs) \
131 $(tid_srcs) \
132 $(common_srcs)
133
134 tr_trpc_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
135 tr_trpc_LDFLAGS = $(AM_LDFLAGS) -pthread
136
137 tr_trmon_SOURCES = tr/trmon_main.c \
138 common/tr_gss.c \
139 common/tr_gss_client.c \
140 $(tid_srcs) \
141 $(trp_srcs) \
142 $(common_srcs) \
143 mon/monc.c
144
145 tr_trmon_LDADD = gsscon/libgsscon.la  $(GLIB_LIBS)
146 tr_trmon_LDFLAGS = $(AM_LDFLAGS) -pthread
147
148 trp_msgtst_SOURCES = trp/msgtst.c \
149 $(common_srcs) \
150 common/tr_rand_id.c \
151 trp/trp_req.c \
152 trp/trp_upd.c \
153 tid/tid_resp.c \
154 tid/tid_req.c
155 trp_msgtst_LDADD =  $(GLIB_LIBS)
156
157 trp_test_rtbl_test_SOURCES = trp/test/rtbl_test.c \
158 common/tr_name.c \
159 common/tr_gss_names.c \
160 common/tr_debug.c \
161 common/tr_util.c \
162 trp/trp_route.c \
163 trp/trp_route_encoders.c \
164 trp/trp_rtable.c \
165 trp/trp_rtable_encoders.c
166 trp_test_rtbl_test_LDADD =  $(GLIB_LIBS)
167
168 trp_test_ptbl_test_SOURCES = trp/test/ptbl_test.c \
169 common/tr_gss.c \
170 common/tr_gss_client.c \
171 $(tid_srcs) \
172 $(trp_srcs) \
173 $(common_srcs)
174 trp_test_ptbl_test_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
175 trp_test_ptbl_test_LDFLAGS = $(AM_LDFLAGS) -pthread
176
177 tid_example_tidc_SOURCES = tid/example/tidc_main.c \
178 common/tr_gss.c \
179 common/tr_gss_client.c \
180 $(tid_srcs) \
181 $(trp_srcs) \
182 $(common_srcs)
183 tid_example_tidc_LDADD = gsscon/libgsscon.la  $(GLIB_LIBS)
184 tid_example_tidc_LDFLAGS = $(AM_LDFLAGS) -pthread
185
186 tid_example_tids_SOURCES = tid/example/tids_main.c \
187 common/tr_gss.c \
188 common/tr_gss_client.c \
189 $(tid_srcs) \
190 $(trp_srcs) \
191 $(common_srcs)
192 tid_example_tids_LDADD = gsscon/libgsscon.la  $(GLIB_LIBS)
193 tid_example_tids_LDFLAGS = $(AM_LDFLAGS) -pthread
194
195 common_tests_tr_dh_test_SOURCES = common/tr_dh.c \
196 common/tr_debug.c \
197 common/tests/dh_test.c
198
199 common_tests_mq_test_SOURCES = common/tr_mq.c \
200 common/tests/mq_test.c \
201 common/tr_debug.c
202
203 common_tests_mq_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
204
205 common_tests_cfg_test_SOURCES = common/tests/cfg_test.c \
206 $(common_srcs) \
207 common/tr_gss.c \
208 common/tr_gss_client.c \
209 $(tid_srcs) \
210 $(trp_srcs)
211 common_tests_cfg_test_LDADD = gsscon/libgsscon.la  $(GLIB_LIBS)
212 common_tests_cfg_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
213
214 common_tests_thread_test_SOURCES = common/tr_mq.c \
215 common/tr_debug.c \
216 common/tests/thread_test.c
217
218 common_tests_commtest_SOURCES = common/tests/commtest.c \
219 $(common_srcs) \
220 common/tr_gss.c \
221 common/tr_gss_client.c \
222 $(tid_srcs) \
223 $(trp_srcs)
224 common_tests_commtest_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
225 common_tests_commtest_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
226
227 common_tests_thread_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
228
229 common_tests_name_test_SOURCES = common/tests/name_test.c \
230               $(common_srcs) \
231               common/tr_gss.c \
232               common/tr_gss_client.c \
233               $(tid_srcs) \
234               $(trp_srcs)
235 common_tests_name_test_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
236 common_tests_name_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
237 common_tests_name_test_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
238
239 common_tests_filt_test_SOURCES = common/tests/filt_test.c \
240               $(common_srcs) \
241               common/tr_gss.c \
242               common/tr_gss_client.c \
243               $(tid_srcs) \
244               $(trp_srcs)
245 common_tests_filt_test_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
246 common_tests_filt_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
247 common_tests_filt_test_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
248
249 mon_tests_test_mon_req_encode_SOURCES = mon/tests/test_mon_req_encode.c \
250     $(mon_srcs) \
251     common/tr_name.c
252 mon_tests_test_mon_req_encode_LDADD = $(GLIB_LIBS)
253 mon_tests_test_mon_req_encode_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
254
255 mon_tests_test_mon_req_decode_SOURCES = mon/tests/test_mon_req_decode.c \
256     $(mon_srcs) \
257     common/tr_name.c
258 mon_tests_test_mon_req_decode_LDADD = $(GLIB_LIBS)
259 mon_tests_test_mon_req_decode_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
260
261 mon_tests_test_mon_resp_encode_SOURCES = mon/tests/test_mon_resp_encode.c \
262     $(mon_srcs) \
263     common/tr_name.c
264 mon_tests_test_mon_resp_encode_LDADD = $(GLIB_LIBS)
265 mon_tests_test_mon_resp_encode_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
266
267 pkginclude_HEADERS = include/trust_router/tid.h include/trust_router/tr_name.h \
268         include/tr_debug.h include/trust_router/trp.h \
269         include/trust_router/tr_dh.h \
270         include/trust_router/tr_constraint.h \
271         include/trust_router/tr_versioning.h 
272
273 noinst_HEADERS = include/gsscon.h include/tr_config.h \
274         include/tr_msg.h include/tr.h \
275         include/tr_idp.h include/tr_rp.h \
276         include/tr_comm.h include/tr_apc.h \
277         include/tr_tid.h include/tr_trp.h include/tr_mon.h \
278         include/tr_filter.h include/tr_gss_names.h \
279         include/tid_internal.h include/trp_internal.h include/trp_route.h \
280         include/tr_cfgwatch.h include/tr_event.h \
281         include/tr_mq.h include/trp_peer.h include/trp_ptable.h \
282         include/trp_rtable.h include/tr_util.h \
283         include/tr_name_internal.h include/tr_gss.h
284
285 pkgdata_DATA=schema.sql
286 nobase_dist_pkgdata_DATA=redhat/init redhat/sysconfig redhat/organizations.cfg redhat/tidc-wrapper redhat/trust_router-wrapper redhat/tr-test-internal.cfg redhat/default-internal.cfg redhat/tids-wrapper redhat/sysconfig.tids
287
288 if HAVE_SYSTEMD
289 systemdsystemunit_DATA = tids.service
290 endif
291
292 EXTRA_DIST = trust_router.spec common/tests.json schema.sql tids.service \
293         tr/internal.cfg tr/organizations.cfg \
294         redhat/tids.init