Clean up Makefile.am to produce libtr_tid
[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/dh_test/tr_dh_test common/mq_test/mq_test common/mq_test/thread_test trp/msgtst trp/test/rtbl_test trp/test/ptbl_test common/cfg_test/cfg_test
4 AM_CPPFLAGS=-I$(srcdir)/include $(GLIB_CFLAGS)
5 AM_CFLAGS = -Wall -Werror=missing-prototypes -Werror -Wno-parentheses $(GLIB_CFLAGS)
6 SUBDIRS = gsscon 
7 common_srcs = common/tr_name.c \
8         common/tr_constraint.c \
9         common/jansson_iterators.h \
10         common/tr_msg.c \
11         common/tr_dh.c \
12         common/tr_debug.c \
13         common/tr_util.c
14
15 tid_srcs = tid/tid_resp.c \
16 tid/tid_req.c \
17 tid/tids.c \
18 tid/tidc.c
19
20 trp_srcs = trp/trp_conn.c \
21 trp/trps.c \
22 trp/trpc.c \
23 trp/trp_ptable.c \
24 trp/trp_rtable.c \
25 trp/trp_req.c \
26 trp/trp_upd.c \
27 tid/tid_resp.c \
28 tid/tid_req.c \
29 common/tr_gss.c \
30 common/tr_config.c \
31 common/tr_idp.c \
32 common/tr_apc.c \
33 common/tr_comm.c \
34 common/tr_filter.c \
35 common/tr_rp.c \
36 common/tr_msg.c \
37 common/tr_constraint.c \
38 common/tr_name.c \
39 common/tr_mq.c
40
41 check_PROGRAMS = common/t_constraint
42 TESTS = common/t_constraint
43
44 lib_LTLIBRARIES = libtr_tid.la
45
46 libtr_tid_la_SOURCES = $(tid_srcs) \
47 $(common_srcs) \
48 trp/trp_req.c \
49 trp/trp_upd.c
50
51 libtr_tid_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
52 libtr_tid_la_LIBADD = gsscon/libgsscon.la $(GLIB_LIBS)
53 libtr_tid_la_LDFLAGS = $(AM_LDFLAGS) -version-info 2 -no-undefined
54
55 common_t_constraint_SOURCES = common/t_constraint.c
56 common_t_constraint_CPPFLAGS = $(AM_CPPFLAGS) -DTESTS=\"$(srcdir)/common/tests.json\"
57 common_t_constraint_LDADD = gsscon/libgsscon.la 
58
59 tr_trust_router_SOURCES =tr/tr_main.c \
60 tr/tr.c \
61 tr/tr_event.c \
62 tr/tr_cfgwatch.c \
63 tr/tr_tid.c \
64 tr/tr_trp.c \
65 $(trp_srcs)
66
67 tr_trust_router_CFLAGS = $(AM_CFLAGS) -pthread -v -da -Q
68 tr_trust_router_LDFLAGS = $(AM_LDFLAGS) -levent_pthreads
69 tr_trust_router_LDADD = gsscon/libgsscon.la libtr_tid.la $(GLIB_LIBS)
70
71 tr_trpc_SOURCES =tr/trpc_main.c \
72 tr/tr_trp.c \
73 $(trp_srcs)
74 tr_trpc_LDADD = gsscon/libgsscon.la libtr_tid.la $(GLIB_LIBS)
75
76 trp_msgtst_SOURCES = trp/msgtst.c \
77 common/tr_msg.c \
78 trp/trp_req.c \
79 trp/trp_upd.c \
80 tid/tid_resp.c \
81 tid/tid_req.c
82 trp_msgtst_LDADD = libtr_tid.la $(GLIB_LIBS)
83
84 trp_test_rtbl_test_SOURCES = trp/test/rtbl_test.c \
85 common/tr_name.c \
86 common/tr_gss.c \
87 common/tr_debug.c \
88 trp/trp_rtable.c
89 trp_test_rtbl_test_LDADD =  $(GLIB_LIBS)
90
91 trp_test_ptbl_test_SOURCES = trp/test/ptbl_test.c \
92 $(trp_srcs) 
93 trp_test_ptbl_test_LDADD = gsscon/libgsscon.la libtr_tid.la $(GLIB_LIBS)
94
95 tid_example_tidc_SOURCES = tid/example/tidc_main.c
96 tid_example_tidc_LDADD = gsscon/libgsscon.la libtr_tid.la $(GLIB_LIBS)
97
98 tid_example_tids_SOURCES = tid/example/tids_main.c
99 tid_example_tids_LDADD = gsscon/libgsscon.la libtr_tid.la $(GLIB_LIBS)
100
101 common_dh_test_tr_dh_test_SOURCES = common/tr_dh.c \
102 common/tr_debug.c \
103 common/dh_test/dh_test.c
104
105 common_mq_test_mq_test_SOURCES = common/tr_mq.c \
106 common/mq_test/mq_test.c
107
108 common_mq_test_mq_test_CFLAGS = -pthread
109 common_mq_test_mq_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc
110
111 common_cfg_test_cfg_test_SOURCES = common/cfg_test/cfg_test.c \
112 $(trp_srcs)
113
114 common_cfg_test_cfg_test_LDADD = gsscon/libgsscon.la libtr_tid.la $(GLIB_LIBS)
115 common_cfg_test_cfg_test_CFLAGS = -pthread
116 common_cfg_test_cfg_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc
117
118 common_mq_test_thread_test_SOURCES = common/tr_mq.c \
119 common/tr_debug.c \
120 common/mq_test/thread_test.c
121
122 common_mq_test_thread_test_CFLAGS = -pthread
123 common_mq_test_thread_test_LDFLAGS = $(AM_LDFLAGS) -ltalloc
124
125 pkginclude_HEADERS = include/trust_router/tid.h include/trust_router/tr_name.h \
126         include/tr_debug.h \
127         include/trust_router/tr_dh.h \
128         include/trust_router/tr_constraint.h \
129         include/trust_router/tr_versioning.h 
130
131 noinst_HEADERS = include/gsscon.h include/tr_config.h \
132         include/tr_msg.h include/tr.h \
133         include/tr_idp.h include/tr_rp.h \
134         include/tr_comm.h include/tr_apc.h \
135         include/tr_tid.h include/tr_trp.h \
136         include/tr_filter.h \
137         include/tid_internal.h
138
139 pkgdata_DATA=schema.sql
140 nobase_dist_pkgdata_DATA=redhat/init redhat/sysconfig redhat/trusts.cfg redhat/tidc-wrapper redhat/trust_router-wrapper redhat/tr-test-main.cfg redhat/default-main.cfg redhat/tids-wrapper redhat/sysconfig.tids
141
142 if HAVE_SYSTEMD
143 systemdsystemunit_DATA = tids.service
144 endif
145
146 EXTRA_DIST = trust_router.spec common/tests.json schema.sql tids.service \
147         tr/manual.cfg tr/portal.cfg \
148         redhat/tids.init