forked from nefelim4ag/systemd-swap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
55 lines (37 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
PREFIX ?= /
FEDORA_VERSION ?= f28
default: help
LIB_T := $(PREFIX)/var/lib/systemd-swap
ETCD_T := $(PREFIX)/etc/systemd/swap.conf.d/
BIN_T := $(PREFIX)/usr/bin/systemd-swap
SVC_T := $(PREFIX)/lib/systemd/system/systemd-swap.service
CNF_T := $(PREFIX)/etc/systemd/swap.conf
$(LIB_T):
mkdir -p $@
$(ETCD_T):
mkdir -p $@
dirs: $(LIB_T) $(ETCD_T)
$(BIN_T): systemd-swap
install -Dm755 $< $@
$(SVC_T): systemd-swap.service
install -Dm644 $< $@
$(CNF_T): swap.conf
install -bDm644 -S .old $< $@
files: $(BIN_T) $(SVC_T) $(CNF_T)
install: ## Install systemd-swap
install: dirs files
uninstall: ## Delete systemd-swap (stop systemd-swap first)
uninstall:
test ! -f /run/systemd/swap/swap.conf
@rm -v $(BIN_T)
@rm -v $(SVC_T)
@rm -v $(CNF_T)
rm -r $(PREFIX)/var/lib/systemd-swap
deb: ## Create debian package
deb: package.sh
./$< debian
rpm: ## Create fedora package
rpm: package.sh
./$< fedora $(FEDORA_VERSION)
help: ## Show help
@fgrep -h "##" $(MAKEFILE_LIST) | fgrep -v fgrep | sed -e 's/\\$$//' | sed -e 's/##/\t/'