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
12 .PHONY
: install clean archive rpm testimage
test all check AUTHORS
14 ifeq (1,${WITH_SWITCH_ROOT})
15 targets
= modules.d
/99base
/switch_root
22 modules.d
/99base
/switch_root
: switch_root.c
23 gcc
-D _GNU_SOURCE
-D
'PACKAGE_STRING="dracut"' -std
=gnu99
-fsigned-char
-g
-O2
-o modules.d
/99base
/switch_root switch_root.c
26 mkdir
-p
$(DESTDIR
)$(pkglibdir
)
27 mkdir
-p
$(DESTDIR
)$(sbindir
)
28 mkdir
-p
$(DESTDIR
)$(sysconfdir
)
29 mkdir
-p
$(DESTDIR
)$(pkglibdir
)/modules.d
30 mkdir
-p
$(DESTDIR
)$(mandir)/man
{5,8}
31 install -m
0755 dracut
$(DESTDIR
)$(sbindir
)/dracut
32 install -m
0755 dracut-gencmdline
$(DESTDIR
)$(sbindir
)/dracut-gencmdline
33 install -m
0755 dracut-catimages
$(DESTDIR
)$(sbindir
)/dracut-catimages
34 install -m
0755 mkinitrd-dracut.sh
$(DESTDIR
)$(sbindir
)/mkinitrd
35 install -m
0755 lsinitrd
$(DESTDIR
)$(sbindir
)/lsinitrd
36 ifeq (1,${WITH_SWITCH_ROOT})
37 install -m
0755 modules.d
/99base
/switch_root
$(DESTDIR
)$(sbindir
)/switch_root
39 install -m
0644 dracut.conf
$(DESTDIR
)$(sysconfdir
)/dracut.conf
40 mkdir
-p
$(DESTDIR
)$(sysconfdir
)/dracut.conf.d
41 install -m
0755 dracut-functions
$(DESTDIR
)$(pkglibdir
)/dracut-functions
42 cp
-arx modules.d
$(DESTDIR
)$(pkglibdir
)
43 install -m
0644 dracut
.8 $(DESTDIR
)$(mandir)/man8
44 install -m
0644 dracut-catimages
.8 $(DESTDIR
)$(mandir)/man8
45 install -m
0644 dracut-gencmdline
.8 $(DESTDIR
)$(mandir)/man8
46 install -m
0644 dracut.conf
.5 $(DESTDIR
)$(mandir)/man5
47 ifeq (1,${WITH_SWITCH_ROOT})
48 rm $(DESTDIR
)$(pkglibdir
)/modules.d
/99base
/switch_root
55 rm -f modules.d
/99base
/switch_root
57 rm -f dracut-
*.rpm dracut-
*.
tar.bz2
60 archive
: dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
62 dist: dracut-
$(VERSION
).
tar.bz2
64 dracut-
$(VERSION
).
tar.bz2
:
65 git archive
--format
=tar $(VERSION
) --prefix=dracut-
$(VERSION
)/ |bzip2
> dracut-
$(VERSION
).
tar.bz2
67 dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
:
68 git archive
--format
=tar HEAD
--prefix=dracut-
$(VERSION
)-$(GITVERSION
)/ |bzip2
> dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
71 rpm
: clean dracut-
$(VERSION
).
tar.bz2
72 rpmbuild
--define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
73 rm -fr BUILD BUILDROOT
75 gitrpm
: dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
76 echo
"%define gittag $(GITVERSION)" > dracut.spec.git
77 cat dracut.spec
>> dracut.spec.git
78 mv dracut.spec dracut.spec.bak
79 mv dracut.spec.git dracut.spec
80 rpmbuild
--define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec ||
:
81 mv dracut.spec.bak dracut.spec
82 rm -fr BUILD BUILDROOT
85 @ret
=0;for i in modules.d
/99base
/init modules.d
/*/*.sh
; do \
86 dash
-n
"$$i" ; ret
=$$(($$ret+$$?
)); \
91 .
/dracut
-l
-a debug
-f test-
$(shell uname
-r
).img
$(shell uname
-r
)
92 @echo wrote test-
$(shell uname
-r
).img
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
101 .
/dracut
-H
-l
-a debug
-f test-
$(shell uname
-r
).img
$(shell uname
-r
)
102 @echo wrote test-
$(shell uname
-r
).img
105 git shortlog
--numbered
--summary
-e |while read a rest
; do echo
$$rest;done
> AUTHORS