-
Notifications
You must be signed in to change notification settings - Fork 37
/
Makefile
37 lines (30 loc) · 989 Bytes
/
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
PKGNAME := mons
PKGDESC := POSIX Shell script to quickly manage 2-monitors display.
SCRIPT = $(PKGNAME).sh
MANPAGE = $(PKGNAME).1.gz
PREFIX = /usr
LICENSEDIR = $(DESTDIR)$(PREFIX)/share/licenses/$(PKGNAME)
MANDIR = $(DESTDIR)$(PREFIX)/share/man/man1
BINDIR = $(DESTDIR)$(PREFIX)/bin
LIBDIR = $(DESTDIR)$(PREFIX)/lib/libshlist
LIB = libshlist/liblist.sh
install: $(LIB) $(MANPAGE)
mkdir -p $(LIBDIR)
mkdir -p $(LICENSEDIR)
mkdir -p $(MANDIR)
mkdir -p $(BINDIR)
chmod 644 $(LIB)
chmod 644 LICENSE
chmod 644 $(MANPAGE)
chmod 755 $(SCRIPT)
cp $(LIB) $(LIBDIR)/liblist.sh
cp LICENSE $(LICENSEDIR)/LICENSE
cp $(MANPAGE) $(MANDIR)/$(MANPAGE)
cp $(SCRIPT) $(BINDIR)/$(PKGNAME)
sed -i -e "s#%LIBDIR%#$(LIBDIR)#" $(BINDIR)/$(PKGNAME)
$(MANPAGE):
help2man -N -n "$(PKGDESC)" -h -h -v -v ./$(SCRIPT) | gzip - > $@
uninstall:
$(RM) -r $(LICENSEDIR) $(LIBDIR)
$(RM) $(MANDIR)/$(MANPAGE) $(BINDIR)/$(PKGNAME)
.PHONY: install uninstall