Makefile.am 2.84 KB
Newer Older
Pekka Pessi's avatar
Pekka Pessi committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
#
# Makefile.am for msg module
#

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

INCLUDES = 	-I$(srcdir)/../bnf \
		-I$(srcdir)/../url \
		-I$(srcdir)/../su

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

Pekka Pessi's avatar
Pekka Pessi committed
15 16 17
noinst_LTLIBRARIES = 	libmsg.la
noinst_LIBRARIES = 	libmsg_test.a
noinst_PROGRAMS = 	msg_name_hash msg_test
Pekka Pessi's avatar
Pekka Pessi committed
18 19 20 21

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

22
GENERATED_H = msg_protos.h msg_mime_protos.h
Pekka Pessi's avatar
Pekka Pessi committed
23 24 25 26 27 28 29 30
PUBLIC_H = msg.h msg_header.h msg_types.h \
	msg_mclass.h	msg_mclass_hash.h msg_parser.h msg_bnf.h \
	msg_auth.h msg_addr.h msg_date.h msg_buffer.h \
	msg_tag_class.h msg_dll.h msg_mime.h
INTERNAL_H = msg_internal.h msg_test_class.h

include_HEADERS = $(GENERATED_H) $(PUBLIC_H) 

31
BUILT_SOURCES = $(GENERATED_H) msg_test_table.c msg_test_protos.h
Pekka Pessi's avatar
Pekka Pessi committed
32

Pekka Pessi's avatar
Pekka Pessi committed
33
libmsg_la_SOURCES = $(INTERNAL_H) \
Pekka Pessi's avatar
Pekka Pessi committed
34 35 36 37 38 39 40
	msg.c msg_tag.c \
	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 \
	msg_basic.c msg_generic.c msg_date.c msg_auth.c \
	memspn.c

Pekka Pessi's avatar
Pekka Pessi committed
41
COVERAGE_INPUT = 	$(libmsg_la_SOURCES) $(include_HEADERS)
42

43 44
libmsg_test_a_SOURCES = msg_test_class.c msg_test_table.c msg_test_protos.h

Pekka Pessi's avatar
Pekka Pessi committed
45 46 47 48
LDADD = 		libmsg_test.a libmsg.la \
			../bnf/libbnf.la \
			../url/liburl.la \
			../su/libsu.la 
Pekka Pessi's avatar
Pekka Pessi committed
49

50
msg_test_LDFLAGS = 	-static
Pekka Pessi's avatar
Pekka Pessi committed
51

52
msg_name_hash_LDFLAGS =	-static
Pekka Pessi's avatar
Pekka Pessi committed
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100

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

sofialibexecdir =	$(libexecdir)/sofia

dist_sofialibexec_SCRIPTS =	msg_parser.awk

EXTRA_DIST =		Doxyfile msg.docs \
			msg_mime_protos.h.in \
			msg_mime_table.c.in \
			msg_protos.h.in \
			msg_test_protos.h.in \
			msg_test_table.c.in

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

TESTS = 		msg_test

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

include ../sofia.am

s=$(srcdir)

$s/msg_test_%.h: $s/msg_parser.awk $s/msg_test_%.h.in $s/msg_test_class.h
	$(AWK) -f $s/msg_parser.awk module=msg_test PR=$@ NO_MIDDLE=1 NO_LAST=1 $s/msg_test_class.h

$s/msg_test_table.c: $s/msg_test_class.h $s/msg_test_table.c.in \
	$s/msg_parser.awk 
	$(AWK) -f $s/msg_parser.awk module=msg_test prefix=msg PT=$@ \
		MC_HASH_SIZE=127 multipart=msg_multipart \
		$s/msg_test_class.h

$s/msg_mime_table.c: $s/msg_mime.h $s/msg_mime_table.c.in $s/msg_parser.awk 
	$(AWK) -f $s/msg_parser.awk \
		module=msg_multipart tprefix=msg prefix=mp PT=$@ \
		MC_HASH_SIZE=127 $s/msg_mime.h

$s/msg_protos.h: $s/msg_parser.awk $s/msg_protos.h.in $s/msg_mime.h
	$(AWK) -f $s/msg_parser.awk PR=$@ module=msg NO_FIRST=1 NO_MIDDLE=1 \
		$s/msg_mime.h

$s/msg_mime_protos.h: $s/msg_parser.awk $s/msg_mime_protos.h.in $s/msg_mime.h
	$(AWK) -f $s/msg_parser.awk PR=$@ module=msg NO_FIRST=1 NO_LAST=1 \
		$s/msg_mime.h