Update called vala api.
[stuffkeeper.git] / src / Makefile.am
blob972ddaa027f1cc6adf6466087f175dbe44b894cb
1 NULL=
3 REVISION=$(shell git rev-parse --short master)
4 CONF_VERSION=0
5 -include Makefile.config
7 bin_PROGRAMS=stuffkeeper
9 stuffkeeper_GOBFILES=\
10         stuffkeeper-data-backend.gob \
11         stuffkeeper-data-boolean.gob \
12         stuffkeeper-data-date2.gob \
13         stuffkeeper-data-entry-config.gob \
14         stuffkeeper-data-entry.gob \
15         stuffkeeper-data-expander.gob \
16         stuffkeeper-data-image.gob \
17         stuffkeeper-data-item.gob \
18         stuffkeeper-data-item-search.gob \
19         stuffkeeper-data-label.gob \
20         stuffkeeper-data-link.gob \
21         stuffkeeper-data-list2.gob \
22         stuffkeeper-data-rating.gob \
23         stuffkeeper-data-schema.gob \
24         stuffkeeper-data-spinbutton-config.gob \
25         stuffkeeper-data-spinbutton.gob \
26         stuffkeeper-data-tag.gob \
27         stuffkeeper-data-taglist2.gob \
28         stuffkeeper-data-text.gob \
29         stuffkeeper-edit-schema.gob \
30         stuffkeeper-export-html.gob \
31         stuffkeeper-interface.gob \
32         stuffkeeper-item-view.gob \
33         stuffkeeper-item-window.gob \
34         stuffkeeper-plugin.gob \
35         stuffkeeper-plugin-manager.gob \
36         stuffkeeper-show-item.gob \
37         $(NULL)
39 stuffkeeper_GOBSOURCES=\
40         $(stuffkeeper_GOBFILES:.gob=.c) \
41         $(stuffkeeper_GOBFILES:.gob=.h) \
42         $(stuffkeeper_GOBFILES:.gob=-private.h) \
43         $(NULL)
45 stuffkeeper_GOBSTAMPS=\
46         $(stuffkeeper_GOBFILES:.gob=.gob.stamp) \
47         $(NULL)
48 stuffkeeper_VALAFILES=\
49     stuffkeeper-data-files.vala\
50         stuffkeeper-data-boolean-config.vala \
51         stuffkeeper-data-rating-config.vala \
52     stuffkeeper-multiple-item-view.vala \
53     stuffkeeper-data-image-config.vala \
54         $(NULL)
56 stuffkeeper_VALASOURCES=\
57         $(stuffkeeper_VALAFILES:.vala=.c) \
58         $(stuffkeeper_VALAFILES:.vala=.h) \
59         $(NULL)
61 stuffkeeper_VALASTAMPS=\
62         $(stuffkeeper_VALAFILES:.vala=.vala.stamp) \
63         $(NULL)
65 # These files should be compiled, but may _not_ be
66 # in the dist
68 nodist_stuffkeeper_SOURCES=\
69         $(stuffkeeper_GOBSOURCES) \
70         $(stuffkeeper_VALASOURCES) \
71         $(NULL)
73 # Sources that should be in the distribution 
75 stuffkeeper_SOURCES=\
76         main.c \
77         misc.c \
78         misc.h \
79         stuffkeeperglue.h \
80         $(NULL)
83 # Generated sources
85 BUILT_SOURCES=\
86         revision.h \
87         revisiont.h \
88         $(stuffkeeper_VALASTAMPS) \
89         $(stuffkeeper_GOBSTAMPS) \
90         $(NULL)
92 %.gob.stamp: %.gob
93         @GOB2@ --always-private-header $<
94         @touch $(top_builddir)/src/$@
96 #stuffkeeper.vala.stamp: $(stuffkeeper_VALAFILES)
97 #       @rm -f stuffkeeper.vala.tmp
98 #       @touch -f stuffkeeper.vala.tmp
99 #       @VALAC@ -C --vapidir=$(top_srcdir)/vala/ --pkg=gtk+-2.0 --pkg=glib-2.0 \
100 #               --pkg=gmodule-2.0 --pkg=stuffkeeper $^
101 #       @mv -f stuffkeeper.vala.tmp $@
103 %.vala.stamp: %.vala
104         $(info Building $^)
105         @VALAC@ -b $(top_builddir)/src/ -C --vapidir=$(top_srcdir)/vala/ --pkg=gtk+-2.0 --pkg=glib-2.0 --pkg=gio-2.0 \
106         --pkg=gmodule-2.0 --pkg=stuffkeeper --use-header $^ -H $(notdir $(^:.vala=.h))
107         @touch -f $@
111 # Handle the case where a vala file was deleted but not the stamp file
112 # This code avoids problems with parallel compilation by using an empty 
113 # directory as a lock mechanism
114 #$(stuffkeeper_VALASOURCES): stuffkeeper.vala.stamp
115 #       @if test -f $@; then :; else \
116 #               trap 'rm -rf $<.lock $<' 1 2 13 15; \
117 #               if mkdir $<.lock 2>/dev/null; then \
118 #                       rm -f $<; \
119 #                       $(MAKE) $(AM_MAKEFLAGS) $<; \
120 #                       rmdir $<.lock; \
121 #               else ;
122 #                       while test -d $<.lock; do sleep 1; done; \
123 #                       test -f $<; exit $$?; \
124 #               fi; \
125 #       fi
127 .PHONY: revisiont.h
128 revisiont.h:
129         @if test '$(REVISION)' != '$(CONF_VERSION)'; then\
130                 echo "Writing new Makefile.config file";\
131                 echo "CONF_VERSION=$(REVISION)" > Makefile.config;\
132         fi;
134 revision.h:
135                 echo "static char *revision = \"$(REVISION)""\"; "> revision.h;
137 LIBS= \
138         @glib_LIBS@\
139         @LIBS@ \
140         @gobject_LIBS@\
141         @gtk_LIBS@\
142         @gmodule_LIBS@\
143         @sqlite3_LIBS@\
144         @libxml_LIBS@\
145         @gthread_LIBS@\
146         @gio_LIBS@\
147     @unique_LIBS@\
148         $(NULL)
151 AM_LDFLAGS = \
152         @LDFLAGS@ \
153         $(NULL)
155 AM_CFLAGS = \
156         @CFLAGS@ \
157         @glib_CFLAGS@ \
158         @gobject_CFLAGS@ \
159         @gtk_CFLAGS@ \
160         @gmodule_CFLAGS@ \
161         @sqlite3_CFLAGS@ \
162         @libxml_CFLAGS@\
163         @gthread_CFLAGS@ \
164         @gio_CFLAGS@ \
165     @unique_CFLAGS@\
166         -DLOG_DOMAIN="\"StuffKeeper\""
167         -DPACKAGE_LIB_DIR=\""$(pkglibdir)"\" \
168         -Wall\
169         -DPIXMAP_PATH=\""$(pkgdatadir)"\" \
170         -DGLADE_PATH=\""$(pkgdatadir)"\" \
171         -DVERSION=\"@VERSION@\" \
172         $(NULL)
175 # Should be installed so plugins can be compiled
177 nodist_stuffkeeperinclude_HEADERS = \
178         stuffkeeperglue.h\
179         stuffkeeper-data-item.h\
180         stuffkeeper-data-schema.h\
181         stuffkeeper-data-backend.h\
182         stuffkeeper-data-tag.h\
183     stuffkeeper-item-window.h\
184         stuffkeeper-plugin.h\
185         stuffkeeper-interface.h\
186         stuffkeeper-data-item-search.h\
187         $(NULL)
189 stuffkeeperincludedir =$(includedir)/stuffkeeper/
192 # Extra files that should be shipped with the distributions.
193 # This include gob files and vala files 
195 EXTRA_DIST=\
196         $(stuffkeeper_GOBFILES)\
197         $(stuffkeeper_VALAFILES)\
198         $(NULL)
201 # Cleanup generated files
203 CLEANFILES=\
204         stuffkeeper.vala.stamp \
205         revision.h\
206         Makefile.config\
207         $(stuffkeeper_GOBSOURCES) \
208         $(stuffkeeper_VALASOURCES) \
209         $(stuffkeeper_GOBSTAMPS) \
210         $(stuffkeeper_VALASTAMPS)\
211         $(NULL)