-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
36 lines (28 loc) · 1.29 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
PREFIX ?= /usr
DESTDIR ?=
BINDIR ?= $(PREFIX)/bin
MANDIR ?= $(PREFIX)/share/man
DOCDIR ?= $(PREFIX)/share/doc
APPDIR ?= $(PREFIX)/share/izulu
LANGDIR_DE ?= $(PREFIX)/share/locale/de/LC_MESSAGES
LANGDIR_EN ?= $(PREFIX)/share/locale/en/LC_MESSAGES
MANPAGES = doc/izulu.1.gz
LANGFILES = lang/de.mo lang/en.mo
.PHONY: install uninstall clean
doc/%.1.gz: doc/%.1
gzip -c $< > doc/$*.1.gz
lang/%.mo: lang/%.po
msgfmt $< -o lang/$*.mo
all: $(MANPAGES) $(LANGFILES)
install:
@install -d "$(DESTDIR)$(BINDIR)" "$(DESTDIR)$(APPDIR)" "$(DESTDIR)$(APPDIR)/weathericons" "$(DESTDIR)$(MANDIR)/man1" "$(DESTDIR)$(DOCDIR)/izulu" "$(DESTDIR)$(LANGDIR_EN)" "$(DESTDIR)$(LANGDIR_DE)"
@install -m 0755 -v izulu "$(DESTDIR)$(BINDIR)/izulu"
@install -m 0644 -v gfx/weathericons/* "$(DESTDIR)$(APPDIR)/weathericons/"
@install -m 0644 -v gfx/gen_* "$(DESTDIR)$(APPDIR)/"
@install -m 0644 -v doc/izulu.1.gz "$(DESTDIR)$(MANDIR)/man1/izulu.1.gz"
@install -m 0644 -v lang/en.mo "$(DESTDIR)$(LANGDIR_EN)/izulu.mo"
@install -m 0644 -v lang/de.mo "$(DESTDIR)$(LANGDIR_DE)/izulu.mo"
clean:
@rm -vf $(MANPAGES) $(LANGFILES)
uninstall:
@rm -vf "$(DESTDIR)$(BINDIR)/izulu" "$(DESTDIR)$(MANDIR)/man1/izulu.1.gz" "$(DESTDIR)$(DOCDIR)/credits.txt" "$(DESTDIR)$(APPDIR)/*" "$(DESTDIR)$(LANGDIR_EN)/izulu.mo" "$(DESTDIR)$(LANGDIR_DE)/izulu.mo"