2 GITVERSION
=$(shell [ -d .git
] && git rev-list
--abbrev-commit
-n
1 HEAD |cut
-b
1-8)
6 pkglibdir
= ${libdir}/dracut
7 sysconfdir
= ${prefix}/etc
8 sbindir
= ${prefix}/sbin
10 modules.d
/99base
/switch_root
: switch_root.c
11 gcc
-o modules.d
/99base
/switch_root switch_root.c
13 all: modules.d
/99base
/switch_root
15 .PHONY
: install clean archive rpm testimage
test all check
18 mkdir
-p
$(DESTDIR
)$(pkglibdir
)
19 mkdir
-p
$(DESTDIR
)$(sbindir
)
20 mkdir
-p
$(DESTDIR
)$(sysconfdir
)
21 mkdir
-p
$(DESTDIR
)$(pkglibdir
)/modules.d
22 install -m
0755 dracut
$(DESTDIR
)$(sbindir
)/dracut
23 install -m
0755 modules.d
/99base
/switch_root
$(DESTDIR
)$(sbindir
)/switch_root
24 install -m
0644 dracut.conf
$(DESTDIR
)$(sysconfdir
)/dracut.conf
25 install -m
0755 dracut-functions
$(DESTDIR
)$(pkglibdir
)/dracut-functions
26 cp
-arx modules.d
$(DESTDIR
)$(pkglibdir
)
27 rm $(DESTDIR
)$(pkglibdir
)/modules.d
/99base
/switch_root
31 rm -f modules.d
/99base
/switch_root
35 archive
: dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
37 dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
:
38 git archive
--format
=tar HEAD
--prefix=dracut-
$(VERSION
)-$(GITVERSION
)/ |bzip2
> dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
40 rpm
: dracut-
$(VERSION
)-$(GITVERSION
).
tar.bz2
41 rpmbuild
--define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec
42 rm -fr BUILD BUILDROOT
45 @ret
=0;for i in modules.d
/99base
/init modules.d
/*/*.sh
; do \
46 dash
-n
"$$i" ; ret
=$$(($$ret+$$?
)); \
51 .
/dracut
-l
-f test-
$(shell uname
-r
).img
$(shell uname
-r
)
52 @echo wrote test-
$(shell uname
-r
).img