[build] Updated to conditionally build GTK+2 stuff
[adg.git] / adg / Makefile.am
blob9234656baac1bfe591a2d1a66c651d84180bc094
1 AM_CFLAGS=                      -I$(top_srcdir) \
2                                 -I$(top_builddir)
3 AM_LDFLAGS=
4 GLIB_MKENUMS=                   `which glib-mkenums` \
5                                         --template $(srcdir)/$@.template \
6                                         $(srcdir)/adg-enums.h
7 PATTERN=
9 # file groups
10 h_sources=                      adg-adim.h \
11                                 adg-arrow-style.h \
12                                 adg-canvas.h \
13                                 adg-container.h \
14                                 adg-context.h \
15                                 adg-dim.h \
16                                 adg-dim-style.h \
17                                 adg-entity.h \
18                                 adg-font-style.h \
19                                 adg-ldim.h \
20                                 adg-line-style.h \
21                                 adg-matrix.h \
22                                 adg-model.h \
23                                 adg-pair.h \
24                                 adg-path.h \
25                                 adg-pattern.h \
26                                 adg-primitive.h \
27                                 adg-segment.h \
28                                 adg-stroke.h \
29                                 adg-style.h \
30                                 adg-title-block.h \
31                                 adg-toy-text.h \
32                                 adg-util.h
33 built_h_sources=                $(builddir)/adg-type-builtins.h \
34                                 $(builddir)/adg.h
35 private_h_sources=              adg-adim-private.h \
36                                 adg-arrow-style-private.h \
37                                 adg-canvas-private.h \
38                                 adg-container-private.h \
39                                 adg-context-private.h \
40                                 adg-dim-private.h \
41                                 adg-dim-style-private.h \
42                                 adg-entity-private.h \
43                                 adg-enums.h \
44                                 adg-font-style-private.h \
45                                 adg-intl.h \
46                                 adg-ldim-private.h \
47                                 adg-line-style-private.h \
48                                 adg-model-private.h \
49                                 adg-path-private.h \
50                                 adg-stroke-private.h \
51                                 adg-style-private.h \
52                                 adg-title-block-private.h \
53                                 adg-toy-text-private.h
54 built_private_h_sources= 
55 c_sources=                      adg-adim.c \
56                                 adg-arrow-style.c \
57                                 adg-canvas.c \
58                                 adg-container.c \
59                                 adg-context.c \
60                                 adg-dim.c \
61                                 adg-dim-style.c \
62                                 adg-entity.c \
63                                 adg-enums.c \
64                                 adg-font-style.c \
65                                 adg-ldim.c \
66                                 adg-line-style.c \
67                                 adg-matrix.c \
68                                 adg-model.c \
69                                 adg-pair.c \
70                                 adg-path.c \
71                                 adg-pattern.c \
72                                 adg-primitive.c \
73                                 adg-segment.c \
74                                 adg-stroke.c \
75                                 adg-style.c \
76                                 adg-title-block.c \
77                                 adg-toy-text.c \
78                                 adg-util.c
79 built_c_sources=                $(builddir)/adg-type-builtins.c
80 EXTRA_DIST=                     adg-type-builtins.c.template \
81                                 adg-type-builtins.h.template
82 if HAVE_GTK2
83 AM_CFLAGS+=                     @GTK2_CFLAGS@
84 AM_LDFLAGS+=                    @GTK2_LIBS@
85 h_sources+=                     adg-widget.h
86 private_h_sources+=             adg-widget-private.h
87 c_sources+=                     adg-widget.c
88 PATTERN+=                       /\/\* if GTK2 \*\//d;/\/\* endif GTK2 \*\//d;
90 else
92 AM_CFLAGS+=                     @GOBJECT2_CFLAGS@ \
93                                 @CAIRO_CFLAGS@
94 AM_LDFLAGS+=                    @GOBJECT2_LIBS@ \
95                                 @GTK2_LIBS@
96 PATTERN+=                       /\/\* if GTK2 \*\//,/\/\* endif GTK2 \*\//d;
98 endif
101 # targets
102 BUILT_SOURCES=                  $(built_h_sources)
103 CLEANFILES=                     $(built_h_sources) \
104                                 $(built_private_h_sources) \
105                                 $(built_c_sources)
107 libadg_includedir=              $(includedir)/adg
108 libadg_include_DATA=            $(h_sources) \
109                                 $(built_h_sources)
111 lib_LTLIBRARIES=                libadg.la
112 libadg_la_LDFLAGS=              -release @PACKAGE_VERSION@
113 libadg_la_SOURCES=              $(h_sources) \
114                                 $(private_h_sources) \
115                                 $(c_sources)
116 nodist_libadg_la_SOURCES=       $(built_h_sources) \
117                                 $(built_private_h_sources) \
118                                 $(built_c_sources)
119 libadg_la_LIBADD=               $(top_builddir)/cpml/libcpml.la
120 libadg_la_DEPENDENCIES=         $(top_builddir)/cpml/libcpml.la
123 adg-type-builtins.c: adg-type-builtins.c.template adg-enums.h
124         $(GLIB_MKENUMS) > $@
126 adg-type-builtins.h: adg-type-builtins.h.template adg-enums.h
127         $(GLIB_MKENUMS) > $@
129 # Regenerate the adg.h header file: forcing a dependency on config.log
130 # is an easy way to invalidate this file whenever a ./configure is recall
131 $(builddir)/adg.h: adg.h.in $(top_builddir)/config.log
132         rm -f $@.tmp
133         sed -e '$(PATTERN)' $< > $@.tmp
134         mv $@.tmp $@