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