Skip to content

Commit

Permalink
Added build instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
mattiasgustavsson committed May 28, 2022
1 parent a5b22d0 commit aaa5457
Showing 1 changed file with 52 additions and 0 deletions.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

0 comments on commit aaa5457

Please sign in to comment.