setnet/Makefile

28 lines
932 B
Makefile

DESTDIR ?=
PREFIX ?= /usr
SYSCONFDIR ?= /etc
MANDIR ?= $(PREFIX)/share/man
NAME=setnet
DHCPC=dhclient
all:
@printf "doc \t Compress manual pages and generate HTML files\n"
@printf "install \t Installs $(NAME) and associated configs/manpages into the system\n"
@printf "uninstall \t Removes $(NAME) and associated configs/manpages from the system\n"
doc: setnet.8
gzip -c setnet.8 > setnet.8.gz
groff -m mdoc -T html setnet.8 > setnet.8.html
install:
install -m0644 setnetrc $(DESTDIR)$(SYSCONFDIR)/setnetrc
install -m0755 setnet-$(DHCPC) $(DESTDIR)$(PREFIX)/bin/setnet
install -m0644 setnet.8.gz $(DESTDIR)$(MANDIR)/man8/setnet.8.gz
install -m0644 wpa_setnet.conf $(DESTDIR)$(SYSCONFDIR)/wpa_supplicant/wpa_setnet.conf
uninstall:
rm -v $(DESTDIR)$(SYSCONFDIR)/setnetrc
rm -v $(DESTDIR)$(PREFIX)/bin/setnet
rm -v $(DESTDIR)$(MANDIR)/man8/setnet.8.gz
rm -v $(DESTDIR)$(SYSCONFDIR)/wpa_supplicant/wpa_setnet.conf