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