summaryrefslogtreecommitdiff
path: root/pig/Makefile.am
blob: d760e49790e0d5b1934b89ddee77830d6bacd532 (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
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
101
102
103
104
105
106
107
108
109
lib_LTLIBRARIES = libpig-@PIG_MAJORMINOR@.la

libpig_@PIG_MAJORMINOR@_la_SOURCES = \
	pig-enums.c \
	pig-marshal.c \
	pig-picture.c \
  	pig-version.c

libpig_@PIG_MAJORMINOR@_la_CFLAGS = \
  	-I$(top_srcdir) $(GLOBAL_CFLAGS) \
	$(CAIRO_CFLAGS) $(GLIB_CFLAGS) \
	-DG_LOG_DOMAIN=\"Pig\" \
	-DPIG_COMPILATION

libpig_@PIG_MAJORMINOR@_la_LDFLAGS = \
	$(SYMBOLIC_LDFLAGS) \
	-version-info $(PIG_LIBVERSION) \
	-export-symbols-regex '^(pig_.*)' \
	$(CAIRO_LIBS) $(GLIB_LIBS)

public_headers = \
	pig.h \
	pig-picture.h

if HAVE_PIXBUF
lib_LTLIBRARIES += libpig-pixbuf-@PIG_MAJORMINOR@.la

libpig_pixbuf_@PIG_MAJORMINOR@_la_SOURCES = \
	pig-pixbuf-picture.c

libpig_pixbuf_@PIG_MAJORMINOR@_la_CFLAGS = \
	$(GLOBAL_CFLAGS) $(PIG_CFLAGS) $(PIXBUF_CFLAGS) \
	-DG_LOG_DOMAIN=\"Pig-Pixbuf\" \
	-DPIG_PIXBUF_COMPILATION

libpig_pixbuf_@PIG_MAJORMINOR@_la_LIBS = \
  	libpig-@PIG_MAJORMINOR@.la
  	
libpig_pixbuf_@PIG_MAJORMINOR@_la_LDFLAGS = \
	-version-info $(PIG_LIBVERSION) \
	-export-symbols-regex '^(pig_pixbuf_.*)' \
	$(PIG_LIBS) $(PIXBUF_LIBS)

public_pixbuf_headers = \
	pig-pixbuf.h \
	pig-pixbuf-picture.h
else
public_pixbuf_headers =
endif

libpig_@PIG_MAJORMINOR@includedir = $(includedir)/pig-@PIG_MAJORMINOR@/pig
libpig_@PIG_MAJORMINOR@include_HEADERS = \
	$(public_headers) \
	$(public_pixbuf_headers) \
	pig-enums.h

nodist_libpig_@PIG_MAJORMINOR@include_HEADERS = \
	pig-version.h

noinst_HEADERS = \
	pig-marshal-private.h

EXTRA_DIST = \
	pig-marshal.list \
	pig-version.h.in

BUILT_SOURCES = \
	pig-enums.c \
	pig-enums.h \
	pig-marshal.c \
	pig-marshal-private.h

CLEANFILES = \
	$(BUILT_SOURCES)

DISTCLEANFILES = pig-version.h

pig-marshal-private.h: pig-marshal.list Makefile
	$(GLIB_GENMARSHAL) --prefix=_pig_marshal $(srcdir)/pig-marshal.list --header >> xgen-smh \
	&& (cmp -s xgen-smh pig-marshal-private.h || cp xgen-smh pig-marshal-private.h) \
	&& rm -f xgen-smh

pig-marshal.c: pig-marshal.list Makefile
	(echo "#include \"pig-marshal-private.h\""; \
	 $(GLIB_GENMARSHAL) --prefix=_pig_marshal $(srcdir)/pig-marshal.list --body;) >> xgen-smc \
	&& cp xgen-smc pig-marshal.c \
	&& rm -f xgen-smc 

pig-enums.h: $(public_headers) Makefile
	( cd $(srcdir) && $(GLIB_MKENUMS) \
			--fhead "#ifndef __PIG_ENUMS_H__\n#define __PIG_ENUMS_H__\n\n#include <glib-object.h>\n\nG_BEGIN_DECLS\n" \
			--fprod "/* enumerations from \"@filename@\" */\n" \
			--vhead "GType @enum_name@_get_type (void) G_GNUC_CONST;\n#define PIG_TYPE_@ENUMSHORT@ (@enum_name@_get_type())\n" \
			--ftail "G_END_DECLS\n\n#endif /* __PIG_ENUMS_H__ */" \
		$(public_headers) ) >> xgen-seh \
	&& (cmp -s xgen-seh pig-enums.h || cp xgen-seh pig-enums.h ) \
	&& rm -f xgen-seh

pig-enums.c: $(public_headers) Makefile
	( cd $(srcdir) && $(GLIB_MKENUMS) \
			--fhead "#include \"pig.h\"\n" \
			--fprod "\n/* enumerations from \"@filename@\" */" \
			--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[] = {" \
			--vprod "      { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
			--vtail "      { 0, NULL, NULL }\n    };\n    etype = g_@type@_register_static (g_intern_static_string (\"@EnumName@\"), values);\n  }\n  return etype;\n}\n" \
		$(public_headers) ) > xgen-sec \
	&& (cmp -s xgen-sec pig-enums.c || cp xgen-sec pig-enums.c ) \
	&& rm -f xgen-sec