Blame 0037-Makefile-use-symlink-for-topsrcdir-dracut-install.patch

Harald Hoyer 12f6cc
From 4a1255bc38937714fb76702780147d0be465131d Mon Sep 17 00:00:00 2001
Harald Hoyer 12f6cc
From: Harald Hoyer <harald@redhat.com>
Harald Hoyer 12f6cc
Date: Thu, 26 Jul 2012 12:27:29 +0200
Harald Hoyer 12f6cc
Subject: [PATCH] Makefile: use symlink for topsrcdir/dracut-install
Harald Hoyer 12f6cc
Harald Hoyer 12f6cc
---
Harald Hoyer 12f6cc
 Makefile | 34 ++++++++++++++--------------------
Harald Hoyer 12f6cc
 1 file changed, 14 insertions(+), 20 deletions(-)
Harald Hoyer 12f6cc
Harald Hoyer 12f6cc
diff --git a/Makefile b/Makefile
Harald Hoyer 12f6cc
index 0dbc6eb..28381df 100644
Harald Hoyer 12f6cc
--- a/Makefile
Harald Hoyer 12f6cc
+++ b/Makefile
Harald Hoyer 12f6cc
@@ -33,24 +33,18 @@ manpages = $(man1pages) $(man5pages) $(man7pages) $(man8pages)
Harald Hoyer 12f6cc
 
Harald Hoyer 12f6cc
 .PHONY: install clean archive rpm testimage test all check AUTHORS doc
Harald Hoyer 12f6cc
 
Harald Hoyer 12f6cc
-DRACUT_INSTALL_BIN = dracut-install
Harald Hoyer 12f6cc
+all: syncheck dracut-version.sh dracut-install
Harald Hoyer 12f6cc
 
Harald Hoyer 12f6cc
-all: syncheck dracut-version.sh $(DRACUT_INSTALL_BIN)
Harald Hoyer 12f6cc
+DRACUT_INSTALL_OBJECTS = \
Harald Hoyer 12f6cc
+        install/dracut-install.o \
Harald Hoyer 12f6cc
+        install/hashmap.o\
Harald Hoyer 12f6cc
+        install/log.o \
Harald Hoyer 12f6cc
+        install/util.o
Harald Hoyer 12f6cc
 
Harald Hoyer 12f6cc
-DRACUT_INSTALL_SOURCE = \
Harald Hoyer 12f6cc
-        install/dracut-install.c \
Harald Hoyer 12f6cc
-        install/hashmap.c\
Harald Hoyer 12f6cc
-        install/log.c \
Harald Hoyer 12f6cc
-        install/util.c
Harald Hoyer 12f6cc
+install/dracut-install: $(DRACUT_INSTALL_OBJECTS)
Harald Hoyer 12f6cc
 
Harald Hoyer 12f6cc
-DRACUT_INSTALL_HEADER = \
Harald Hoyer 12f6cc
-        install/hashmap.h \
Harald Hoyer 12f6cc
-        install/log.h \
Harald Hoyer 12f6cc
-        install/macro.h \
Harald Hoyer 12f6cc
-        install/util.h
Harald Hoyer 12f6cc
-
Harald Hoyer 12f6cc
-$(DRACUT_INSTALL_BIN): $(DRACUT_INSTALL_SOURCE) $(DRACUT_INSTALL_HEADER)
Harald Hoyer 12f6cc
-	$(CC) $(CFLAGS) $(LDFLAGS) -o $(DRACUT_INSTALL_BIN) $(DRACUT_INSTALL_SOURCE)
Harald Hoyer 12f6cc
+dracut-install: install/dracut-install
Harald Hoyer 12f6cc
+	ln -fs $< $@
Harald Hoyer 12f6cc
 
Harald Hoyer 12f6cc
 indent:
Harald Hoyer 12f6cc
 	indent -i8 -nut -br -linux -l120 install/dracut-install.c
