1#
2# Makefile.am for sip module
3#
4
5# ----------------------------------------------------------------------
6# Header paths
7
8AM_CPPFLAGS = 	-I$(srcdir)/../bnf -I../bnf \
9		-I$(srcdir)/../ipt -I../ipt \
10		-I$(srcdir)/../msg -I../msg \
11		-I$(srcdir)/../url -I../url \
12		-I$(srcdir)/../su -I../su
13
14# ----------------------------------------------------------------------
15# Build targets
16
17noinst_LTLIBRARIES = 	libsip.la
18
19check_PROGRAMS =       torture_sip \
20			test_sip_msg validator test_date
21
22# ----------------------------------------------------------------------
23# Rules for building the targets
24
25GENERATED_H = 		sofia-sip/sip_hclasses.h \
26			sofia-sip/sip_protos.h sofia-sip/sip_tag.h \
27			sofia-sip/sip_extra.h
28
29H_IN = 			sofia-sip/sip_hclasses.h.in \
30			sofia-sip/sip_protos.h.in sofia-sip/sip_tag.h.in \
31			sofia-sip/sip_extra.h.in
32
33PUBLIC_H = sofia-sip/sip.h sofia-sip/sip_util.h \
34           sofia-sip/sip_header.h sofia-sip/sip_parser.h \
35	   sofia-sip/sip_tag_class.h sofia-sip/sip_status.h
36
37GENERATED_C = sip_tag.c sip_parser_table.c
38
39BUILT_SOURCES = 	$(GENERATED_H) $(GENERATED_C) sip_tag_ref.c
40
41nobase_include_sofia_HEADERS = $(GENERATED_H) $(PUBLIC_H) $(H_IN)
42
43libsip_la_SOURCES = 	$(INTERNAL_H) \
44			sip_parser.c sip_header.c sip_util.c sip_pref_util.c \
45			sip_basic.c sip_extra.c sip_feature.c sip_mime.c \
46			sip_security.c sip_event.c sip_prack.c \
47			sip_refer.c sip_session.c \
48			sip_caller_prefs.c sip_reason.c \
49			sip_status.c sip_time.c \
50			sip_tag_class.c sip_inlined.c \
51			$(BUILT_SOURCES)
52
53COVERAGE_INPUT = 	$(libsip_la_SOURCES) $(include_sofia_HEADERS)
54
55LDADD = 		libsip.la \
56			../msg/libmsg.la \
57			../bnf/libbnf.la \
58			../url/liburl.la \
59			../ipt/libipt.la \
60			../su/libsu.la
61
62torture_sip_LDFLAGS = 	-static
63test_sip_msg_LDFLAGS = 	-static
64test_date_LDFLAGS = 	-static
65
66# ----------------------------------------------------------------------
67# Install and distribution rules
68
69# note: srcdir needs to be specified, otherwise
70#       breaks make distcheck target
71
72EXTRA_DIST =		sip.docs sip_parser.docs sip.doxyaliases \
73			ADD-A-HEADER GRAMMAR sip_bad_mask \
74			sip_parser_table.c.in sip_tag.c.in \
75			sip_extra_headers.txt \
76	images/sip-parser.eps images/sip-parser.gif \
77	images/sip-parser2.eps images/sip-parser2.gif \
78	images/sip-parser3.eps images/sip-parser3.gif \
79	images/sip-parser4.eps images/sip-parser4.gif \
80	tests/own0.txt tests/own1.txt tests/own2.txt tests/own3.txt \
81	tests/own4.txt tests/own5.txt tests/own6.txt tests/own8.txt \
82	tests/test1.txt tests/test-ack-1.txt tests/test2.txt tests/test3.txt \
83	tests/test4.txt tests/test5.txt tests/test6.txt tests/test7.txt	     \
84	tests/test8.txt tests/test9.txt tests/test10.txt tests/test10b.txt   \
85	tests/test10c.txt tests/test11.txt tests/test12.txt tests/test13.txt \
86	tests/test14-req.txt tests/test14.txt tests/test15.txt		     \
87	tests/test16.txt tests/test17.txt tests/test18.txt tests/test19.txt  \
88	tests/test1a.txt tests/test20.txt tests/test21.txt tests/test22.txt  \
89	tests/test23.txt tests/test24.txt tests/test25.txt tests/test26.txt  \
90	tests/test27.txt tests/test28.txt tests/test29.txt tests/test30.txt  \
91	tests/test31.txt tests/test32.txt tests/test33.txt tests/test34.txt  \
92	tests/test35.txt tests/test36.txt tests/test37.txt tests/test38.txt  \
93	tests/test39.txt tests/test40.txt tests/test41.txt tests/test42.txt
94
95# ----------------------------------------------------------------------
96# Tests
97
98TESTS = torture_sip run_test_sip_msg run_test_date
99
100dist_noinst_SCRIPTS = 	run_test_sip_msg run_test_date
101
102# ----------------------------------------------------------------------
103# Sofia specific rules
104
105include $(top_srcdir)/rules/sofia.am
106
107MSG_PARSER_AWK = $(srcdir)/../msg/msg_parser.awk
108
109AWK_SIP_AWK = LC_ALL=C $(AWK) -f $(MSG_PARSER_AWK) module=sip
110
111SS_SIP_H = ${srcdir}/sofia-sip/sip.h
112
113EXTRA = ${srcdir}/sip_extra_headers.txt
114
115${GENERATED_H} ${GENERATED_C}: ${SS_SIP_H} ${MSG_PARSER_AWK}
116
117sofia-sip/sip_hclasses.h: ${srcdir}/sofia-sip/sip_hclasses.h.in
118	@-mkdir sofia-sip 2>/dev/null || true
119	${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/sip_hclasses.h.in \
120		${SS_SIP_H}
121
122sofia-sip/sip_protos.h: ${srcdir}/sofia-sip/sip_protos.h.in
123	@-mkdir sofia-sip 2>/dev/null || true
124	${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/sip_protos.h.in \
125		 ${SS_SIP_H}
126
127sofia-sip/sip_tag.h: ${srcdir}/sofia-sip/sip_tag.h.in
128	@-mkdir sofia-sip 2>/dev/null || true
129	${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/sofia-sip/sip_tag.h.in \
130		${SS_SIP_H}
131
132sip_tag.c: ${srcdir}/sip_tag.c.in ${EXTRA}
133	${AWK_SIP_AWK} PR=$@ TEMPLATE=${srcdir}/sip_tag.c.in \
134		${SS_SIP_H} ${EXTRA}
135
136# Note: sip_bad_mask is used by nta to weed out bad messages
137
138sip_parser_table.c: ${srcdir}/sip_parser_table.c.in ${EXTRA} sip_bad_mask
139	${AWK_SIP_AWK} PT=$@ TEMPLATE=${srcdir}/sip_parser_table.c.in \
140		FLAGFILE=${srcdir}/sip_bad_mask \
141		MC_HASH_SIZE=127 MC_SHORT_SIZE=26 \
142		${SS_SIP_H} ${EXTRA}
143
144sofia-sip/sip_extra.h: ${srcdir}/sofia-sip/sip_extra.h.in ${EXTRA}
145	@-mkdir -p sofia-sip 2>/dev/null
146	${AWK_SIP_AWK} PR=$@ NO_FIRST=1 NO_LAST=1 \
147		PACKAGE_NAME="${PACKAGE_NAME}" \
148		PACKAGE_VERSION="${PACKAGE_VERSION}" \
149		TEMPLATE1=${srcdir}/sofia-sip/sip_hclasses.h.in \
150		TEMPLATE2=${srcdir}/sofia-sip/sip_protos.h.in \
151		TEMPLATE3=${srcdir}/sofia-sip/sip_tag.h.in \
152		TEMPLATE=${srcdir}/sofia-sip/sip_extra.h.in ${EXTRA}
153