Checkpoint commit: refactoring the request code in TIDS for better reuse
[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
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_rp.c \
21         common/tr_idp.c \
22         common/tr_filter.c \
23         common/tr_gss_names.c \
24         common/tr_socket.c
25
26 tid_srcs = tid/tid_resp.c \
27 tid/tid_req.c \
28 tid/tids.c \
29 tid/tidc.c
30
31 trp_srcs = trp/trp_conn.c \
32 trp/trps.c \
33 trp/trpc.c \
34 trp/trp_ptable.c \
35 trp/trp_rtable.c \
36 trp/trp_req.c \
37 trp/trp_upd.c \
38 common/tr_config.c \
39 common/tr_mq.c
40
41 mon_srcs =                      \
42     mon/mon_common.c                \
43     mon/mon_req.c            \
44     mon/mon_req_encode.c     \
45     mon/mon_req_decode.c     \
46     mon/mon_resp.c           \
47     mon/mon_resp_encode.c
48
49 check_PROGRAMS = common/t_constraint
50 TESTS = common/t_constraint
51 TEST_CFLAGS = -Wno-missing-prototypes
52
53 lib_LTLIBRARIES = libtr_tid.la
54
55 libtr_tid_la_SOURCES = $(tid_srcs) \
56 $(common_srcs) \
57 trp/trp_req.c \
58 trp/trp_upd.c
59
60 libtr_tid_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
61 libtr_tid_la_LIBADD = gsscon/libgsscon.la $(GLIB_LIBS)
62 libtr_tid_la_LDFLAGS = $(AM_LDFLAGS) -version-info 4:1:2 -no-undefined
63
64 common_t_constraint_SOURCES = common/t_constraint.c \
65 common/tr_debug.c \
66 common/tr_name.c \
67 common/tr_constraint.c \
68 common/tr_dh.c \
69 tid/tid_req.c \
70 tid/tid_resp.c
71
72 common_t_constraint_CPPFLAGS = $(AM_CPPFLAGS) -DTESTS=\"$(srcdir)/common/tests.json\"
73 common_t_constraint_LDADD = gsscon/libgsscon.la 
74
75 tr_trust_router_SOURCES =tr/tr_main.c \
76 tr/tr.c \
77 tr/tr_event.c \
78 tr/tr_cfgwatch.c \
79 tr/tr_tid.c \
80 tr/tr_trp.c \
81 common/tr_gss.c \
82 $(tid_srcs) \
83 $(trp_srcs) \
84 $(common_srcs)
85
86 tr_trust_router_LDFLAGS = $(AM_LDFLAGS) -levent_pthreads -pthread
87 tr_trust_router_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
88 tr_trpc_SOURCES =tr/trpc_main.c \
89 tr/tr_trp.c \
90 common/tr_gss.c \
91 $(trp_srcs) \
92 $(tid_srcs) \
93 $(common_srcs)
94
95 tr_trpc_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
96 tr_trpc_LDFLAGS = $(AM_LDFLAGS) -pthread
97
98 trp_msgtst_SOURCES = trp/msgtst.c \
99 $(common_srcs) \
100 trp/trp_req.c \
101 trp/trp_upd.c \
102 tid/tid_resp.c \
103 tid/tid_req.c
104 trp_msgtst_LDADD =  $(GLIB_LIBS)
105
106 trp_test_rtbl_test_SOURCES = trp/test/rtbl_test.c \
107 common/tr_name.c \
108 common/tr_gss_names.c \
109 common/tr_debug.c \
110 trp/trp_rtable.c
111 trp_test_rtbl_test_LDADD =  $(GLIB_LIBS)
112
113 trp_test_ptbl_test_SOURCES = trp/test/ptbl_test.c \
114 common/tr_gss.c \
115 $(tid_srcs) \
116 $(trp_srcs) \
117 $(common_srcs)
118 trp_test_ptbl_test_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
119 trp_test_ptbl_test_LDFLAGS = $(AM_LDFLAGS) -pthread
120
121 tid_example_tidc_SOURCES = tid/example/tidc_main.c \
122 common/tr_gss.c \
123 $(tid_srcs) \
124 $(trp_srcs) \
125 $(common_srcs)
126 tid_example_tidc_LDADD = gsscon/libgsscon.la  $(GLIB_LIBS)
127 tid_example_tidc_LDFLAGS = $(AM_LDFLAGS) -pthread
128
129 tid_example_tids_SOURCES = tid/example/tids_main.c \
130 common/tr_gss.c \
131 $(tid_srcs) \
132 $(trp_srcs) \
133 $(common_srcs)
134 tid_example_tids_LDADD = gsscon/libgsscon.la  $(GLIB_LIBS)
135 tid_example_tids_LDFLAGS = $(AM_LDFLAGS) -pthread
136
137 common_tests_tr_dh_test_SOURCES = common/tr_dh.c \
138 common/tr_debug.c \
139 common/tests/dh_test.c
140
141 common_tests_mq_test_SOURCES = common/tr_mq.c \
142 common/tests/mq_test.c \
143 common/tr_debug.c
144
145 common_tests_mq_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
146
147 common_tests_cfg_test_SOURCES = common/tests/cfg_test.c \
148 $(common_srcs) \
149 common/tr_gss.c \
150 $(tid_srcs) \
151 $(trp_srcs)
152 common_tests_cfg_test_LDADD = gsscon/libgsscon.la  $(GLIB_LIBS)
153 common_tests_cfg_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
154
155 common_tests_thread_test_SOURCES = common/tr_mq.c \
156 common/tr_debug.c \
157 common/tests/thread_test.c
158
159 common_tests_commtest_SOURCES = common/tests/commtest.c \
160 $(common_srcs) \
161 common/tr_gss.c \
162 $(tid_srcs) \
163 $(trp_srcs)
164 common_tests_commtest_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
165 common_tests_commtest_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
166
167 common_tests_thread_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
168
169 common_tests_name_test_SOURCES = common/tests/name_test.c \
170               $(common_srcs) \
171               common/tr_gss.c \
172               $(tid_srcs) \
173               $(trp_srcs)
174 common_tests_name_test_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
175 common_tests_name_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
176 common_tests_name_test_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
177
178 common_tests_filt_test_SOURCES = common/tests/filt_test.c \
179               $(common_srcs) \
180               common/tr_gss.c \
181               $(tid_srcs) \
182               $(trp_srcs)
183 common_tests_filt_test_LDADD = gsscon/libgsscon.la $(GLIB_LIBS)
184 common_tests_filt_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc -pthread
185 common_tests_filt_test_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
186
187 mon_tests_test_mon_req_encode_SOURCES = mon/tests/test_mon_req_encode.c \
188     $(mon_srcs) \
189     common/tr_name.c
190 mon_tests_test_mon_req_encode_LDADD = $(GLIB_LIBS)
191 mon_tests_test_mon_req_encode_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
192
193 mon_tests_test_mon_req_decode_SOURCES = mon/tests/test_mon_req_decode.c \
194     $(mon_srcs) \
195     common/tr_name.c
196 mon_tests_test_mon_req_decode_LDADD = $(GLIB_LIBS)
197 mon_tests_test_mon_req_decode_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
198
199 mon_tests_test_mon_resp_encode_SOURCES = mon/tests/test_mon_resp_encode.c \
200     $(mon_srcs) \
201     common/tr_name.c
202 mon_tests_test_mon_resp_encode_LDADD = $(GLIB_LIBS)
203 mon_tests_test_mon_resp_encode_CFLAGS = $(AM_CFLAGS) $(TEST_CFLAGS)
204
205 pkginclude_HEADERS = include/trust_router/tid.h include/trust_router/tr_name.h \
206         include/tr_debug.h include/trust_router/trp.h \
207         include/trust_router/tr_dh.h \
208         include/trust_router/tr_constraint.h \
209         include/trust_router/tr_versioning.h 
210
211 noinst_HEADERS = include/gsscon.h include/tr_config.h \
212         include/tr_msg.h include/tr.h \
213         include/tr_idp.h include/tr_rp.h \
214         include/tr_comm.h include/tr_apc.h \
215         include/tr_tid.h include/tr_trp.h \
216         include/tr_filter.h include/tr_gss_names.h \
217         include/tid_internal.h include/trp_internal.h \
218         include/tr_cfgwatch.h include/tr_event.h \
219         include/tr_mq.h include/trp_ptable.h \
220         include/trp_rtable.h include/tr_util.h \
221         include/tr_name_internal.h include/tr_gss.h
222
223 pkgdata_DATA=schema.sql
224 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
225
226 if HAVE_SYSTEMD
227 systemdsystemunit_DATA = tids.service
228 endif
229
230 EXTRA_DIST = trust_router.spec common/tests.json schema.sql tids.service \
231         tr/internal.cfg tr/organizations.cfg \
232         redhat/tids.init