dracut/Makefile

53 lines
1.7 KiB
Makefile
Raw Normal View History

2009-06-04 15:08:39 +04:00
VERSION=0.1
2009-03-05 13:05:35 +03:00
GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
2009-06-04 19:19:42 +04:00
prefix = /usr
libdir = ${prefix}/lib
pkglibdir = ${libdir}/dracut
sysconfdir = ${prefix}/etc
sbindir = ${prefix}/sbin
modules.d/99base/switch_root: switch_root.c
gcc -o modules.d/99base/switch_root switch_root.c
all: modules.d/99base/switch_root
2008-12-18 23:58:15 +03:00
2009-05-25 16:43:03 +04:00
.PHONY: install clean archive rpm testimage test all check
2008-12-18 23:58:15 +03:00
install:
2009-06-04 19:19:42 +04:00
mkdir -p $(DESTDIR)$(pkglibdir)
mkdir -p $(DESTDIR)$(sbindir)
mkdir -p $(DESTDIR)$(sysconfdir)
mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
2009-06-04 19:23:41 +04:00
install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
2009-06-04 19:19:42 +04:00
install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
cp -arx modules.d $(DESTDIR)$(pkglibdir)
2009-06-04 19:23:41 +04:00
rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
2009-03-04 16:23:02 +03:00
2008-12-18 23:58:15 +03:00
clean:
rm -f *~
2009-03-04 16:23:02 +03:00
rm -f modules.d/99base/switch_root
2009-03-05 16:20:05 +03:00
rm -f test-*.img
2009-05-25 16:43:03 +04:00
make -C test clean
2008-12-18 23:58:15 +03:00
archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
dracut-$(VERSION)-$(GITVERSION).tar.bz2:
git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
rpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec
rm -fr BUILD BUILDROOT
2009-03-05 12:33:18 +03:00
2009-05-25 16:43:03 +04:00
check: all
@ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
dash -n "$$i" ; ret=$$(($$ret+$$?)); \
done;exit $$ret
2009-05-25 16:43:03 +04:00
make -C test check
testimage: all
2009-06-03 19:04:43 +04:00
./dracut -l -f test-$(shell uname -r).img $(shell uname -r)
2009-03-05 16:20:05 +03:00
@echo wrote test-$(shell uname -r).img