Exporting fstype, rflags and root is no longer necessary
[dracut/plouj.git] / Makefile
blob491d156857159ef9a4c484be2515c200b1ea57a8
1 VERSION=0.1
2 GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
4 prefix = /usr
5 libdir = ${prefix}/lib
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
17 install:
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
29 clean:
30 rm -f *~
31 rm -f modules.d/99base/switch_root
32 rm -f test-*.img
33 make -C test clean
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
44 check: all
45 @ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
46 dash -n "$$i" ; ret=$$(($$ret+$$?)); \
47 done;exit $$ret
48 make -C test check
50 testimage: all
51 ./dracut -l -f test-$(shell uname -r).img $(shell uname -r)
52 @echo wrote test-$(shell uname -r).img