summaryrefslogtreecommitdiff
path: root/gabble/lib/loudmouth/Makefile.am
blob: 63aed69f6ea9e741031f204f62659a3a8474d836 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
noinst_LTLIBRARIES = libloudmouth.la

BUILT_SOURCES = \
  loudmouth-signals-marshal.list \
  loudmouth-signals-marshal.h \
  loudmouth-signals-marshal.c

OUR_SOURCES =                     \
  loudmouth.h                     \
  lm-types.h                      \
  lm-message.c                    \
  lm-message.h                    \
  lm-message-node.c               \
  lm-message-node.h               \
  lm-message-handler.c            \
  lm-message-handler.h            \
  lm-connection.c                 \
  lm-connection.h

libloudmouth_la_SOURCES = $(OUR_SOURCES) $(BUILT_SOURCES)
libloudmouth_la_LIBADD = @WOCKY_LIBS@
# filter out any -flags as we only need to include .a and .la files here:
# this is necessary because: 
# @@ substitutions are filtered out by automake when constructing *_DEPENDENCIES
# *_LIBADD contains the link flags, dynamic libs and static libs we want
# *_DEPENDENCIES _MUST NOT_ contain the link flags and dynamic libs 
# *_DEPENDENCIES _SHOULD_ contain static libs so we rebuild when they change
libloudmouth_la_DEPENDENCIES = \
	$(filter-out -%, $(libloudmouth_la_LIBADD))

# Coding style checks
check_c_sources = \
    $(OUR_SOURCES)

include $(top_srcdir)/tools/check-coding-style.mk
check-local: check-coding-style

CLEANFILES=$(BUILT_SOURCES)
dist-hook:
	$(shell for x in $(BUILT_SOURCES); do rm -f $(distdir)/$$x ; done)

loudmouth-signals-marshal.list: $(OUR_SOURCES) Makefile.am
	$(AM_V_GEN)( cd $(srcdir) && \
	sed -n -e 's/.*_loudmouth_signals_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
	$(OUR_SOURCES) ) \
	| sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
	@if cmp -s $@.tmp $@; then \
		rm $@.tmp; \
		touch $@; \
	else \
		mv $@.tmp $@; \
	fi

%-signals-marshal.h: %-signals-marshal.list Makefile.am
	$(AM_V_GEN)glib-genmarshal --header --prefix=_$(subst -,_,$*)_signals_marshal $< > $@

%-signals-marshal.c: %-signals-marshal.list Makefile.am
	$(AM_V_GEN){ echo '#include "$*-signals-marshal.h"' && \
	glib-genmarshal --body --prefix=_$(subst -,_,$*)_signals_marshal $< ; \
	} > $@


AM_CFLAGS = $(ERROR_CFLAGS) $(GCOV_CFLAGS) @GLIB_CFLAGS@ @WOCKY_CFLAGS@

AM_LDFLAGS = $(GCOV_LIBS) @GLIB_LIBS@ @WOCKY_LIBS@

Android.mk: Makefile.am $(BUILT_SOURCES)
	androgenizer -:PROJECT telepathy-gabble -:STATIC loudmouth -:TAGS eng debug \
	 -:REL_TOP $(top_srcdir) -:ABS_TOP $(abs_top_srcdir) \
	 -:SOURCES $(libloudmouth_la_SOURCES) \
	 -:CFLAGS $(DEFS) $(CFLAGS) $(DEFAULT_INCLUDES) $(INCLUDES) \
	  $(AM_CFLAGS) \
	 -:CPPFLAGS $(CPPFLAGS) $(AM_CPPFLAGS) \
	 -:LDFLAGS $(libloudmouth_la_LIBADD) \
	> $@