preparing_a_build_environment_in_cygwin
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
preparing_a_build_environment_in_cygwin [2016/07/05 15:00] – initial info on installing cygwin gurce | preparing_a_build_environment_in_cygwin [2024/12/24 05:03] (current) – gurce | ||
---|---|---|---|
Line 3: | Line 3: | ||
Building this project requires a few prerequisite tools that stem from the GNU/Linux world, such as: | Building this project requires a few prerequisite tools that stem from the GNU/Linux world, such as: | ||
- | * gcc compiler | + | |
- | * make | + | |
- | * ghdl | + | |
+ | * **ophis** (8-bit cross compiler) | ||
+ | * **git** (the version-control tool used by this project, and by several of its prerequisite projects) | ||
So if you are predominantly a windows developer and want to contribute to the project, but feel a bit overwhelmed at the thought of jumping ship to Linux, then installing Cygwin in your Windows environment can be a good compromise. | So if you are predominantly a windows developer and want to contribute to the project, but feel a bit overwhelmed at the thought of jumping ship to Linux, then installing Cygwin in your Windows environment can be a good compromise. | ||
Line 49: | Line 51: | ||
* Stick with the default "**(x) Select required packages (RECOMMENDED)**" | * Stick with the default "**(x) Select required packages (RECOMMENDED)**" | ||
* then click " | * then click " | ||
+ | * {{http:// | ||
* Patiently wait for it all to install... :) | * Patiently wait for it all to install... :) | ||
* On the final screen: | * On the final screen: | ||
Line 56: | Line 59: | ||
* {{http:// | * {{http:// | ||
- | You can now run cygwin from "Start Menu >> Programs >> Cygwin >> | + | You can now run cygwin from "**Start Menu >> Programs >> Cygwin >> |
{{http:// | {{http:// | ||
+ | |||
+ | ===== Cygwin Prerequisites ===== | ||
+ | |||
+ | Run the Cygwin setup exe again and install the following packages: | ||
+ | |||
+ | * **gcc-core** | ||
+ | * **gcc-g++** | ||
+ | * **gcc-ada** | ||
+ | * **gdb** | ||
+ | * **gmp-devel** | ||
+ | * **mpfr-devel** | ||
+ | * **libmpc-devel** | ||
+ | * **wget** | ||
+ | * **git** | ||
+ | * **libpng-devel** | ||
+ | |||
+ | For example, for " | ||
+ | |||
+ | {{http:// | ||
+ | |||
+ | Note that you can search and select multiple items this way prior to clicking on the wizard' | ||
+ | |||
+ | ===== Retrieve the MEGA65 source code ===== | ||
+ | |||
+ | The source code for the MEGA65 project is housed in a git repository hosted by github. | ||
+ | |||
+ | To retrieve it, inside the Cygwin Terminal, do the following: | ||
+ | |||
+ | * **cd ~** (ie, go to your home folder) | ||
+ | * **git clone https:// | ||
+ | |||
+ | The source-code will then be placed in the " | ||
+ | |||
+ | ===== Installing Ophis ===== | ||
+ | |||
+ | This refers to [[https:// | ||
+ | |||
+ | It is a cross-compiler for the 6502-family of processors. Paul has tweaked it so that it can also support his new 4502 processor. | ||
+ | |||
+ | You'll need to grab it from Paul's github fork of Ophis, as follows: | ||
+ | |||
+ | * **cd ~** | ||
+ | * **git clone https:// | ||
+ | |||
+ | __NOTE__: Ophis needs to be housed within the same parent-folder that you previously cloned the mega65 code to, as the mega65 code uses relative-paths to access it. So if you chose a different parent-folder for your mega65 code to that shown in these docs, make sure you put Ophis in that location too! | ||
+ | |||
+ | __NOTE2__: You won't need to compile Ophis as it is written in python. I believe the default Cygwin install comes with python. If you find this isn't the case for you, please install it via the cygwin setup exe. | ||
+ | |||
+ | ===== Installing GHDL ===== | ||
+ | |||
+ | GHDL is a vhdl simulator, allowing you to assess how the vhdl code behaves without having to wait an hour or so for the bitstream to build/ | ||
+ | |||
+ | It also needs to be built from the source, so here are some steps for getting it done. | ||
+ | |||
+ | ==== 1) Grab the source for gcc v4.9.3 ==== | ||
+ | |||
+ | * **cd ~/ | ||
+ | * **wget http:// | ||
+ | * NOTE: (12/ | ||
+ | * https:// | ||
+ | * **mkdir gcc** | ||
+ | * **cd gcc** | ||
+ | * **tar xvf ../ | ||
+ | * (wait patiently for it all to decompress) | ||
+ | |||
+ | ==== 2) Grab the latest version of ghdl via git and copy its source into gcc ==== | ||
+ | |||
+ | * **cd ~/ | ||
+ | * **%%git clone http:// | ||
+ | * NOTE: I think it might be better to grab a newer version of this repo at this location (which might work better with newer versions of gcc too): | ||
+ | * https:// | ||
+ | * **cd ghdl-updates** | ||
+ | * **%%./ | ||
+ | * **make copy-sources** | ||
+ | |||
+ | ==== 3) Build and install gcc+ghdl ==== | ||
+ | |||
+ | * **cd ~/ | ||
+ | * **mkdir gcc-objs; cd gcc-objs** | ||
+ | * **%%../ | ||
+ | * **make -j2** | ||
+ | * If you get an error saying "// | ||
+ | * Edit the " | ||
+ | * Towards the start of the file, add " | ||
+ | * run **make -j2** again | ||
+ | * If you get an error saying "//: No such file or directory//", | ||
+ | * **export SHELLOPTS** | ||
+ | * **set -o igncr** | ||
+ | * run **make -j2** again | ||
+ | * **make install** | ||
+ | * **rm / | ||
+ | * **ln -s / | ||
+ | * As a test, try typing " | ||
+ | * take a look at the output, and assure that there' | ||
+ | |||
+ | ==== 4) Take it for a spin! ==== | ||
+ | |||
+ | * **cd ~/mega65** | ||
+ | * **make simulate** | ||
+ | * this churns away at quite a lot of *.vhdl files this time, no errors given | ||
+ | * then you will get a " | ||
+ | * Then give Paul's suggestion a try, of: | ||
+ | * **./ | ||
+ | |||
+ | You should start seeing cpu instructions being outputted to the screen as they are executed, something like the following: | ||
+ | |||
+ | < | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | gs4510.vhdl: | ||
+ | </ |
preparing_a_build_environment_in_cygwin.1467752418.txt.gz · Last modified: 2016/07/05 15:00 by gurce