From 4febe83617eed68969578e99b00fddf0838b3822 Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Fri, 25 Apr 2008 11:57:08 +0000
Subject: [PATCH] Move target creating symlinks in lib/ into Makefile.libcommon

Reviewed-by: iustinp
---
 lib/Makefile.am        | 6 ++----
 lib/Makefile.libcommon | 8 ++++++++
 2 files changed, 10 insertions(+), 4 deletions(-)
 create mode 100644 lib/Makefile.libcommon

diff --git a/lib/Makefile.am b/lib/Makefile.am
index 067034540..b0f83b2c3 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -5,6 +5,7 @@ pkgpython_PYTHON = __init__.py backend.py cli.py cmdlib.py config.py \
 	objects.py errors.py logger.py ssh.py utils.py rpc.py \
 	bdev.py hypervisor.py opcodes.py mcpu.py constants.py \
 	ssconf.py locking.py luxi.py jqueue.py serializer.py
+python_files = $(pkgpython_PYTHON)
 
 all-local: _autoconf.py
 
@@ -28,7 +29,4 @@ _autoconf.py: Makefile
 	  echo "IALLOCATOR_SEARCH_PATH = [$(IALLOCATOR_SEARCH_PATH)]"; \
 	} > $@
 
-pre-check: all
-	for i in $(pkgpython_PYTHON); do \
-		if test ! -f $$i; then $(LN_S) $(srcdir)/$$i $$i; fi; \
-	done
+include $(srcdir)/Makefile.libcommon
diff --git a/lib/Makefile.libcommon b/lib/Makefile.libcommon
new file mode 100644
index 000000000..73b48f3fa
--- /dev/null
+++ b/lib/Makefile.libcommon
@@ -0,0 +1,8 @@
+# We need to create symlinks because "make distcheck" will not install Python
+# files for building.
+pre-check: all
+	for i in $(python_files); do \
+		if test ! -f $$i; then \
+			$(LN_S) $(srcdir)/$$i $$i; \
+		fi; \
+	done
-- 
GitLab