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