aboutsummaryrefslogtreecommitdiff
path: root/makefile
blob: 8beeec461acdc2e0d973ee766958c4c402841032 (plain)
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
.POSIX:
.PHONY: FORCE

NAME = dppt
PREFIX = /usr/local
MANPREFIX = $(PREFIX)/share/man

CORE_PATH = $(DESTDIR)$(PREFIX)/lib/$(NAME)-core

all: FORCE

install: FORCE
	mkdir -p $(DESTDIR)$(PREFIX)/bin
	cp $(NAME) $(DESTDIR)$(PREFIX)/bin/$(NAME)
	sed 's#\(\<core_path\>=\).*#\1"$(CORE_PATH)"#' -i $(DESTDIR)$(PREFIX)/bin/$(NAME)
	sed 's#\(\<progname\>=\).*#\1"$(NAME)"#' -i $(DESTDIR)$(PREFIX)/bin/$(NAME)
	mkdir -p $(CORE_PATH)
	cp -r core/. $(CORE_PATH)/
	mkdir -p $(DESTDIR)$(MANPREFIX)/man1
	cp -r man/$(NAME).1 $(DESTDIR)$(MANPREFIX)/man1/

uninstall: FORCE
	rm -f $(DESTDIR)$(PREFIX)/bin/$(NAME)
	rm -f $(DESTDIR)$(MANPREFIX)/man1/$(NAME).1
	rm -rf $(CORE_PATH)