forked from awilliam/mdevctl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
36 lines (31 loc) · 1.14 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
PREFIX=/usr
UDEVDIR=$(shell pkg-config --variable=udevdir udev)
UNITDIR=$(shell pkg-config --variable=systemdsystemunitdir systemd)
SBINDIR=$(PREFIX)/sbin
LIBEXECDIR=$(PREFIX)/libexec
CONFDIR=/etc/mdev.d
NAME=mdevctl
VERSION=0.$(shell git rev-list --count HEAD)
COMMIT=$(shell git rev-list --max-count 1 HEAD)
NVFMT=$(NAME)-$(VERSION)-$(COMMIT)
files: mdevctl.sbin mdevctl.libexec [email protected] 60-persistent-mdev.rules \
Makefile COPYING README
archive: files tag
git archive --prefix=$(NVFMT)/ HEAD > $(NVFMT).tar
gzip -f -9 $(NVFMT).tar
install:
mkdir -p $(DESTDIR)/$(CONFDIR)
mkdir -p $(DESTDIR)/$(UDEVDIR)/rules.d/
install -m 644 60-persistent-mdev.rules $(DESTDIR)/$(UDEVDIR)/rules.d/
mkdir -p $(DESTDIR)/$(UNITDIR)
install -m 644 [email protected] $(DESTDIR)/$(UNITDIR)/
mkdir -p $(DESTDIR)/$(SBINDIR)
install -m 755 mdevctl.sbin $(DESTDIR)/$(SBINDIR)/mdevctl
mkdir -p $(DESTDIR)/$(LIBEXECDIR)
install -m 755 mdevctl.libexec $(DESTDIR)/$(LIBEXECDIR)/mdevctl
systemctl daemon-reload
udevadm control --reload-rules
clean:
rm -f mdevctl.spec *.src.rpm noarch/*.rpm *.tar.gz
tag:
git tag -l $(VERSION) | grep -q $(VERSION) || git tag $(VERSION)