]>
Commit | Line | Data |
---|---|---|
e9519a39 | 1 | VERSION=013 |
65673832 | 2 | GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8) |
7323a621 | 3 | |
13d942e1 LA |
4 | prefix ?= /usr |
5 | datadir ?= ${prefix}/share | |
6 | pkglibdir ?= ${datadir}/dracut | |
7 | sysconfdir ?= ${prefix}/etc | |
8 | sbindir ?= ${prefix}/sbin | |
9 | mandir ?= ${prefix}/share/man | |
59615e06 | 10 | |
cdc8d9c4 | 11 | manpages = dracut.8 dracut.kernel.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8 |
5cf5569d | 12 | |
0e6a94b3 | 13 | .PHONY: install clean archive rpm testimage test all check AUTHORS doc |
c4da2407 | 14 | |
0e6a94b3 HH |
15 | doc: $(manpages) dracut.html |
16 | all: syncheck | |
cdc8d9c4 HH |
17 | |
18 | %: %.xml | |
19 | xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $< | |
533cd778 | 20 | |
2d9f5858 | 21 | dracut.html: dracut.xml $(manpages) |
1b4a9d8a HH |
22 | xsltproc -o dracut.html --xinclude -nonet \ |
23 | --stringparam draft.mode yes \ | |
24 | --stringparam html.stylesheet http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \ | |
498a1312 | 25 | http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml |
2d9f5858 | 26 | |
0e6a94b3 | 27 | install: doc |
59615e06 HH |
28 | mkdir -p $(DESTDIR)$(pkglibdir) |
29 | mkdir -p $(DESTDIR)$(sbindir) | |
30 | mkdir -p $(DESTDIR)$(sysconfdir) | |
31 | mkdir -p $(DESTDIR)$(pkglibdir)/modules.d | |
cdc8d9c4 | 32 | mkdir -p $(DESTDIR)$(mandir)/man{5,7,8} |
59615e06 | 33 | install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut |
a6f8c083 | 34 | install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline |
5494f08c | 35 | install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages |
63d8d27b HH |
36 | install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(sbindir)/mkinitrd |
37 | install -m 0755 lsinitrd $(DESTDIR)$(sbindir)/lsinitrd | |
59615e06 | 38 | install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf |
2c2c4580 | 39 | mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d |
59615e06 | 40 | install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions |
f709fa43 | 41 | install -m 0755 dracut-logger $(DESTDIR)$(pkglibdir)/dracut-logger |
59615e06 | 42 | cp -arx modules.d $(DESTDIR)$(pkglibdir) |
11e4b916 | 43 | install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8 |
66e45737 HH |
44 | install -m 0644 dracut-catimages.8 $(DESTDIR)$(mandir)/man8 |
45 | install -m 0644 dracut-gencmdline.8 $(DESTDIR)$(mandir)/man8 | |
6cc96b35 | 46 | install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5 |
5bb59e42 | 47 | install -m 0644 dracut.kernel.7 $(DESTDIR)$(mandir)/man7 |
834f6145 | 48 | |
533cd778 | 49 | clean: |
5150d44a AŻ |
50 | $(RM) *~ |
51 | $(RM) */*~ | |
52 | $(RM) */*/*~ | |
5150d44a AŻ |
53 | $(RM) test-*.img |
54 | $(RM) dracut-*.rpm dracut-*.tar.bz2 | |
2d9f5858 | 55 | $(RM) $(manpages) dracut.html |
5150d44a | 56 | $(MAKE) -C test clean |
533cd778 | 57 | |
6b2a2be3 HH |
58 | archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2 |
59 | ||
b4fbdbbe | 60 | dist: dracut-$(VERSION).tar.gz |
f1bbaa64 HH |
61 | |
62 | dracut-$(VERSION).tar.bz2: | |
63 | git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2 | |
64 | ||
b4fbdbbe HH |
65 | dracut-$(VERSION).tar.gz: |
66 | git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |gzip > dracut-$(VERSION).tar.gz | |
67 | ||
0e6a94b3 HH |
68 | rpm: dracut-$(VERSION).tar.bz2 |
69 | mkdir -p rpmbuild | |
70 | cp dracut-$(VERSION).tar.bz2 rpmbuild | |
71 | cd rpmbuild; ../git2spec.pl $(VERSION) < ../dracut.spec > dracut.spec; \ | |
72 | rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" \ | |
73 | --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" \ | |
e7b87742 HH |
74 | --define "_rpmdir $$PWD" -ba dracut.spec && \ |
75 | ( cd ..; mv rpmbuild/noarch/*.rpm .; mv rpmbuild/*.src.rpm .;rm -fr rpmbuild; ls *.rpm ) | |
ccd71eeb | 76 | |
da22a021 HH |
77 | syncheck: |
78 | @ret=0;for i in dracut-logger modules.d/99base/init modules.d/*/*.sh; do \ | |
440a4cc2 | 79 | [ "$${i##*/}" = "module-setup.sh" ] && continue; \ |
da22a021 | 80 | [ "$${i##*/}" = "caps.sh" ] && continue; \ |
5cb6c761 HH |
81 | dash -n "$$i" ; ret=$$(($$ret+$$?)); \ |
82 | done;exit $$ret | |
da22a021 HH |
83 | @ret=0;for i in dracut modules.d/02caps/caps.sh modules.d/*/module-setup.sh; do \ |
84 | bash -n "$$i" ; ret=$$(($$ret+$$?)); \ | |
85 | done;exit $$ret | |
86 | ||
87 | check: all syncheck | |
5150d44a | 88 | $(MAKE) -C test check |
5cb6c761 | 89 | |
2f525c49 | 90 | testimage: all |
f4da8073 | 91 | ./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r) |
8ac8d68a | 92 | @echo wrote test-$(shell uname -r).img |
33ee031c HH |
93 | |
94 | testimages: all | |
95 | ./dracut -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r) | |
96 | @echo wrote test-$(shell uname -r).img | |
97 | ./dracut -l -a debug --no-kernel -f test-dracut.img $(shell uname -r) | |
98 | @echo wrote test-dracut.img | |
6cc96b35 | 99 | |
bdccc34e HH |
100 | hostimage: all |
101 | ./dracut -H -l -a debug -f test-$(shell uname -r).img $(shell uname -r) | |
102 | @echo wrote test-$(shell uname -r).img | |
33ee031c | 103 | |
3f793c91 HH |
104 | AUTHORS: |
105 | git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS |