From: Harald Hoyer Date: Mon, 23 Nov 2009 10:59:58 +0000 (+0100) Subject: Makefile: add WITH_SWITCH_ROOT X-Git-Tag: 003~41 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7f1282834ff28a8692dde6a8b5048df313e53622;p=thirdparty%2Fdracut.git Makefile: add WITH_SWITCH_ROOT --- diff --git a/Makefile b/Makefile index f1279954e..c00eae5c8 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,13 @@ mandir ?= ${prefix}/share/man .PHONY: install clean archive rpm testimage test all check AUTHORS -all: modules.d/99base/switch_root +ifeq (1,${WITH_SWITCH_ROOT}) +targets = modules.d/99base/switch_root +else +targets = +endif + +all: $(targets) modules.d/99base/switch_root: switch_root.c gcc -D _GNU_SOURCE -D 'PACKAGE_STRING="dracut"' -std=gnu99 -fsigned-char -g -O2 -o modules.d/99base/switch_root switch_root.c @@ -25,12 +31,16 @@ install: install -m 0755 dracut $(DESTDIR)$(sbindir)/dracut install -m 0755 dracut-gencmdline $(DESTDIR)$(sbindir)/dracut-gencmdline install -m 0755 dracut-catimages $(DESTDIR)$(sbindir)/dracut-catimages +ifeq (1,${WITH_SWITCH_ROOT}) install -m 0755 modules.d/99base/switch_root $(DESTDIR)$(sbindir)/switch_root +endif install -m 0644 dracut.conf $(DESTDIR)$(sysconfdir)/dracut.conf install -m 0755 dracut-functions $(DESTDIR)$(pkglibdir)/dracut-functions cp -arx modules.d $(DESTDIR)$(pkglibdir) install -m 0644 dracut.8 $(DESTDIR)$(mandir)/man8 +ifeq (1,${WITH_SWITCH_ROOT}) rm $(DESTDIR)$(pkglibdir)/modules.d/99base/switch_root +endif clean: rm -f *~