This Makefile provides a simple, reproducible workflow for building Love2D projects for both native distribution and web-based execution via
love.js. It is designed for indie game development with automated version management and CI/CD deployment support.
The workflow is based on four core ideas:
.love files.love package with love.jsmetadata.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) | love2ddemo |
BIN_DIR |
Directory for build-time checks | bin |
DIST_DIR |
Directory for packaged artifacts | dist |
WEB_DIR |
Directory for web-specific files | dist/web |
LOVE_NAME |
Name of the generated .love file | love2ddemo.love |
VERSION_FILE |
File storing version for CI/CD | .version |
make build
bin/ directory exists.lua files using luacmake love
.love archive.git, Makefile, and the dist/ folderdist/love2ddemo.lovemake web
love target to be run.love.js engine from a remote repositorydist/web/index.html and player.js to correctly load the game and reference the proper project pathsmake export VERSION=1.0.0
VERSION variable..love package and the web versionlove2ddemo-1.0.0.love.ziplove2ddemo-1.0.0.html.zipmake watch
.lua filesbuild target on any changefswatch to be installedmake clean
bin/ directorydist/ directoryThese 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 stepsmake ci-export.version filemake export with the stored VERSIONmake ci-upload.version filemetadata.json via SCP to a remote serverDROPAREA_SSH_PASSWORD - SSH passwordDROPAREA_PORT - SSH portDROPAREA_USER - SSH usernameDROPAREA_HOST - Server hostnameDROPAREA_TARGET_PATH - Target directory on servermake ci-update.version filelove and love-web platformsUPDATE_SERVER - Update server URLUPDATE_SECRET - Authentication secret| File | Description |
|---|---|
dist/love2ddemo.love |
Standard Love2D package |
love2ddemo-<version>.love.zip |
Versioned ZIP of the .love package |
love2ddemo-<version>.html.zip |
Versioned ZIP of the web build |
love2ddemo-<version>.metadata.json |
Project metadata for distribution |
makeluac (for syntax checking)zip (for packaging archives)curl (for downloading love.js)unzip (for extracting love.js)sed (for patching web files)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)