forked from rhboot/efivar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (54 loc) · 1.81 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
TOPDIR = $(shell echo $$PWD)
include $(TOPDIR)/Make.version
include $(TOPDIR)/Make.rules
include $(TOPDIR)/Make.defaults
SUBDIRS := src docs
all : | efivar.spec Make.version
all :
@set -e ; for x in $(SUBDIRS) ; do \
$(MAKE) -C $$x $@ ; \
done
install :
@set -e ; for x in $(SUBDIRS) ; do \
$(MAKE) -C $$x $@ ; \
done
efivar efivar-static :
$(MAKE) -C src $@
$(SUBDIRS) :
$(MAKE) -C $@
brick : all
@set -e ; for x in $(SUBDIRS) ; do $(MAKE) -C $${x} test ; done
a :
@if [ $${EUID} != 0 ]; then \
echo no 1>&2 ; \
exit 1 ; \
fi
.PHONY: $(SUBDIRS) a brick
efivar.spec : | Makefile Make.version
clean :
@set -e ; for x in $(SUBDIRS) ; do \
$(MAKE) -C $$x $@ ; \
done
@rm -vf efivar.spec
GITTAG = $(VERSION)
test-archive: efivar.spec
@rm -rf /tmp/efivar-$(VERSION) /tmp/efivar-$(VERSION)-tmp
@mkdir -p /tmp/efivar-$(VERSION)-tmp
@git archive --format=tar $(shell git branch | awk '/^*/ { print $$2 }') | ( cd /tmp/efivar-$(VERSION)-tmp/ ; tar x )
@git diff | ( cd /tmp/efivar-$(VERSION)-tmp/ ; patch -s -p1 -b -z .gitdiff )
@mv /tmp/efivar-$(VERSION)-tmp/ /tmp/efivar-$(VERSION)/
@cp efivar.spec /tmp/efivar-$(VERSION)/
@dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/efivar-$(VERSION).tar.bz2 efivar-$(VERSION)
@rm -rf /tmp/efivar-$(VERSION)
@echo "The archive is in efivar-$(VERSION).tar.bz2"
tag:
git tag -s $(GITTAG) refs/heads/master
archive: tag efivar.spec
@rm -rf /tmp/efivar-$(VERSION) /tmp/efivar-$(VERSION)-tmp
@mkdir -p /tmp/efivar-$(VERSION)-tmp
@git archive --format=tar $(GITTAG) | ( cd /tmp/efivar-$(VERSION)-tmp/ ; tar x )
@mv /tmp/efivar-$(VERSION)-tmp/ /tmp/efivar-$(VERSION)/
@cp efivar.spec /tmp/efivar-$(VERSION)/
@dir=$$PWD; cd /tmp; tar -c --bzip2 -f $$dir/efivar-$(VERSION).tar.bz2 efivar-$(VERSION)
@rm -rf /tmp/efivar-$(VERSION)
@echo "The archive is in efivar-$(VERSION).tar.bz2"