Makefile.am 3.63 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3
#
# Makefile.am for msg module
#
4 5 6
# Copyright (C) 2005,2006 Nokia Corporation
# Contact: Pekka Pessi <pekka.pessi@nokia.com>
# Licensed under LGPL. See file COPYING.
Pekka Pessi's avatar
Pekka Pessi committed
7 8 9 10

# ----------------------------------------------------------------------
# Header paths

11 12
INCLUDES = 	-I$(srcdir)/../url -I../url \
		-I$(srcdir)/../bnf -I../bnf \
13
		-I$(srcdir)/../su -I../su
Pekka Pessi's avatar
Pekka Pessi committed
14 15 16 17

# ----------------------------------------------------------------------
# Build targets

18
noinst_LTLIBRARIES = 	libmsg.la
19
noinst_LIBRARIES = 	libtest_msg.a
20
check_PROGRAMS = 	msg_name_hash test_msg
Pekka Pessi's avatar
Pekka Pessi committed
21 22 23 24

# ----------------------------------------------------------------------
# Rules for building the targets

25 26 27 28 29
GENERATED_H = 		sofia-sip/msg_protos.h sofia-sip/msg_mime_protos.h
PUBLIC_H = 		sofia-sip/msg.h sofia-sip/msg_header.h \
			sofia-sip/msg_types.h sofia-sip/msg_mclass.h \
			sofia-sip/msg_mclass_hash.h sofia-sip/msg_parser.h \
			sofia-sip/msg_addr.h sofia-sip/msg_date.h \
30
			sofia-sip/msg_buffer.h sofia-sip/msg_tag_class.h \
31 32
			sofia-sip/msg_mime.h

33
INTERNAL_H = msg_internal.h test_class.h
Pekka Pessi's avatar
Pekka Pessi committed
34

35
nobase_include_sofia_HEADERS = \
36
			$(GENERATED_H) $(PUBLIC_H)
Pekka Pessi's avatar
Pekka Pessi committed
37

38
GENERATED_HC = $(GENERATED_H) msg_mime_table.c test_table.c test_protos.h
Pekka Pessi's avatar
Pekka Pessi committed
39

40 41 42
BUILT_SOURCES = $(GENERATED_HC)

libmsg_la_SOURCES = msg_internal.h \
Pekka Pessi's avatar
Pekka Pessi committed
43
	msg.c msg_tag.c msg_inlined.c \
Pekka Pessi's avatar
Pekka Pessi committed
44 45 46
	msg_mime.c msg_mime_table.c \
	msg_header_copy.c msg_header_make.c \
	msg_parser.c msg_mclass.c msg_parser_util.c \
47
	msg_basic.c msg_generic.c msg_date.c msg_auth.c
Pekka Pessi's avatar
Pekka Pessi committed
48

49
COVERAGE_INPUT = 	$(libmsg_la_SOURCES) $(include_sofia_HEADERS)
50

51 52
libtest_msg_a_SOURCES = test_class.c test_class.h \
			test_table.c test_inlined.c test_protos.h
53

54
LDADD = 		libtest_msg.a libmsg.la \
55 56
			../bnf/libbnf.la \
			../url/liburl.la \
Pekka Pessi's avatar
Pekka Pessi committed
57
			../ipt/libipt.la \
58
			../su/libsu.la
Pekka Pessi's avatar
Pekka Pessi committed
59

60
test_msg_LDFLAGS = 	-static
Pekka Pessi's avatar
Pekka Pessi committed
61

62
msg_name_hash_LDFLAGS =	-static
Pekka Pessi's avatar
Pekka Pessi committed
63 64 65 66

# ----------------------------------------------------------------------
# Install and distribution rules

67
dist_pkgdata_SCRIPTS = 	msg_parser.awk
Pekka Pessi's avatar
Pekka Pessi committed
68

69
EXTRA_DIST =		msg.docs \
70 71
			sofia-sip/msg_mime_protos.h.in \
			sofia-sip/msg_protos.h.in \
Pekka Pessi's avatar
Pekka Pessi committed
72
			msg_mime_table.c.in \
73 74
			test_protos.h.in \
			test_table.c.in
Pekka Pessi's avatar
Pekka Pessi committed
75 76 77 78

# ----------------------------------------------------------------------
# Tests

79
TESTS = 		test_msg
Pekka Pessi's avatar
Pekka Pessi committed
80 81 82 83

# ----------------------------------------------------------------------
# Sofia specific rules

84
include $(top_srcdir)/rules/sofia.am
Pekka Pessi's avatar
Pekka Pessi committed
85

86
MSG_PARSER_AWK = $(srcdir)/msg_parser.awk
Pekka Pessi's avatar
Pekka Pessi committed
87

88
AWK_MSG_AWK = LC_ALL=C $(AWK) -f $(MSG_PARSER_AWK)
Pekka Pessi's avatar
Pekka Pessi committed
89

90
${GENERATED_HC}: ${MSG_PARSER_AWK}
91

92 93
TEST_CLASS_H = ${srcdir}/test_class.h

94 95 96
test_protos.h test_table.c: ${TEST_CLASS_H}

test_protos.h: ${srcdir}/test_protos.h.in
97
	$(AWK_MSG_AWK) module=msg_test NO_MIDDLE=1 NO_LAST=1 \
98
		PR=$@ TEMPLATE=${srcdir}/test_protos.h.in ${TEST_CLASS_H}
Pekka Pessi's avatar
Pekka Pessi committed
99

100
test_table.c: ${srcdir}/test_table.c.in
101 102
	$(AWK_MSG_AWK) module=msg_test prefix=msg \
		MC_HASH_SIZE=127 multipart=msg_multipart \
103
		PT=$@ TEMPLATE=${srcdir}/test_table.c.in ${TEST_CLASS_H}
104 105

SS_MIME_H = ${srcdir}/sofia-sip/msg_mime.h
106

107 108 109 110
sofia-sip/msg_protos.h sofia-sip/msg_mime_protos.h: ${SS_MIME_H}
msg_mime_table.c: ${SS_MIME_H}

sofia-sip/msg_protos.h: ${srcdir}/sofia-sip/msg_protos.h.in
111
	@-mkdir sofia-sip 2>/dev/null || true
112
	$(AWK_MSG_AWK) module=msg NO_FIRST=1 NO_MIDDLE=1 \
113 114
		PR=$@ TEMPLATE=${srcdir}/sofia-sip/msg_protos.h.in \
		${SS_MIME_H}
115

116
sofia-sip/msg_mime_protos.h: ${srcdir}/sofia-sip/msg_mime_protos.h.in
117
	@-mkdir sofia-sip 2>/dev/null || true
Pekka Pessi's avatar
Pekka Pessi committed
118
	$(AWK_MSG_AWK) module=msg NO_FIRST=1 NO_LAST=1 \
119 120
		PR=$@ TEMPLATE=${srcdir}/sofia-sip/msg_mime_protos.h.in \
		${SS_MIME_H}
Pekka Pessi's avatar
Pekka Pessi committed
121

122
msg_mime_table.c: ${srcdir}/msg_mime_table.c.in
123 124
	$(AWK_MSG_AWK) module=msg_multipart \
		tprefix=msg prefix=mp MC_HASH_SIZE=127 \
125 126
		PT=$@ TEMPLATE=${srcdir}/msg_mime_table.c.in \
		${SS_MIME_H}