dracut.kernel.7: updated to latest changes in 90crypt
[dracut.git] / Makefile
blob9dbe9816fa3ff752dbff49f1b21fafc692e561ba
1 VERSION=008
2 GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
4 prefix ?= /usr
5 datadir ?= ${prefix}/share
6 pkglibdir ?= ${datadir}/dracut
7 sysconfdir ?= ${prefix}/etc
8 sbindir ?= ${prefix}/sbin
9 mandir ?= ${prefix}/share/man
11 manpages = dracut.8 dracut.kernel.7 dracut.conf.5 dracut-catimages.8 dracut-gencmdline.8
13 .PHONY: install clean archive rpm testimage test all check AUTHORS
15 ifeq (1,${WITH_SWITCH_ROOT})
16 targets = modules.d/99base/switch_root
17 else
18 targets =
19 endif
21 all: $(targets) $(manpages) dracut.html
23 %: %.xml
24 xsltproc -o $@ -nonet http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl $<
26 dracut.html: dracut.xml $(manpages)
27 xsltproc -o dracut.html --xinclude -nonet \
28 --stringparam draft.mode yes \
29 --stringparam html.stylesheet http://docs.redhat.com/docs/en-US/Common_Content/css/default.css \
30 http://docbook.sourceforge.net/release/xsl/current/xhtml/docbook.xsl dracut.xml
32 modules.d/99base/switch_root: switch_root.c
33 gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
35 install:
36 mkdir -p $(DESTDIR)$(pkglibdir)
37 mkdir -p $(DESTDIR)$(sbindir)
38 mkdir -p $(DESTDIR)$(sysconfdir)
39 mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
40 mkdir -p $(DESTDIR)$(mandir)/man{5,7,8}
41 install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
42 install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline
43 install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages
44 install -m 0755 mkinitrd-dracut.sh $(DESTDIR)$(sbindir)/mkinitrd
45 install -m 0755 lsinitrd $(DESTDIR)$(sbindir)/lsinitrd
46 ifeq (1,${WITH_SWITCH_ROOT})
47 install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
48 endif
49 install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
50 mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
51 install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
52 cp -arx modules.d $(DESTDIR)$(pkglibdir)
53 install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
54 install -m 0644 dracut-catimages.8 $(DESTDIR)$(mandir)/man8
55 install -m 0644 dracut-gencmdline.8 $(DESTDIR)$(mandir)/man8
56 install -m 0644 dracut.conf.5 $(DESTDIR)$(mandir)/man5
57 install -m 0644 dracut.kernel.7 $(DESTDIR)$(mandir)/man7
58 ifeq (1,${WITH_SWITCH_ROOT})
59 rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
60 endif
62 clean:
63 $(RM) *~
64 $(RM) */*~
65 $(RM) */*/*~
66 $(RM) modules.d/99base/switch_root
67 $(RM) test-*.img
68 $(RM) dracut-*.rpm dracut-*.tar.bz2
69 $(RM) $(manpages) dracut.html
70 $(MAKE) -C test clean
72 archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
74 dist: dracut-$(VERSION).tar.bz2
76 dracut-$(VERSION).tar.bz2:
77 git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
79 dracut-$(VERSION)-$(GITVERSION).tar.bz2:
80 git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
83 rpm: clean dracut-$(VERSION).tar.bz2
84 rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
85 rm -fr BUILD BUILDROOT
87 gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
88 echo "%define gittag $(GITVERSION)" > dracut.spec.git
89 cat dracut.spec >> dracut.spec.git
90 mv dracut.spec dracut.spec.bak
91 mv dracut.spec.git dracut.spec
92 rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec || :
93 mv dracut.spec.bak dracut.spec
94 rm -fr BUILD BUILDROOT
96 check: all
97 @ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
98 dash -n "$$i" ; ret=$$(($$ret+$$?)); \
99 done;exit $$ret
100 $(MAKE) -C test check
102 testimage: all
103 ./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
104 @echo wrote test-$(shell uname -r).img
106 testimages: all
107 ./dracut -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
108 @echo wrote test-$(shell uname -r).img
109 ./dracut -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
110 @echo wrote test-dracut.img
112 hostimage: all
113 ./dracut -H -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
114 @echo wrote test-$(shell uname -r).img
116 AUTHORS:
117 git shortlog --numbered --summary -e |while read a rest; do echo $$rest;done > AUTHORS