summaryrefslogtreecommitdiff
path: root/src/ui/Makefile.am
blob: 623b66d1830d5e26ce4ce0ada2eeb568cc1af153 (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
# disfluid, implementation of the Solid specification
# Copyright (C) 2021  Vivien Kraus

# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.

# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <https://www.gnu.org/licenses/>.

uipkgdatadir = $(pkgdatadir)/ui
dist_uipkgdata_DATA = \
  %reldir%/client-widget.glade \
  %reldir%/account-widget.glade \
  %reldir%/accounts-widget.glade \
  %reldir%/authorization-prompt.glade \
  %reldir%/main-window.glade \
  %reldir%/error-page.glade \
  %reldir%/link-widget.glade \
  %reldir%/loaded-page.glade \
  %reldir%/loading-page.glade \
  %reldir%/new-page.glade \
  %reldir%/updated-page.glade

libexec_PROGRAMS += %reldir%/disfluid-gui

AM_VALAFLAGS += --pkg=gio-2.0

%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) \
  -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