-
Notifications
You must be signed in to change notification settings - Fork 17
/
Makefile
40 lines (31 loc) · 1.46 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
GIT2LOG := $(shell if [ -x ./git2log ] ; then echo ./git2log --update ; else echo true ; fi)
GITDEPS := $(shell [ -d .git ] && echo .git/HEAD .git/refs/heads .git/refs/tags)
VERSION := $(shell $(GIT2LOG) --version VERSION ; cat VERSION)
PREFIX := perl-Bootloader-$(VERSION)
SBINDIR ?= /usr/sbin
ETCDIR ?= /usr/etc
.PHONY: clean doc install test
all:
@echo "Choose target: clean, doc, install, test"
changelog: $(GITDEPS)
$(GIT2LOG) --changelog changelog
install:
@for bl in include grub2 grub2-efi systemd-boot u-boot; do install -m 755 -D -t $(DESTDIR)/usr/lib/bootloader/$$bl $$bl/* ; done
@install -D -m 755 pbl.sh $(DESTDIR)$(SBINDIR)/pbl
@perl -pi -e 's/0\.0/$(VERSION)/ if /VERSION ?=/' $(DESTDIR)$(SBINDIR)/pbl
@ln -snf pbl $(DESTDIR)$(SBINDIR)/update-bootloader
@ln -rsnf $(DESTDIR)$(SBINDIR)/pbl $(DESTDIR)/usr/lib/bootloader/bootloader_entry
@install -D -m 644 boot.readme $(DESTDIR)/usr/share/doc/packages/perl-Bootloader/boot.readme
@install -D -m 644 pbl.logrotate $(DESTDIR)$(ETCDIR)/logrotate.d/pbl
@install -D -m 755 kexec-bootloader $(DESTDIR)$(SBINDIR)/kexec-bootloader
@install -d -m 755 $(DESTDIR)/usr/share/man/man8
%.8: %_man.adoc
asciidoctor -b manpage -a version=$(VERSION) -a soversion=${MAJOR_VERSION} $<
doc: pbl.8 bootloader_entry.8 update-bootloader.8 kexec-bootloader.8
test:
@./run_tests
clean:
rm -rf package
rm -f VERSION changelog *.8 *~ */*~ */*/*~
rm -f tests/*/*.{bash,ksh,busybox} tests/testresults*.diff
rm -rf tests/{real_,}root