aboutsummaryrefslogtreecommitdiffstats
path: root/misc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-10-18 15:17:33 +0200
committerClifford Wolf <clifford@clifford.at>2014-10-18 15:17:33 +0200
commit85572b05e5359f28c1625b873dc14428f796a454 (patch)
tree95529c8015eebbc3ca5de66b923b534dcd063071 /misc
parentb5da3a60e101a26dbcbd6a8565343c281ba464f8 (diff)
downloadyosys-85572b05e5359f28c1625b873dc14428f796a454.tar.gz
yosys-85572b05e5359f28c1625b873dc14428f796a454.tar.bz2
yosys-85572b05e5359f28c1625b873dc14428f796a454.zip
Create vcxsrc in mxe build "make dist"
Diffstat (limited to 'misc')
-rw-r--r--misc/create_vcxsrc.sh39
1 files changed, 39 insertions, 0 deletions
diff --git a/misc/create_vcxsrc.sh b/misc/create_vcxsrc.sh
new file mode 100644
index 000000000..eb2239303
--- /dev/null
+++ b/misc/create_vcxsrc.sh
@@ -0,0 +1,39 @@
+#!/bin/bash
+
+set -ex
+vcxsrc="$1"
+
+rm -rf YosysVS-Tpl-v1.zip YosysVS
+wget http://www.clifford.at/yosys/nogit/YosysVS-Tpl-v1.zip
+
+unzip YosysVS-Tpl-v1.zip
+rm -f YosysVS-Tpl-v1.zip
+mv YosysVS "$vcxsrc"
+
+{
+ n=$(grep -B999 '<ItemGroup>' "$vcxsrc"/YosysVS/YosysVS.vcxproj | wc -l)
+ head -n$n "$vcxsrc"/YosysVS/YosysVS.vcxproj
+ egrep '\.(h|hh|hpp|inc)$' srcfiles.txt | sed 's,.*,<ClInclude Include="../yosys/&" />,'
+ egrep -v '\.(h|hh|hpp|inc)$' srcfiles.txt | sed 's,.*,<ClCompile Include="../yosys/&" />,'
+ tail -n +$((n+1)) "$vcxsrc"/YosysVS/YosysVS.vcxproj
+} > "$vcxsrc"/YosysVS/YosysVS.vcxproj.new
+
+mv "$vcxsrc"/YosysVS/YosysVS.vcxproj.new "$vcxsrc"/YosysVS/YosysVS.vcxproj
+
+mkdir -p "$vcxsrc"/yosys
+tar -cf - -T srcfiles.txt | tar -xf - -C "$vcxsrc"/yosys
+
+cat > "$vcxsrc"/readme-git.txt << EOT
+Using a git working copy for the yosys source code:
+
+Open "Git Bash" in this directory and run:
+
+ mv yosys yosys.bak
+ git clone https://github.com/cliffordwolf/yosys.git yosys
+ cd yosys
+ git checkout -B master $(git rev-parse HEAD | cut -c1-10)
+ unzip ../genfiles.zip
+EOT
+
+sed -i 's/$/\r/; s/\r\r*/\r/g;' "$vcxsrc"/YosysVS/YosysVS.vcxproj "$vcxsrc"/readme-git.txt
+