aboutsummaryrefslogtreecommitdiff
path: root/build-shadow-tree.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2016-06-27 16:26:25 -0400
committerRob Austein <sra@hactrn.net>2016-06-27 16:26:25 -0400
commit0f3cc3aa55bcc6476d721f9fbb8dfe8559d85ff7 (patch)
treeb26632f3ff40fe79fabc07e5d63be4953ef71df9 /build-shadow-tree.py
parentf7aa0ad426ddfc01f66212a6c4f5cf352400faf2 (diff)
First cut at consolidated alpha releng.
Undoubtedly doesn't work yet, and still needs doc, but perhaps now ready for testing on build machine.
Diffstat (limited to 'build-shadow-tree.py')
-rwxr-xr-xbuild-shadow-tree.py51
1 files changed, 51 insertions, 0 deletions
diff --git a/build-shadow-tree.py b/build-shadow-tree.py
new file mode 100755
index 0000000..f8c2376
--- /dev/null
+++ b/build-shadow-tree.py
@@ -0,0 +1,51 @@
+#!/usr/bin/env python
+
+# Create a symlink build tree like the old X11 project "lndir" program.
+#
+# Reason for this is simple: synthesizing the Alpha RTL code takes a
+# looong time, so we don't want to do it unnecessarily, but we also
+# don't want to include all of the intermediate files from the
+# synthesis in the source tarball. So we symlink a shadow build tree
+# off to the side, do the synthesis there.
+#
+# We could construct this symlink tree by hand, but that's fragile, so
+# we'd probably write a script to do it anyway, so we might as well
+# just use the script to build the shadow tree and have done with it.
+
+import os
+
+verbose = True
+dry_run = False
+
+source_root = "source"
+build_root = "build"
+
+if verbose:
+ " mkdir", build_root
+
+if not dry_run:
+ os.mkdir(build_root)
+
+for source_head, dirs, files in os.walk(source_root):
+ build_head = build_root + source_head[len(source_root):]
+
+ print source_head, build_head, dirs, files
+
+ for dn in dirs:
+ d = os.path.join(build_head, dn)
+ if verbose:
+ print " mkdir", d
+ if not dry_run:
+ os.mkdir(d)
+
+ for fn in files:
+ if fn == ".git":
+ continue
+ d = os.path.join(build_head, fn)
+ s = os.path.join(source_head, fn)
+ s = os.path.abspath(s)
+ s = os.path.relpath(s, build_head)
+ if verbose:
+ print " ln -s", s, d
+ if not dry_run:
+ os.symlink(s, d)