Added notes regarding building in VS
authorClifford Wolf <clifford@clifford.at>
Fri, 17 Oct 2014 14:39:24 +0000 (16:39 +0200)
committerClifford Wolf <clifford@clifford.at>
Fri, 17 Oct 2014 14:39:24 +0000 (16:39 +0200)
CodingReadme
Makefile

index 2404a7a5affe9fbfc4398d8161bbeb525927afa2..8bcbe612531de3fa930225b4813756dc59f2f0b1 100644 (file)
@@ -67,6 +67,41 @@ of "foobar.size()". (GetSize() is defined by kernel/yosys.h)
 Use range-based for loops whenever applicable.
 
 
+Building in Visual Studio
+=========================
+
+1. Create an empty Visual C++ Win32 Console App project
+   (recommended name: YosysVS)
+
+2. Close VS and launch "Git Bash" in the project directory
+
+3. Prepare sources
+
+       git clone https://github.com/cliffordwolf/yosys.git yosys
+       cd yosys
+
+       curl -O http://www.clifford.at/yosys/nogit/yosys-win32-<version>.zip
+       unzip yosys-win32-<version>.zip
+       unzip yosys-win32-<version>/genfiles.zip
+
+4. Add files to VS project
+
+       notepad vcxproj_files.txt
+       notepad ../YosysVS/YosysVS.vcxproj
+
+       (replace the empty <ItemGroup> in YosysVS.vcxproj
+       with the XML text from vcxproj_files.txt)
+
+5. Open project in VS and go to the project properties:
+
+       C/C++ -> General -> Additional Include Directories
+               Add: ..\yosys
+
+       C/C++ -> Preprocessor -> Preprocessor Definitions
+               Add: _YOSYS_;_CRT_SECURE_NO_WARNINGS
+
+6. Build YosysVS
+
 
 Checklist for adding internal cell types
 ========================================
index 5fa871d49b53d7c0b4b7cc4762630622953de28a..75af44659cb3766b12e327fa19c8f26ef5a5f11c 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -325,9 +325,9 @@ endif
        echo -en 'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-$(YOSYS_VER)/readme.txt
        echo -en 'Documentation at http://www.clifford.at/yosys/.\r\n' >> yosys-win32-$(YOSYS_VER)/readme.txt
        sed -e 's,^[^ ]*:,,; s, ,\n,g; s, *\\,,; s,/[^/]*/\.\./,/,g; s,'"$$PWD/"',,' \
-                       $(addsuffix .d,$(basename $(OBJS))) | sort -u | grep '^[^/]' > srcfiles.txt
-       { egrep '\.(h|hh|hpp|inc)$$' srcfiles.txt | sed 's,.*,<ClInclude Include="../yosys/&" />,'; echo; \
-               egrep -v '\.(h|hh|hpp|inc)$$' srcfiles.txt | sed 's,.*,<ClCompile Include="../yosys/&" />,'; } > vcxproj_files.txt
+                       $(addsuffix .d,$(basename $(OBJS))) | sort -u | grep '^[^/]' | grep -v kernel/version_ > srcfiles.txt
+       { echo '<ItemGroup>'; 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/&" />,'; echo '</ItemGroup>'; } > vcxproj_files.txt
        sed -i 's/$$/\r/' srcfiles.txt vcxproj_files.txt
        zip yosys-win32-$(YOSYS_VER)/genfiles.zip $(GENFILES) srcfiles.txt vcxproj_files.txt
        zip -r yosys-win32-$(YOSYS_VER).zip yosys-win32-$(YOSYS_VER)/