]> git.meshlink.io Git - catta/blob - avahi-gobject/Makefile.am
split off libavahi-gobject into its own directory
[catta] / avahi-gobject / Makefile.am
1 # $Id$
2 #
3 # This file is part of avahi.
4 #
5 # avahi is free software; you can redistribute it and/or modify it
6 # under the terms of the GNU Lesser General Public License as
7 # published by the Free Software Foundation; either version 2 of the
8 # License, or (at your option) any later version.
9 #
10 # avahi is distributed in the hope that it will be useful, but WITHOUT
11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
13 # License for more details.
14 #
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with avahi; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
18 # USA.
19
20 AM_CFLAGS=-I$(top_srcdir)
21
22 # This cool debug trap works on i386/gcc only
23 AM_CFLAGS+='-DDEBUG_TRAP=__asm__("int $$3")'
24
25 if HAVE_GOBJECT
26
27 avahigobjectincludedir=$(includedir)/avahi-gobject
28
29 avahigobjectinclude_HEADERS = \
30         ga-client.h \
31         ga-entry-group.h \
32         ga-enums.h \
33         ga-errors.h \
34         ga-record-browser.h \
35         ga-service-browser.h \
36         ga-service-resolver.h
37
38 lib_LTLIBRARIES = \
39         libavahi-gobject.la
40
41 BUILT_SOURCES = \
42         signals-marshal.list \
43         signals-marshal.h \
44         signals-marshal.c \
45         ga-client-enumtypes.h \
46         ga-client-enumtypes.c  \
47         ga-entry-group-enumtypes.h \
48         ga-entry-group-enumtypes.c  \
49         ga-enums-enumtypes.h \
50         ga-enums-enumtypes.c
51
52 CORE_SOURCES = \
53         ga-client.c ga-client.h \
54         ga-entry-group.c ga-entry-group.h \
55         ga-enums.h \
56         ga-errors.c ga-errors.h \
57         ga-record-browser.c ga-record-browser.h \
58         ga-service-browser.c ga-service-browser.h \
59         ga-service-resolver.c ga-service-resolver.h
60
61 libavahi_gobject_la_SOURCES = \
62         $(CORE_SOURCES) \
63         $(BUILT_SOURCES)
64
65 libavahi_gobject_la_CFLAGS = $(AM_CFLAGS) $(GOBJECT_CFLAGS)
66 libavahi_gobject_la_LIBADD = $(AM_LDADD) ../avahi-common/libavahi-common.la ../avahi-client/libavahi-client.la ../avahi-glib/libavahi-glib.la $(GOJECT_LIBS)
67 libavahi_gobject_la_LDFLAGS = $(AM_LDFLAGS) -export-dynamic -version-info $(LIBAVAHI_GOBJECT_VERSION_INFO)
68
69 # correctly clean the generated source files
70 CLEANFILES = $(BUILT_SOURCES)
71
72 dist-hook:
73         $(shell for x in $(BUILT_SOURCES); do rm -f $(distdir)/$$x ; done)
74
75 signals-marshal.list: $(CORE_SOURCES) Makefile.am
76         ( cd $(srcdir) && \
77         sed -n -e 's/.*ga_signals_marshal_\([A-Z]*__[A-Z_]*\).*/\1/p' \
78                 $(CORE_SOURCES) ) \
79                 | sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
80         if cmp -s $@.tmp $@; then \
81                 rm $@.tmp; \
82         else \
83                 mv $@.tmp $@; \
84         fi
85
86 signals-marshal.h: signals-marshal.list
87         glib-genmarshal --header --prefix=ga_signals_marshal $< > $@
88
89 signals-marshal.c: signals-marshal.list
90         glib-genmarshal --body --prefix=ga_signals_marshal $< > $@
91
92
93 # rules for making the glib enum objects
94 %-enumtypes.h: %.h Makefile.in
95         glib-mkenums \
96         --fhead "#ifndef __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__\n#define __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
97         --fprod "/* enumerations from \"@filename@\" */\n" \
98         --vhead "GType @enum_name@_get_type (void);\n#define $(shell echo $* | tr [:lower:]- [:upper:]_ | sed 's/_.*//')_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n"         \
99         --ftail "G_END_DECLS\n\n#endif /* __$(shell echo $* | tr [:lower:]- [:upper:]_)_ENUM_TYPES_H__ */" \
100         $< > $@
101
102 %-enumtypes.c: %.h Makefile.in
103         glib-mkenums \
104         --fhead "#include <$*.h>" \
105         --fprod "\n/* enumerations from \"@filename@\" */" \
106         --vhead "GType\n@enum_name@_get_type (void)\n{\n  static GType etype = 0;\n  if (etype == 0) {\n    static const G@Type@Value values[] = {"     \
107         --vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@VALUENAME@\" }," \
108         --vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (\"@EnumName@\", values);\n  }\n  return etype;\n}\n" \
109         $< > $@
110
111 endif
112
113 indent:
114         indent -brf -nbbo -nbc -ip0 -cs -nbfde -npsl -br -brs -bap -i4 -bs -cdw -ce -npcs -hnl -cli4 -nut -ci8 ga-*.[ch]