summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2009-11-23 11:59:58 +0100
committerHarald Hoyer <harald@redhat.com>2009-11-23 12:28:53 +0100
commit7f1282834ff28a8692dde6a8b5048df313e53622 (patch)
tree7cc963e8182ad273e2e2edd4e295bfd01fd47e13
parent4e0ef1d982aced484e49a1418d6e0a7c74e422c9 (diff)
Makefile: add WITH_SWITCH_ROOT
-rw-r--r--Makefile12
1 files changed, 11 insertions, 1 deletions
diff --git a/Makefile b/Makefile
index f127995..c00eae5 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 *~