How to compile your code - OttaboticsRobotRacing/MK2 GitHub Wiki

How to compile your code

Copy the Makefile

  1. Clone the MK2 repo using git clone https://github.com/OttaboticsRobotRacing/MK2.git
  2. Copy modules/sample/Makefile to your working directory
  3. Your working directory should follow the coding standard

Modify the Makefile

  1. Edit line 25 _OBJECTS := sample.o to include any headers that need to be compiled. This field can be blank if you don't have any header files, i.e. _OBJECTS :=
  2. Rename your main file to main.cpp

Compiling your code

  1. Run the command make all in the directory where the file Makefile is located
  2. If your program compiled successfully, your output binary should be located in bin/main

Running your code

  1. You can run your code by entering the following into the terminal: bin/main or ./main if you're in the bin directory