nfs: only install libnss_*.so which are used by nsswitch.conf
[dracut/plouj.git] / Makefile
blob3ea1d28ce9c593c4648da4efd8d77ff061795338
1 VERSION=0.7
2 GITVERSION=$(shell [ -d .git ] && git rev-list --abbrev-commit -n 1 HEAD |cut -b 1-8)
4 prefix = /usr
5 datadir = ${prefix}/share
6 pkglibdir = ${datadir}/dracut
7 sysconfdir = ${prefix}/etc
8 sbindir = ${prefix}/sbin
9 mandir = ${prefix}/share/man
11 modules.d/99base/switch_root: switch_root.c
12 gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c
14 all: modules.d/99base/switch_root
16 .PHONY: install clean archive rpm testimage test all check
18 install:
19 mkdir -p $(DESTDIR)$(pkglibdir)
20 mkdir -p $(DESTDIR)$(sbindir)
21 mkdir -p $(DESTDIR)$(sysconfdir)
22 mkdir -p $(DESTDIR)$(pkglibdir)/modules.d
23 mkdir -p $(DESTDIR)$(mandir)/man8
24 install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut
25 install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline
26 install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages
27 install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root
28 install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf
29 install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions
30 cp -arx modules.d $(DESTDIR)$(pkglibdir)
31 install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8
32 rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root
34 clean:
35 rm -f *~
36 rm -f modules.d/99base/switch_root
37 rm -f test-*.img
38 rm -f dracut-*.rpm dracut-*.tar.bz2
39 make -C test clean
41 archive: dracut-$(VERSION)-$(GITVERSION).tar.bz2
43 dist: dracut-$(VERSION).tar.bz2
45 dracut-$(VERSION).tar.bz2:
46 git archive --format=tar $(VERSION) --prefix=dracut-$(VERSION)/ |bzip2 > dracut-$(VERSION).tar.bz2
48 dracut-$(VERSION)-$(GITVERSION).tar.bz2:
49 git archive --format=tar HEAD --prefix=dracut-$(VERSION)-$(GITVERSION)/ |bzip2 > dracut-$(VERSION)-$(GITVERSION).tar.bz2
52 rpm: clean dracut-$(VERSION).tar.bz2
53 rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" -ba dracut.spec
54 rm -fr BUILD BUILDROOT
56 gitrpm: dracut-$(VERSION)-$(GITVERSION).tar.bz2
57 rpmbuild --define "_topdir $$PWD" --define "_sourcedir $$PWD" --define "_specdir $$PWD" --define "_srcrpmdir $$PWD" --define "_rpmdir $$PWD" --define "gittag $(GITVERSION)" -ba dracut.spec
58 rm -fr BUILD BUILDROOT
60 check: all
61 @ret=0;for i in modules.d/99base/init modules.d/*/*.sh; do \
62 dash -n "$$i" ; ret=$$(($$ret+$$?)); \
63 done;exit $$ret
64 make -C test check
66 testimage: all
67 ./dracut -l -a debug -f test-$(shell uname -r).img $(shell uname -r)
68 @echo wrote test-$(shell uname -r).img
70 testimages: all
71 ./dracut -l -a debug --kernel-only -f test-kernel-$(shell uname -r).img $(shell uname -r)
72 @echo wrote test-$(shell uname -r).img
73 ./dracut -l -a debug --no-kernel -f test-dracut.img $(shell uname -r)
74 @echo wrote test-dracut.img