summaryrefslogtreecommitdiff
path: root/src/ui/Makefile.am
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/Makefile.am')
-rw-r--r--src/ui/Makefile.am44
1 files changed, 42 insertions, 2 deletions
diff --git a/src/ui/Makefile.am b/src/ui/Makefile.am
index e66cfe6..623b66d 100644
--- a/src/ui/Makefile.am
+++ b/src/ui/Makefile.am
@@ -32,19 +32,59 @@ libexec_PROGRAMS += %reldir%/disfluid-gui
AM_VALAFLAGS += --pkg=gio-2.0
-%canon_reldir%_disfluid_gui_SOURCES = \
+%canon_reldir%_disfluid_gui_VALASOURCES = \
%reldir%/main.vala \
%reldir%/settings.vala
+%canon_reldir%_disfluid_gui_SOURCES = \
+ $(%canon_reldir%_disfluid_gui_VALASOURCES:.vala=.c)
+
%canon_reldir%_disfluid_gui_CFLAGS = \
$(AM_CFLAGS) \
$(GLIB_CFLAGS) \
$(GOBJECT_CFLAGS) \
$(GIO_CFLAGS) \
- -include config.h
+ -DGETTEXT_PACKAGE=PACKAGE
%canon_reldir%_disfluid_gui_LDADD = \
$(GLIB_LIBS) \
$(GOBJECT_LIBS) \
$(GIO_LIBS) \
$(lib_LTLIBRARIES)
+
+EXTRA_DIST += \
+ $(%canon_reldir%_disfluid_gui_VALASOURCES) \
+ %reldir%/disfluid-gui-valasources.stamp
+
+$(srcdir)/%reldir%/disfluid-gui-valasources.stamp: $(%canon_reldir%_disfluid_gui_VALASOURCES) $(dist_vapi_DATA)
+ $(AM_V_at)rm -f $@ && echo stamp > $@-t
+ $(AM_V_VALAC)$(VALAC) $(AM_VALAFLAGS) $(VALAFLAGS) -C $^
+ $(AM_V_at)for source in $^; do case $$source in *.vala) generated=$$(echo "$$source" | sed 's/\.vala$$/.c/'); (echo '#ifdef HAVE_CONFIG_H' ; echo '#include <config.h>' echo '#endif' ; cat $$generated) > $$generated-t ; mv $$generated-t $$generated ;; esac done
+ $(AM_V_at)mv -f $@-t $@
+
+## This rule is adapted from the Automake FAQ:
+$(%canon_reldir%_disfluid_gui_VALASOURCES:.vala=.c): %reldir%/disfluid-gui-valasources.stamp
+## Recover from the removal of $(srcdir)/$@
+ @dry=; for f in x $$MAKEFLAGS; do \
+ case $$f in \
+ *=*|--*);; \
+ *n*) dry=:;; \
+ esac; \
+ done; \
+ if test -f $(srcdir)/$@; then :; else \
+ $$dry trap 'rm -rf $(srcdir)/%reldir%/disfluid-gui-valasources.lock $<' 1 2 13 15; \
+ if $$dry mkdir $(srcdir)/%reldir%/disfluid-gui-valasources.lock 2>/dev/null; then \
+## This code is being executed by the first process.
+ $$dry rm -f $<; \
+ $(MAKE) $(AM_MAKEFLAGS) $<; \
+ $$dry rmdir $(srcdir)/%reldir%/disfluid-gui-valasources.lock; \
+ else \
+## This code is being executed by the follower processes.
+## Wait until the first process is done.
+ while test -d $(srcdir)/%reldir%/disfluid-gui-valasources.lock && test -z "$$dry"; do \
+ sleep 1; \
+ done; \
+## Succeed if and only if the first process succeeded.
+ $$dry test -f $<; exit $$?; \
+ fi; \
+ fi