do not use grep to test if sysroot is mounted
[dracut.git] / Makefile
blob45ad1a5148a583630968389f405169ceb8503a92
1 VERSION=0.0
2 GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
4 modules.d/99base/switch_root: switch_root.c
5 gcc -o modules.d/99base/switch_root switch_root.c
7 all: modules.d/99base/switch_root
9 .PHONY: install clean archive rpm testimage test
11 install:
12 mkdir -p $(DESTDIR)/usr/lib/dracut
13 mkdir -p $(DESTDIR)/sbin
14 mkdir -p $(DESTDIR)/etc
15 mkdir -p $(DESTDIR)/usr/lib/dracut/modules.d
16 install -m 0755 dracut $(DESTDIR)/sbin/dracut
17 install -m 0644 dracut.conf $(DESTDIR)/etc/dracut.conf
18 install -m 0755 dracut-functions $(DESTDIR)/usr/lib/dracut/dracut-functions
19 cp -arx modules.d $(DESTDIR)/usr/lib/dracut/
21 clean:
22 rm -f *~
23 rm -f modules.d/99base/switch_root
24 rm -f test-*.img
26 archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
28 dracut-$(VERSION)-$(GITVERSION).tar.bz2:
29 git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
31 rpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
32 rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec
33 rm -fr BUILD BUILDROOT
35 test: test/root.ext2 all
36 sudo test/test-initramfs
38 test/root.ext2: test/test-init test/make-test-root all
39 sudo test/make-test-root
41 testimage: all
42 ./dracut -l -f test-$(shell uname -r).img $(shell uname -r)
43 @echo wrote test-$(shell uname -r).img