diff --git a/README.md b/README.md index a3e7a54..cf091be 100644 --- a/README.md +++ b/README.md @@ -2,3 +2,55 @@ # template_project Basic setup for building something with app.h on Windows/Linux/Mac/Web + +## Building + +No build system is used, simply call the compiler from the commandline. + + +### Windows + +From a Visual Studio Developer Command Prompt, do: +``` + cl source\main.c +``` + + +### Mac + +``` + clang source/main.c `sdl2-config --libs --cflags` -lGLEW -framework OpenGL -lpthread +``` + +SDL2 and GLEW are required - if you don't have them installed you can do so with Homebrew by running +``` + brew install sdl2 glew +``` + + +### Linux + +``` + gcc source/main.c `sdl2-config --libs --cflags` -lGLEW -lGL -lm -lpthread +``` + +SDL2 and GLEW are required - if you don't have them installed you can do so on Ubuntu (or wherever `apt-get` is available) by running +``` + sudo apt-get install libsdl2-dev + sudo apt-get install libglew-dev +``` + + +### WebAssembly + +Using WAjic: +``` + wasm\node wasm\wajicup.js source/main.c main.html +``` +You can embed asset files in the process with the -embed parameter. + +A WebAssembly build environment is required. You can download it (for Windows) here: [releases/tag/wasm-env]([../../releases/tag/wasm-env](https://github.com/mattiasgustavsson/dos-like/releases/tag/wasm-env). +Unzip it so that the `wasm` folder in the zip file is at your repository root. + +The wasm build environment is a compact distribution of [node](https://nodejs.org/en/download/), [clang/wasm-ld](https://releases.llvm.org/download.html), +[WAjic](https://github.com/schellingb/wajic) and [wasm system libraries](https://github.com/emscripten-core/emscripten/tree/main/system).