Makefile 2.78 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 26
configure:
	@[ -f builddir/build.ninja ] || meson builddir
27 28

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

31
dist: configure screenshots pot
Michael Terry's avatar
Michael Terry committed
32 33 34
	rm -f builddir/meson-dist/*
	ninja -C builddir dist
	gpg --armor --sign --detach-sig builddir/meson-dist/deja-dup-*.tar.xz
35

Michael Terry's avatar
Michael Terry committed
36 37
clean distclean:
	rm -rf builddir
Michael Terry's avatar
Michael Terry committed
38

39 40 41
deb:
	DEB_BUILD_OPTIONS=nocheck debuild

42
screenshots: all
43 44 45 46 47
	@gsettings set org.gnome.desktop.interface cursor-theme 'Adwaita'
	@gsettings set org.gnome.desktop.interface font-name 'Cantarell 11'
	@gsettings set org.gnome.desktop.interface gtk-theme 'Adwaita'
	@gsettings set org.gnome.desktop.interface icon-theme 'gnome'
	@gsettings set org.gnome.desktop.wm.preferences theme 'Adwaita'
48
	@sleep 5
49
	
50 51
	@mkdir -p ./builddir/screenshots
	@rm -f ./builddir/screenshots/*
52
	@./tests/shell-local "deja-dup" &
53
	@gnome-screenshot --window --delay 1 --file ./builddir/screenshots/screenshot-1.png
54
	@killall deja-dup
55
	
56
	@./tests/shell-local "deja-dup --backup" >/dev/null &
57
	@gnome-screenshot --window --delay 1 --file ./builddir/screenshots/screenshot-2.png
58
	@killall deja-dup
59 60 61 62 63 64
	
	@gsettings reset org.gnome.desktop.interface cursor-theme
	@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
65

66
pot: configure
67
	ninja -C builddir deja-dup-pot help-org.gnome.DejaDup-pot
Michael Terry's avatar
Michael Terry committed
68

69 70 71
# call like 'make copy-po TD=path-to-translation-dir'
copy-po:
	test -d $(TD)
72
	cp -a $(TD)/po/*.po po
Michael Terry's avatar
Michael Terry committed
73
	for po in $(TD)/deja-dup/help/*.po; do \
Michael Terry's avatar
Michael Terry committed
74 75
		mkdir -p deja-dup/help/$$(basename $$po .po); \
		cp -a $$po deja-dup/help/$$(basename $$po .po)/; \
76
	done
Michael Terry's avatar
Michael Terry committed
77 78
	git add po/*.po
	git add deja-dup/help/*/*.po
79

80 81
flatpak:
	mkdir -p builddir
82 83 84
	rm -fr builddir/flatpak
	cd builddir && flatpak-builder --repo=$(HOME)/repo ./flatpak ../flatpak/org.gnome.DejaDup.json
	flatpak update --user org.gnome.DejaDup
85 86

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