-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
45 lines (36 loc) · 1.36 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
37
38
39
40
41
42
43
44
45
PROJECT_NAME := pac-build
DESTDIR :=
PREFIX := /usr
BINDIR := $(PREFIX)/bin
SYSCONFDIR := /etc
VARDIR := /var/pac
DATADIR := $(PREFIX)/share/$(PROJECT_NAME)
SCRIPTFILES = pac-build etc/pac-build.conf
DATAFILES = library/*.sh
.PHONY: install install-program install-config clean
all: $(SCRIPTFILES)
pac-build: pac-build.in
sed -e 's@^libdir=.*@libdir=$(DATADIR)@' \
-e '/^mydir=.*library$$/d' \
pac-build.in \
> pac-build
etc/pac-build.conf: etc/pac-build.conf.in
sed -e 's@%%VARDIR%%@$(VARDIR)@g' [email protected] > $@
install: install-program install-config
install-program:
install -dm755 "$(DESTDIR)$(BINDIR)"
install -m755 pac-build "$(DESTDIR)$(BINDIR)/pac-build"
install -dm755 "$(DESTDIR)$(DATADIR)"
install -m644 $(DATAFILES) "$(DESTDIR)$(DATADIR)/"
install -dm755 "$(DESTDIR)$(VARDIR)/scripts"
install -m755 scripts/bashrc "$(DESTDIR)$(VARDIR)/scripts/bashrc"
install -m755 scripts/setup_root \
"$(DESTDIR)$(VARDIR)/scripts/setup_root"
install -m755 scripts/prepare_root \
"$(DESTDIR)$(VARDIR)/scripts/prepare_root"
install-config:
install -dm755 "$(DESTDIR)$(SYSCONFDIR)"
install -m644 etc/pac-build.conf \
"$(DESTDIR)$(SYSCONFDIR)/pac-build.conf"
clean:
rm $(SCRIPTFILES)