-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathMakefile
33 lines (26 loc) · 1.02 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
PREFIX ?= /usr/local
DESTDIR ?= /
man:
@echo "Generating manpage..."
@txt2tags -o man/xdgmenumaker.1 man/xdgmenumaker.t2t || \
echo "WARNING: txt2tags is not installed. The xdgmenumaker manpage will not be created."
install:
install -d -m 755 $(DESTDIR)/$(PREFIX)/bin
install -d -m 755 $(DESTDIR)/$(PREFIX)/share/desktop-directories
install -m 644 desktop-directories/* $(DESTDIR)/$(PREFIX)/share/desktop-directories
if [ -f man/xdgmenumaker.1 ]; then \
install -d -m 755 $(DESTDIR)/$(PREFIX)/share/man/man1; \
install -m 644 man/xdgmenumaker.1 $(DESTDIR)/$(PREFIX)/share/man/man1/; \
fi
sed "s|^prefix = 'not_set'|prefix = '$(PREFIX)'|" src/xdgmenumaker > $(DESTDIR)/$(PREFIX)/bin/xdgmenumaker
chmod 755 $(DESTDIR)/$(PREFIX)/bin/xdgmenumaker
clean: test-clean
rm -f man/xdgmenumaker.1
test:
$(MAKE) -C tests/
test-clean:
$(MAKE) clean -C tests/
uninstall:
rm -f $(DESTDIR)/$(PREFIX)/bin/xdgmenumaker
rm -f $(DESTDIR)/$(PREFIX)/share/desktop-directories/xdgmenumaker*
.PHONY: man clean install uninstall test test-clean