This Makefile provides a simple, reproducible workflow for building Ebitengine Go projects for both native desktop and WebAssembly (WASM) targets. It is designed for indie game development with automated version management and CI/CD deployment support.
The workflow is based on four core ideas:
metadata.json or git commit hashThis approach keeps the build process simple while supporting both desktop and web platforms.
| Variable | Description | Default |
|---|---|---|
PROJECT |
Project name (used in output filenames) | ebitenginedemo |
BIN_DIR |
Directory for native executable | bin |
DIST_DIR |
Directory for WASM and packaged artifacts | dist |
WASM_NAME |
WebAssembly filename | game.wasm |
VERSION_FILE |
File storing version for CI/CD | .version |
INDEX_HTML_URL |
URL to download index.html template | Remote ebitengine-tools repo |
make build
bin/ebitenginedemo (or bin/<PROJECT> if PROJECT is changed)go build with current platform (Linux, macOS, Windows)make wasm
dist/game.wasm)wasm_exec.js) to dist/make export VERSION=1.0.0
VERSION variable.make wasm)index.html template from remote repositorygame.wasmwasm_exec.jsindex.htmlebitenginedemo-1.0.0.html.zipmake watch
fswatch to be installed.)make clean
bin/ directory (native executable)dist/ directory (WASM, runtime, packaged files)These targets are designed for automated continuous integration and deployment workflows.
make ci-versionmetadata.json (if exists) or uses git short commit hashmain or master, prefixes version as dev-<version>-<branch>.version file for use in subsequent CI stepsExample outputs:
1.0.0dev-1.0.0-feature-branchmake ci-export.version filemake export with the stored VERSIONmake ci-upload.version filemetadata.json to ebitenginedemo-<version>.metadata.jsonDROPAREA_SSH_PASSWORD - SSH passwordDROPAREA_PORT - SSH portDROPAREA_USER - SSH usernameDROPAREA_HOST - Server hostnameDROPAREA_TARGET_PATH - Target directory on servermake ci-update.version fileebitengineebitengine.versionUPDATE_SERVER - Update server URLUPDATE_SECRET - Authentication secret| File | Description |
|---|---|
bin/ebitenginedemo |
Native executable for current OS |
dist/game.wasm |
WebAssembly binary |
dist/wasm_exec.js |
Go WASM runtime helper |
ebitenginedemo-<version>.html.zip |
Packaged web build (index.html + WASM + runtime) |
makego (1.11+)curl (for downloading index.html)zip (for packaging exports)fswatch (only for watch mode)sshpass and scp (for ci-upload target)jq (for parsing metadata.json in ci-version)git (for version fallback and branch detection in ci-version)MIT License — free to use, modify, and redistribute.