sudo apt install mono-mcsMacOS users might need to install mono from the mono-poject [mono-project.com].
mkdir -p ~/repos/ppnm/exercises/hello
cd ~/repos/ppnm/exercises/hello
Makefile with the following content (mind
the tabulators!) (and you can omit comments):
out.txt : hello.exe # out.txt depends on hello.exe mono hello.exe > out.txt # run hello.exe, send output to out.txt hello.exe : hello.cs # hello.exe depends on hello.cs mcs hello.cs # compile hello.cs into hello.exe clean: # a phoney target, no dependencies rm -f out.txt hello.exe # remove secondary files
hello.cs with the following content
class hello{
static void Main(){
System.Console.Write("hello\n");
}
}
make and debug.
Extra hints:
~/.nanorc,
syntax "makefile" "[Mm]akefile" color white,magenta " "where the character in between the quotation marks in the second line should be the tabulator sign and where the colors are free for you to choose.
.RECIPEPREFIX := ;.