-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
126 lines (108 loc) · 3.16 KB
/
Makefile
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
# PACKAGE
#
# Copyright (C) 2016 Discreete Linux Team <info@discreete-linux.org>
#
###
# Standard-Variablen, die angepasst werden müssen
PYMODS =
BINFILES = emmc-disabler.py
USRBINFILES =
EXTENSIONS =
MENUFILES =
EXTRATARGETS =
EXTRAINSTALLS =
###
# Automatische Variablen
NAME = $(shell grep '^Package: ' debian/control | sed 's/^Package: //')
VERSION = $(shell grep '^Version: ' debian/control | sed 's/^Version: //')
PYTHON_VERSION = $(shell python -V 2>&1 | cut -f 2 -d ' ')
PYMINOR := $(shell echo $(PYTHON_VERSION) | cut -f 2 -d '.')
PYMAJOR := $(shell echo $(PYTHON_VERSION) | cut -f 1 -d '.')
BINDIR = $(DESTDIR)/bin
USRBINDIR = $(DESTDIR)/usr/bin
MENUDIR = $(DESTDIR)/usr/share/applications
ICONDIR = $(DESTDIR)/usr/share/icons/gnome
EXTDIR = $(DESTDIR)/usr/share/nemo-python/extensions
LIBDIR = $(DESTDIR)/usr/lib/$(NAME)
LANGDIR = $(DESTDIR)/usr/share/locale
ifeq ($(PYMAJOR),3)
PYLIBDIR = $(DESTDIR)/usr/lib/python3/dist-packages
else
PYLIBDIR = $(DESTDIR)/usr/lib/python2.$(PYMINOR)/dist-packages
endif
ICONS = $(wildcard icons)
UIFILES = $(wildcard *.ui)
POFILES=$(wildcard *.po)
MOFILES=$(addprefix $(LANGDIR)/,$(POFILES:.po=/LC_MESSAGES/$(NAME).mo))
###
# Weitere lokale Variablen
###
# Standard-Rezepte
all: $(EXTRATARGETS)
clean:
rm -rf *.pyc
distclean:
rm -rf *.pyc *.gz $(EXTRATARGETS)
pot: $(BINFILES) $(USRBINFILES) $(UIFILES) $(EXTENSIONS) $(PYLIBS)
xgettext -L python -d $(NAME) -o $(NAME).pot \
--package-name=$(NAME) --package-version=$(VERSION) \
--msgid-bugs-address=info@discreete-linux.org $(BINFILES) $(USRBINFILES) \
$(EXTENSIONS) $(PYLIBS)
ifneq ($(UIFILES),)
xgettext -L Glade -d $(NAME) -j -o $(NAME).pot \
--package-name=$(NAME) --package-version=$(VERSION) \
--msgid-bugs-address=info@discreete-linux.org $(UIFILES)
endif
update-pot: $(NAME).pot
update-po: $(NAME).pot
for pofile in $(POFILES); do msgmerge -U --lang=$${pofile%.*} $$pofile $(NAME).pot; done
man: $(MANFILES)
ifneq ($(MANFILES),)
gzip -9 $(MANDIR)/$(MANFILES)
endif
install: install-bin install-extension install-icon install-lang install-lib install-ui install-usrbin install-usrsbin install-menu $(EXTRAINSTALLS)
install-bin: $(BINFILES)
ifneq ($(BINFILES),)
mkdir -p $(BINDIR)
install -m 0755 $(BINFILES) $(BINDIR)
endif
install-extension: $(EXTENSIONS)
ifneq ($(EXTENSIONS),)
mkdir -p $(EXTDIR)
install -m 0644 $(EXTENSIONS) $(EXTDIR)
endif
install-icon: $(ICONS)
ifneq ($(ICONS),)
mkdir -p $(ICONDIR)
cp -r $(ICONS)/* $(ICONDIR)
endif
install-lang: $(MOFILES)
$(LANGDIR)/%/LC_MESSAGES/$(NAME).mo: %.po
mkdir -p $(dir $@)
msgfmt -c -o $@ $*.po
install-lib: $(PYMODS)
ifneq ($(PYMODS),)
mkdir -p $(PYLIBDIR)
install -m 0644 $(PYMODS) $(PYLIBDIR)
endif
install-ui: $(UIFILES)
ifneq ($(UIFILES),)
mkdir -p $(LIBDIR)
install -m 0644 $(UIFILES) $(LIBDIR)
endif
install-usrbin: $(USRBINFILES)
ifneq ($(USRBINFILES),)
mkdir -p $(USRBINDIR)
install -m 0755 $(USRBINFILES) $(USRBINDIR)
endif
install-usrsbin: $(USRSBINFILES)
ifneq ($(USRSBINFILES),)
mkdir -p $(USRSBINDIR)
install -m 0755 $(USRSBINFILES) $(USRSBINDIR)
endif
install-menu: $(MENUFILES)
ifneq ($(MENUFILES),)
mkdir -p $(MENUDIR)
install -m 0755 $(MENUFILES) $(MENUDIR)
endif
.PHONY: all clean distclean install