mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-13 04:28:18 +00:00
Create vcxsrc in mxe build "make dist"
This commit is contained in:
parent
b5da3a60e1
commit
85572b05e5
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -22,3 +22,5 @@
|
||||||
/yosys-filterlib.html
|
/yosys-filterlib.html
|
||||||
/kernel/version_*.cc
|
/kernel/version_*.cc
|
||||||
/share
|
/share
|
||||||
|
/yosys-win32-mxebin-*
|
||||||
|
/yosys-win32-vcxsrc-*
|
||||||
|
|
46
CodingReadme
46
CodingReadme
|
@ -67,32 +67,27 @@ of "foobar.size()". (GetSize() is defined by kernel/yosys.h)
|
||||||
Use range-based for loops whenever applicable.
|
Use range-based for loops whenever applicable.
|
||||||
|
|
||||||
|
|
||||||
Building in Visual Studio
|
|
||||||
=========================
|
Creating the Visual Studio Template Project
|
||||||
|
===========================================
|
||||||
|
|
||||||
1. Create an empty Visual C++ Win32 Console App project
|
1. Create an empty Visual C++ Win32 Console App project
|
||||||
(recommended name: YosysVS)
|
|
||||||
|
|
||||||
2. Close VS and launch "Git Bash" in the project directory
|
Microsoft Visual Studio Express 2013 for Windows Desktop
|
||||||
|
Open New Project Wizard (File -> New Project..)
|
||||||
|
|
||||||
3. Prepare sources
|
Project Name: YosysVS
|
||||||
|
Solution Name: YosysVS
|
||||||
|
[X] Create directory for solution
|
||||||
|
[ ] Add to source control
|
||||||
|
|
||||||
git clone https://github.com/cliffordwolf/yosys.git yosys
|
[X] Console applications
|
||||||
cd yosys
|
[X] Empty Projcect
|
||||||
|
[ ] SDL checks
|
||||||
|
|
||||||
curl -O http://www.clifford.at/yosys/nogit/yosys-win32-<version>.zip
|
2. Open YosysVS Project Properties
|
||||||
unzip yosys-win32-<version>.zip
|
|
||||||
unzip yosys-win32-<version>/genfiles.zip
|
|
||||||
|
|
||||||
4. Add files to VS project
|
Select Configuration: All Configurations
|
||||||
|
|
||||||
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
|
C/C++ -> General -> Additional Include Directories
|
||||||
Add: ..\yosys
|
Add: ..\yosys
|
||||||
|
@ -100,7 +95,18 @@ Building in Visual Studio
|
||||||
C/C++ -> Preprocessor -> Preprocessor Definitions
|
C/C++ -> Preprocessor -> Preprocessor Definitions
|
||||||
Add: _YOSYS_;_CRT_SECURE_NO_WARNINGS
|
Add: _YOSYS_;_CRT_SECURE_NO_WARNINGS
|
||||||
|
|
||||||
6. Build YosysVS
|
3. Resulting file system tree:
|
||||||
|
|
||||||
|
YosysVS/
|
||||||
|
YosysVS/YosysVS
|
||||||
|
YosysVS/YosysVS/YosysVS.vcxproj
|
||||||
|
YosysVS/YosysVS/YosysVS.vcxproj.filters
|
||||||
|
YosysVS/YosysVS.sdf
|
||||||
|
YosysVS/YosysVS.sln
|
||||||
|
YosysVS/YosysVS.v12.suo
|
||||||
|
|
||||||
|
4. Zip YosysVS as YosysVS-Tpl-v1.zip
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Checklist for adding internal cell types
|
Checklist for adding internal cell types
|
||||||
|
|
24
Makefile
24
Makefile
|
@ -315,23 +315,21 @@ qtcreator:
|
||||||
|
|
||||||
ifeq ($(CONFIG),mxe)
|
ifeq ($(CONFIG),mxe)
|
||||||
dist: $(TARGETS) $(EXTRA_TARGETS)
|
dist: $(TARGETS) $(EXTRA_TARGETS)
|
||||||
rm -rf yosys-win32-$(YOSYS_VER)
|
rm -rf yosys-win32-{mxebin,vcxsrc}-$(YOSYS_VER){,.zip}
|
||||||
rm -rf yosys-win32-$(YOSYS_VER).zip
|
mkdir -p yosys-win32-mxebin-$(YOSYS_VER)
|
||||||
mkdir -p yosys-win32-$(YOSYS_VER)
|
cp -r yosys.exe share/ yosys-win32-mxebin-$(YOSYS_VER)/
|
||||||
cp -r yosys.exe share/ yosys-win32-$(YOSYS_VER)/
|
|
||||||
ifeq ($(ENABLE_ABC),1)
|
ifeq ($(ENABLE_ABC),1)
|
||||||
cp -r yosys-abc.exe abc/lib/x86/pthreadVC2.dll yosys-win32-$(YOSYS_VER)/
|
cp -r yosys-abc.exe abc/lib/x86/pthreadVC2.dll yosys-win32-mxebin-$(YOSYS_VER)/
|
||||||
endif
|
endif
|
||||||
echo -en 'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-$(YOSYS_VER)/readme.txt
|
echo -en 'This is Yosys $(YOSYS_VER) for Win32.\r\n' > yosys-win32-mxebin-$(YOSYS_VER)/readme.txt
|
||||||
echo -en 'Documentation at http://www.clifford.at/yosys/.\r\n' >> yosys-win32-$(YOSYS_VER)/readme.txt
|
echo -en 'Documentation at http://www.clifford.at/yosys/.\r\n' >> yosys-win32-mxebin-$(YOSYS_VER)/readme.txt
|
||||||
sed -e 's,^[^ ]*:,,; s, ,\n,g; s, *\\,,; s,/[^/]*/\.\./,/,g; s,'"$$PWD/"',,' \
|
sed -e 's,^[^ ]*:,,; s, ,\n,g; s, *\\,,; s,/[^/]*/\.\./,/,g; s,'"$$PWD/"',,' \
|
||||||
$(addsuffix .d,$(basename $(OBJS))) | sort -u | grep '^[^/]' | grep -v kernel/version_ > srcfiles.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/&" />,'; \
|
bash misc/create_vcxsrc.sh yosys-win32-vcxsrc-$(YOSYS_VER)
|
||||||
egrep -v '\.(h|hh|hpp|inc)$$' srcfiles.txt | sed 's,.*,<ClCompile Include="../yosys/&" />,'; echo '</ItemGroup>'; } > vcxproj_files.txt
|
zip yosys-win32-vcxsrc-$(YOSYS_VER)/genfiles.zip $(GENFILES)
|
||||||
sed -i 's/$$/\r/' srcfiles.txt vcxproj_files.txt
|
zip -r yosys-win32-mxebin-$(YOSYS_VER).zip yosys-win32-mxebin-$(YOSYS_VER)/
|
||||||
zip yosys-win32-$(YOSYS_VER)/genfiles.zip $(GENFILES) srcfiles.txt vcxproj_files.txt
|
zip -r yosys-win32-vcxsrc-$(YOSYS_VER).zip yosys-win32-vcxsrc-$(YOSYS_VER)/
|
||||||
zip -r yosys-win32-$(YOSYS_VER).zip yosys-win32-$(YOSYS_VER)/
|
rm -f srcfiles.txt
|
||||||
rm -f srcfiles.txt vcxproj_files.txt
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
config-clean: clean
|
config-clean: clean
|
||||||
|
|
39
misc/create_vcxsrc.sh
Normal file
39
misc/create_vcxsrc.sh
Normal file
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue