Build SDK Demos

The Cafe SDK contains sample demos that use GNU make as the build system. The demos are located in the %CAFE_ROOT%\system\src\demo folder. There are a few different methods to build the SDK demos.

Installing Cygwin

Follow the steps in Install Cygwin to install Cygwin.

Installing MinGW/MSYS

Follow the steps in Install MinGW to install MinGW/MSYS

After installation is complete, open cafe.bat in a text editor and add the line MSYS_PATH=<msys-installation-path>. The default installation path for MinGW/MSYS is C:\MinGW\msys\1.0. If you changed the installation path, use the path you specified and add \msys\1.0 to the end of it.

Building the Demos

Building with Cygwin or MinGW/MSYS

  1. Navigate to the folder where you installed the Cafe SDK.
  2. Double-click cafe.bat.
  3. At the command prompt, type the following command, and then press Enter:
    cd $CAFE_ROOT/system/src/demo/helloworld
    
  4. At the command prompt, type make, and then press Enter.

By default, the Cafe SDK builds debug versions of demos. To build non-debug versions, use the make NDEBUG=TRUE command. To remove object and dependency files, use the make clean command.

The process to build most other demos is similar. For the GX2 demos, the assets must be built separately. If they are not built separately, the demos do not run correctly. To build the GX2 assets, navigate to $CAFE_ROOT/system/src/demo/gx2/assets/geometries, and then execute the make command. Repeat this process for the shaders and textures folders.

Building with the build_sdk_demo.bat file

This batch file allows for the building of many demos without the need for Cygwin or MinGW/MSYS. The file is located in %CAFE_ROOT%\system\src\demo\build_sdk_demo.bat. To use it, copy and paste it into the source folder of the demo to build. For example, to build the helloworld demo:

  1. Navigate to the folder where you installed the Cafe SDK.
  2. Double-click cafex_env.bat.
  3. At the command prompt, type the following command and press Enter:
    copy %CAFE_ROOT%\system\src\demo\build_sdk_demo.bat %CAFE_ROOT%\system\src\demo\helloworld
    
  4. At the command prompt, type cd system\src\demo\helloworld and press Enter.
  5. At the command prompt, type build_sdk_demo.bat and press Enter.

To build the NDEBUG version of the demo, open up the build_sdk_demo.bat file in a text editor and modify the line

if "%DEBUG%" == "" set DEBUG=DEBUG

to

if "%DEBUG%" == "" set DEBUG=NDEBUG

Alternatively, use the command set DEBUG=NDEBUG in the command prompt.

Some demos may require other modifications to build_sdk_demo.bat. Usage information is contained at the top of the file, but is intended for advanced users.

See Also

Cafe SDK Build System

Revision History

2014-11-18 Correct the name of build_sdk_demo.bat.
2014-01-16 Added option to build with a batch script
2013-12-20 Added option to build with MinGW
2013-05-08 Automated cleanup pass.
2013-01-15 Initial version.


CONFIDENTIAL