File: Makefile

package info (click to toggle)
thawab 4.1-2
  • links: PTS, VCS
  • area: non-free
  • in suites: bullseye, sid
  • size: 1,912 kB
  • sloc: python: 4,041; makefile: 134; sh: 33
file content (94 lines) | stat: -rw-r--r-- 3,599 bytes parent folder | download | duplicates (2)
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
91
92
93
94
APPNAME=thawab
DESTDIR?=/
DATADIR?=$(DESTDIR)/usr/share

SOURCES=$(wildcard *.desktop.in)
TARGETS=${SOURCES:.in=}

ECHO := echo
MAKE := make
PYTHON := python2
INSTALL := install
INTLTOOL_MERGE := intltool-merge
RM := $(shell which rm | egrep '/' | sed  's/\s//g')
GTK_UPDATE_ICON_CACHE := $(shell which gtk-update-icon-cache)
UPDATE_DESKTOP_DATABASE := $(shell which update-desktop-database)

all: $(TARGETS) icons

icons:
	@for i in 96 72 64 48 36 32 24 22 16; do \
		convert -background none $(APPNAME).svg -resize $${i}x$${i} $(APPNAME)-$${i}.png; \
	done
pos:
	$(MAKE) -C po all

install: locale
	@$(ECHO) "*** Installing..."
	@$(ECHO) "Copying: $(APPNAME).desktop -> $(DATADIR)/applications/"
	@$(INSTALL) -d $(DATADIR)/applications/
	@$(INSTALL) -d $(DATADIR)/$(APPNAME)/
	@$(INSTALL) -m 0644 $(APPNAME).desktop $(DATADIR)/applications/
	@$(INSTALL) -m 0644 -D $(APPNAME).svg $(DATADIR)/icons/hicolor/scalable/apps/$(APPNAME).svg;
	@for i in 96 72 64 48 36 32 24 22 16; do \
		$(INSTALL) -d $(DATADIR)/icons/hicolor/$${i}x$${i}/apps; \
		$(INSTALL) -m 0644 -D $(APPNAME)-$${i}.png $(DATADIR)/icons/hicolor/$${i}x$${i}/apps/$(APPNAME).png; \
	done
	@$(RM) -rf build

uninstall: 
	@$(ECHO) "*** Uninstalling..."
	@$(ECHO) "- Removing: $(DATADIR)/applications/$(APPNAME).desktop"
	@$(RM) -f $(DATADIR)/applications/$(APPNAME).desktop
	@$(ECHO) "- Removing: $(DESTDIR)/usr/share/locale/*/LC_MESSAGES/$(APPNAME).mo"
	@$(RM) -f $(DESTDIR)/usr/share/locale/*/LC_MESSAGES/$(APPNAME).mo
	@$(ECHO) "- Removing: $(DESTDIR)/usr/bin/$(APPNAME)"
	@$(RM) -f $(DESTDIR)/usr/bin/$(APPNAME)-gtk
	@$(RM) -f $(DESTDIR)/usr/bin/$(APPNAME)-server	
	@$(ECHO) "- Removing: $(DESTDIR)/usr/lib/python*/*-packages/Thawab"
	@$(RM) -rf $(DESTDIR)/usr/lib/python*/*-packages/Thawab
	@$(ECHO) "- Removing: $(DESTDIR)/usr/lib/python*/*-packages/$(APPNAME)*"
	@$(RM) -rf $(DESTDIR)/usr/lib/python*/*-packages/$(APPNAME)*
	@$(ECHO) "- Removing: $(DESTDIR)/usr/share/$(APPNAME)"
	@$(RM) -rf $(DESTDIR)/usr/share/$(APPNAME)
	
	@$(ECHO) "- Removing: $(DESTDIR)/usr/*/share/locale/*/LC_MESSAGES/$(APPNAME).mo"
	@$(RM) -f $(DESTDIR)/usr/*/share/locale/*/LC_MESSAGES/$(APPNAME).mo
	@$(ECHO) "- Removing: $(DESTDIR)/usr/*/bin/$(APPNAME)"
	@$(RM) -f $(DESTDIR)/usr/*/bin/$(APPNAME)-gtk
	@$(RM) -f $(DESTDIR)/usr/*/bin/$(APPNAME)-server	
	@$(ECHO) "- Removing: $(DESTDIR)/usr/*/lib/python*/*-packages/Thawab"
	@$(RM) -rf $(DESTDIR)/usr/*/lib/python*/*-packages/Thawab
	@$(ECHO) "- Removing: $(DESTDIR)/usr/*/lib/python*/*-packages/$(APPNAME)*"
	@$(RM) -rf $(DESTDIR)/usr/*/lib/python*/*-packages/$(APPNAME)*
	@$(ECHO) "- Removing: $(DESTDIR)/usr/*/share/$(APPNAME)"
	@$(RM) -rf $(DESTDIR)/usr/*/share/$(APPNAME)
	
	@$(RM) -f $(DATADIR)/icons/hicolor/scalable/apps/$(APPNAME).svg
	@$(RM) -f $(DATADIR)/icons/hicolor/*/apps/$(APPNAME).png;
	@$(DESTDIR)/$(UPDATE_DESKTOP_DATABASE) --quiet $(DATADIR)/applications  &> /dev/null || :
	@$(DESTDIR)/$(GTK_UPDATE_ICON_CACHE) --quiet $(DATADIR)/icons/hicolor &> /dev/null || :
	
%.desktop: %.desktop.in pos
	intltool-merge -d po $< $@

clean:
	@$(ECHO) "*** Cleaning..."
	@$(MAKE) -C po clean
	@$(ECHO) "- Removing: $(TARGETS)"
	@$(RM) -f $(TARGETS)
	@$(ECHO) "- Removing: locale build"
	@$(RM) -rf locale build
	@$(ECHO) "- Removing: *.pyc"
	@$(RM) -f *.pyc
	@$(ECHO) "- Removing: */*.pyc"
	@$(RM) -f */*.pyc
	@$(ECHO) "- Removing: $(APPNAME)-*.png"
	@$(RM) -f $(APPNAME)-*.png
	@$(ECHO) "- Removing Cache directories"
	@$(RM) -f thawab-data/user.db
	@$(RM) -rf thawab-data/cache
	@$(RM) -rf thawab-data/index
	@$(RM) -rf thawab-data/tmp
	@$(RM) -rf thawab-data/db
	@$(RM) -rf thawab-data/conf