2 GITVERSION
=$(shell [ -d .git
] && git rev-list
--abbrev-commit
-n
1 HEAD |cut
-b
1-8)
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
21 all: $(targets
) $(manpages
)
24 xsltproc
-o
$@
-nonet http
://docbook.sourceforge.net
/release
/xsl
/current
/manpages
/docbook.xsl
$<
26 modules.d
/99base
/switch_root
: switch_root.c
27 gcc
-D _GNU_SOURCE
-D
'PACKAGE_STRING="dracut"' -std
=gnu99
-fsigned-char
-g
-O2
-o modules.d
/99base
/switch_root switch_root.c
30 mkdir
-p
$(DESTDIR
)$(pkglibdir
)
31 mkdir
-p
$(DESTDIR
)$(sbindir
)
32 mkdir
-p
$(DESTDIR
)$(sysconfdir
)
33 mkdir
-p
$(DESTDIR
)$(pkglibdir
)/modules.d
34 mkdir
-p
$(DESTDIR
)$(mandir)/man
{5,7,8}
35 install -m
0755 dracut
$(DESTDIR
)$(sbindir
)/dracut
36 install -m
0755 dracut-gencmdline
$(DESTDIR
)$(sbindir
)/dracut-gencmdline
37 install -m
0755 dracut-catimages
$(DESTDIR
)$(sbindir
)/dracut-catimages
38 install -m
0755 mkinitrd-dracut.sh
$(DESTDIR
)$(sbindir
)/mkinitrd
39 install -m
0755 lsinitrd
$(DESTDIR
)$(sbindir
)/lsinitrd
40 ifeq (1,${WITH_SWITCH_ROOT})
41 install -m
0755 modules.d
/99base
/switch_root
$(DESTDIR
)$(sbindir
)/switch_root
43 install -m
0644 dracut.conf
$(DESTDIR
)$(sysconfdir
)/dracut.conf
44 mkdir
-p
$(DESTDIR
)$(sysconfdir
)/dracut.conf.d
45 install -m
0755 dracut-functions
$(DESTDIR
)$(pkglibdir
)/dracut-functions
46 cp
-arx modules.d
$(DESTDIR
)$(pkglibdir
)
47 install -m
0644 dracut
.8 $(DESTDIR
)$(mandir)/man8
48 install -m
0644 dracut-catimages
.8 $(DESTDIR
)$(mandir)/man8
49 install -m
0644 dracut-gencmdline
.8 $(DESTDIR
)$(mandir)/man8
50 install -m
0644 dracut.conf
.5 $(DESTDIR
)$(mandir)/man5
51 install -m
0644 dracut.kernel
.5 $(DESTDIR
)$(mandir)/man7
52 ifeq (1,${WITH_SWITCH_ROOT})
53 rm $(DESTDIR
)$(pkglibdir
)/modules.d
/99base
/switch_root
60 rm -f modules.d
/99base
/switch_root
62 rm -f dracut-
*.rpm dracut-
*.
tar.bz2
66 archive
: dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
68 dist: dracut-
$(VERSION
).
tar.bz2
70 dracut-
$(VERSION
).
tar.bz2
:
71 git archive
--format
=tar $(VERSION
) --prefix=dracut-
$(VERSION
)/ |bzip2
> dracut-
$(VERSION
).
tar.bz2
73 dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
:
74 git archive
--format
=tar HEAD
--prefix=dracut-
$(VERSION
)-$(GITVERSION
)/ |bzip2
> dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
77 rpm
: clean dracut-
$(VERSION
).
tar.bz2
78 rpmbuild
--define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
79 rm -fr BUILD BUILDROOT
81 gitrpm
: dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
82 echo
"%define gittag $(GITVERSION)" > dracut.spec.git
83 cat dracut.spec
>> dracut.spec.git
84 mv dracut.spec dracut.spec.bak
85 mv dracut.spec.git dracut.spec
86 rpmbuild
--define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec ||
:
87 mv dracut.spec.bak dracut.spec
88 rm -fr BUILD BUILDROOT
91 @ret
=0;for i in modules.d
/99base
/init modules.d
/*/*.sh
; do \
92 dash
-n
"$$i" ; ret
=$$(($$ret+$$?
)); \
97 .
/dracut
-l
-a debug
-f test-
$(shell uname
-r
).img
$(shell uname
-r
)
98 @echo wrote test-
$(shell uname
-r
).img
101 .
/dracut
-l
-a debug
--kernel-only
-f test-kernel-
$(shell uname
-r
).img
$(shell uname
-r
)
102 @echo wrote test-
$(shell uname
-r
).img
103 .
/dracut
-l
-a debug
--no-kernel
-f test-dracut.img
$(shell uname
-r
)
104 @echo wrote test-dracut.img
107 .
/dracut
-H
-l
-a debug
-f test-
$(shell uname
-r
).img
$(shell uname
-r
)
108 @echo wrote test-
$(shell uname
-r
).img
111 git shortlog
--numbered
--summary
-e |while read a rest
; do echo
$$rest;done
> AUTHORS