2022-01-31 15:00:00 -05:00
|
|
|
include help-system.mk
|
|
|
|
|
2022-02-04 09:52:09 -05:00
|
|
|
FEATURES?=default
|
|
|
|
|
2022-01-31 15:00:00 -05:00
|
|
|
run: $(call print-help, run, Runs the binary in develop mode)
|
2022-02-04 09:52:09 -05:00
|
|
|
cargo run --features $(FEATURES) --no-default-features
|
|
|
|
|
|
|
|
run-debug: $(call print-help, run-debug, Runs the binary with the 'debug' feature, which shows map generation, and other debug functionality)
|
|
|
|
cargo run --features debug
|
2021-12-01 11:03:27 -05:00
|
|
|
|
2022-01-31 15:00:00 -05:00
|
|
|
run-pi: $(call print-help, run-pi, Sets appropriate flags so that the game runs on a Raspberry Pi)
|
2022-02-04 09:52:09 -05:00
|
|
|
MESA_GL_VERSION_OVERRIDE=3.0 MESA_GLSL_VERSION_OVERRIDE=330 cargo run --features $(FEATURES)
|
2021-11-17 15:56:21 -05:00
|
|
|
|
2022-02-03 11:46:29 -05:00
|
|
|
run-curses: $(call print-help, run-curses, Run the game in a console window via the curses library)
|
|
|
|
cargo run --features curses --no-default-features
|
|
|
|
|
|
|
|
build:
|
|
|
|
cargo build
|
|
|
|
|
|
|
|
build-wasm: $(call print-help, build-wasm, Build the webassembly version of the game)
|
2022-02-04 09:52:09 -05:00
|
|
|
cargo build --release --target wasm32-unknown-unknown --features wasm
|
2022-02-03 11:46:29 -05:00
|
|
|
wasm-bindgen target/wasm32-unknown-unknown/release/roguelike_tutorial.wasm --out-dir wasm --no-modules --no-typescript
|
|
|
|
|
|
|
|
build-wasm-dev: $(call print-help, build-wasm-dev, Build the webassembly version of the game (dev version))
|
2022-02-04 10:34:11 -05:00
|
|
|
cargo build --target wasm32-unknown-unknown --features wasm,debug
|
2022-02-03 11:46:29 -05:00
|
|
|
wasm-bindgen target/wasm32-unknown-unknown/debug/roguelike_tutorial.wasm --out-dir wasm --no-modules --no-typescript
|
|
|
|
|
2022-01-31 15:00:00 -05:00
|
|
|
clean: $(call print-help, clean, Removes save file and compilation artifacts)
|
2021-12-24 14:27:44 -05:00
|
|
|
rm -f savegame.json
|
2021-11-17 15:56:21 -05:00
|
|
|
cargo clean
|
|
|
|
|
2022-01-31 15:00:00 -05:00
|
|
|
check: $(call print-help, check, Check code syntax)
|
2022-02-04 09:52:09 -05:00
|
|
|
cargo check --features $(FEATURES)
|
2021-12-01 11:42:17 -05:00
|
|
|
|
2022-02-03 11:46:29 -05:00
|
|
|
check-wasm: $(call print-help, check-wasm, Check code syntax for webassembly build)
|
2022-02-04 09:52:09 -05:00
|
|
|
cargo check --target wasm32-unknown-unknown --features wasm
|
2022-02-03 11:46:29 -05:00
|
|
|
|
2022-01-31 15:00:00 -05:00
|
|
|
lint: $(call print-help, lint, Check code syntax and style)
|
2022-02-04 09:52:09 -05:00
|
|
|
cargo clippy --features $(FEATURES)
|
2021-11-19 11:32:03 -05:00
|
|
|
|
2022-01-31 15:00:00 -05:00
|
|
|
fmt: $(call print-help, fmt, Runs formatter on code)
|
2021-12-10 20:16:48 -05:00
|
|
|
cargo +nightly fmt
|
2021-11-17 15:56:21 -05:00
|
|
|
|
2022-02-02 09:45:47 -05:00
|
|
|
fix: $(call print-help, fix, Fixes some warnings, then runs the formatter)
|
2021-12-01 11:03:27 -05:00
|
|
|
cargo fix --allow-dirty --allow-staged
|
2022-02-03 11:46:29 -05:00
|
|
|
make fmt
|
2021-12-01 11:03:27 -05:00
|
|
|
|
2022-01-31 15:00:00 -05:00
|
|
|
docs: $(call print-help, docs, Generates code docs)
|
2022-02-10 11:54:57 -05:00
|
|
|
cargo doc --features $(FEATURES) --document-private-items
|
2022-01-21 15:55:13 -05:00
|
|
|
|
2022-02-03 11:46:29 -05:00
|
|
|
.phony: run-pi clean check run fmt fix lint docs build build-wasm check-wasm build-wasm-dev
|