Developing cross platform program/game from ground up - part 2.
Understand how build process talked about in part 1 work.
So now you type make all -f makefile.os4 you get the game.exe file for AmigaOS4.
The game.exe will contain the following files for AmigaOS4:
main.cpp
os4/display.c
os4/filesystem.c
os4/joystick.c
os4/audio.c
The game.exe will contain the following files for AmigaOS3:
main.cpp
os3/display.c
os3/filesystem.c
os3/joystick.c
os3/audio.c
The game.exe will contain the following files for Linux:
main.cpp
linux/display.c
linux /filesystem.c
linux /joystick.c
linux /audio.c
Etch of the files in the OS folder will contain OS specific code, for example in linux/audio.c file OSS Open Sound System is used. In the os3/audio.c code for Paula audio is used. In the os4/audio.c file the AHI sound system is used.
In the os4/filesystem.c the newest DOS.Library functions are used with full support for 64BIT offsets.
In the OS3/filesystem.c the old 32bit DOS.Library functions are used, with file limit of 2GB.
In the Linux/filesystem.c the stdio C++ lib commands are used, with full 64BIT support if compile target supports it.
So what we have done is separate the OS depended parts and we are using the best possible API that we can use for etch OS target.
This is also the case for windows target, but as it use different build system, you only need to make the folder and add the file to the project in Virtual Studio.