Harald Hoyer 12f6cc
@@ -86,7 +80,7 @@ install: doc dracut-version.sh
Harald Hoyer 12f6cc
 	mkdir -p $(DESTDIR)$(sysconfdir)/dracut.conf.d
Harald Hoyer 12f6cc
 	install -m 0755 dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions.sh
Harald Hoyer 12f6cc
 	install -m 0755 dracut-version.sh $(DESTDIR)$(pkglibdir)/dracut-version.sh
Harald Hoyer 12f6cc
-	ln -s dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
Harald Hoyer 12f6cc
+	ln -fs dracut-functions.sh $(DESTDIR)$(pkglibdir)/dracut-functions
Harald Hoyer 12f6cc
 	install -m 0755 dracut-logger.sh $(DESTDIR)$(pkglibdir)/dracut-logger.sh
Harald Hoyer 12f6cc
 	install -m 0755 dracut-initramfs-restore.sh $(DESTDIR)$(pkglibdir)/dracut-initramfs-restore
Harald Hoyer 12f6cc
 	cp -arx modules.d $(DESTDIR)$(pkglibdir)
Harald Hoyer 12f6cc
@@ -94,7 +88,7 @@ install: doc dracut-version.sh
Harald Hoyer 12f6cc
 	for i in $(man5pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man5/$${i##*/}; done
Harald Hoyer 12f6cc
 	for i in $(man7pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man7/$${i##*/}; done
Harald Hoyer 12f6cc
 	for i in $(man8pages); do install -m 0644 $$i $(DESTDIR)$(mandir)/man8/$${i##*/}; done
Harald Hoyer 12f6cc
-	ln -s dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
Harald Hoyer 12f6cc
+	ln -fs dracut.cmdline.7 $(DESTDIR)$(mandir)/man7/dracut.kernel.7
Harald Hoyer 12f6cc
 	if [ -n "$(systemdsystemunitdir)" ]; then \
Harald Hoyer 12f6cc
 		mkdir -p $(DESTDIR)$(systemdsystemunitdir); \
Harald Hoyer 12f6cc
 		install -m 0644 dracut-shutdown.service $(DESTDIR)$(systemdsystemunitdir); \
Harald Hoyer 12f6cc
@@ -102,8 +96,8 @@ install: doc dracut-version.sh
Harald Hoyer 12f6cc
 		ln -s ../dracut-shutdown.service \
Harald Hoyer 12f6cc
 		$(DESTDIR)$(systemdsystemunitdir)/shutdown.target.wants/dracut-shutdown.service; \
Harald Hoyer 12f6cc
 	fi
Harald Hoyer 12f6cc
-	if [ -f $(DRACUT_INSTALL_BIN) ]; then \
Harald Hoyer 12f6cc
-		install -m 0755 $(DRACUT_INSTALL_BIN) $(DESTDIR)$(pkglibdir)/dracut-install; \
Harald Hoyer 12f6cc
+	if [ -f install/dracut-install ]; then \
Harald Hoyer 12f6cc
+		install -m 0755 install/dracut-install $(DESTDIR)$(pkglibdir)/dracut-install; \
Harald Hoyer 12f6cc
 	fi
Harald Hoyer 12f6cc
 
Harald Hoyer 12f6cc
 dracut-version.sh:
Harald Hoyer 12f6cc
@@ -115,7 +109,7 @@ clean:
Harald Hoyer 12f6cc
 	$(RM) */*/*~
Harald Hoyer 12f6cc
 	$(RM) test-*.img
Harald Hoyer 12f6cc
 	$(RM) dracut-*.rpm dracut-*.tar.bz2
Harald Hoyer 12f6cc
-	$(RM) $(DRACUT_INSTALL_BIN) 
Harald Hoyer 12f6cc
+	$(RM) $(DRACUT_INSTALL_BIN) install/dracut-install $(DRACUT_INSTALL_OBJECTS)
Harald Hoyer 12f6cc
 	$(RM) $(manpages) dracut.html
Harald Hoyer 12f6cc
 	$(MAKE) -C test clean
Harald Hoyer 12f6cc