https://www.geeksforgeeks.org/compiling-a-c-program-behind-the-scenes/
- Run the command
gcc -v
to check that the GCC compiler is installed. - Create a C program and save as
filename.c
. - Compile with the command
gcc -Wall filename.c -o filename
.- The option
-Wall
enables all compiler’s warning messages. This option is recommended to generate better code. - The option
-o
is used to specify the output file name. If we do not use this option, then an output file with name a.out is generated.
- The option
- Once compilation is complete an executable is generated which can be run with the command
./filename
.
Download the latest release for your OS from https://github.com/gbdk-2020/gbdk-2020 and unzip.
Place the gbdk
folder in a location you will remember as you may need to update the scripts if the location is different to what I have configured. I placed the folder in the root of this repo.
- Navigate to the folder that you want to compile.
- Run the command
sh make.sh
. I had a lot of trouble with permissions to run GBDK. To fix this I navigated to thegbdk
folder and ran the commandchmod -R 775 bin
which updates the permissions of all files in that folder. Then I had to run the previously mentioned Shell script multiple times as on each run I had to allow permission for each of thegbdk/bin
apps to run in Mac's "Security & Privacy" settings.
- Navigate to the folder that you want to compile.
- Run the command
./make.bat
.
- Tutorial: YouTube playlist
- GBDK: Github
- Gameboy emulator: mGBA
- Tile editor: Gameboy Tile Designer (Windows only)
- Map editor: Gameboy Map Builder (Windows only)