Makefile 2.89 KB
Newer Older
Michael Terry's avatar
Michael Terry committed
1
# -*- Mode: Makefile; indent-tabs-mode: t; tab-width: 2 -*-
2 3
#
# This file is part of Déjà Dup.
4
# For copyright information, see AUTHORS.
5 6 7 8 9 10 11 12 13 14 15 16 17
#
# Déjà Dup is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Déjà Dup 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
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Déjà Dup.  If not, see <http://www.gnu.org/licenses/>.
18

19
all: configure
20
	ninja -C builddir
Michael Terry's avatar
Michael Terry committed
21

22
%:
23
	@[ "$@" = "Makefile" ] || ninja -C builddir $@
24

25
configure:
26 27
	@[ -f builddir/build.ninja ] || meson -Dprofile=Devel builddir

28
check: all
29
	LC_ALL=C.UTF-8 meson test -C builddir
30

Michael Terry's avatar
Michael Terry committed
31
clean distclean:
Michael Terry's avatar
Michael Terry committed
32
	rm -rf builddir parts stage prime *.snap
Michael Terry's avatar
Michael Terry committed
33

34
screenshots: all
35 36
	@gsettings set org.gnome.desktop.interface font-name 'Cantarell 11'
	@gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
Michael Terry's avatar
Michael Terry committed
37
	@gsettings set org.gnome.desktop.interface icon-theme 'Adwaita'
38
	@gsettings set org.gnome.desktop.wm.preferences theme 'Adwaita'
Michael Terry's avatar
Michael Terry committed
39
	@gsettings set org.gnome.DejaDup backend 'file'
40
	@sleep 5
41
	
42 43
	@mkdir -p ./builddir/screenshots
	@rm -f ./builddir/screenshots/*
44
	
Michael Terry's avatar
Michael Terry committed
45
	@./tests/shell-local "deja-dup" &
46
	@gnome-screenshot --window --delay 1 --file data/appdata/01-main.png
47
	@killall deja-dup
48
	
49
	@./tests/shell-local "deja-dup --backup" >/dev/null &
50
	@gnome-screenshot --window --delay 1 --file data/appdata/02-backup.png
51
	@killall deja-dup
52 53 54 55 56
	
	@gsettings reset org.gnome.desktop.interface font-name
	@gsettings reset org.gnome.desktop.interface gtk-theme
	@gsettings reset org.gnome.desktop.interface icon-theme
	@gsettings reset org.gnome.desktop.wm.preferences theme
Michael Terry's avatar
Michael Terry committed
57
	@gsettings reset org.gnome.DejaDup backend
58 59
	
	@eog data/appdata
60

61
pot: configure
62
	ninja -C builddir deja-dup-pot help-org.gnome.DejaDup-pot
Michael Terry's avatar
Michael Terry committed
63

Michael Terry's avatar
Michael Terry committed
64
copy-po: pot
65 66 67 68 69
	mkdir -p builddir
	rm -r builddir/translations
	bzr co --lightweight lp:~mterry/deja-dup/translations builddir/translations
	cp -a builddir/translations/po/*.po po
	for po in builddir/translations/deja-dup/help/*.po; do \
Michael Terry's avatar
Michael Terry committed
70 71
		mkdir -p deja-dup/help/$$(basename $$po .po); \
		cp -a $$po deja-dup/help/$$(basename $$po .po)/; \
72
	done
Michael Terry's avatar
Michael Terry committed
73 74
	git add po/*.po
	git add deja-dup/help/*/*.po
75

Michael Terry's avatar
Michael Terry committed
76 77 78
deb:
	DEB_BUILD_OPTIONS=nocheck debuild

79
flatpak:
80 81 82 83 84 85
	flatpak-builder --repo=$(HOME)/repo \
	                --force-clean \
	                --state-dir=builddir/.flatpak-builder \
	                builddir/flatpak \
	                flatpak/org.gnome.DejaDupDevel.yaml
	flatpak update --user -y org.gnome.DejaDupDevel
86

Michael Terry's avatar
Michael Terry committed
87 88 89 90 91 92
snap:
	rm -f *.snap
	snapcraft snap
	snap install ./*.snap --dangerous --classic

.PHONY: configure clean all copy-po check screenshots flatpak snap