2021-08-22 22:32:18 +00:00
|
|
|
|
.PHONY: help
|
|
|
|
|
help:
|
|
|
|
|
@echo
|
2022-04-21 03:37:05 +00:00
|
|
|
|
@echo "Virtual Boy Emulator - April 20, 2022"
|
2021-08-22 22:32:18 +00:00
|
|
|
|
@echo
|
|
|
|
|
@echo "Target build environment is any Debian with the following packages:"
|
|
|
|
|
@echo " emscripten"
|
|
|
|
|
@echo " gcc"
|
|
|
|
|
@echo " openjdk-17-jdk"
|
|
|
|
|
@echo
|
|
|
|
|
@echo "Available make targets:"
|
2021-08-30 02:14:06 +00:00
|
|
|
|
@echo " build Perform all build commands"
|
2021-08-22 22:32:18 +00:00
|
|
|
|
@echo " bundle Package the repository for HTML distribution"
|
|
|
|
|
@echo " clean Remove output files"
|
|
|
|
|
@echo " core Check the C core source for compiler warnings"
|
|
|
|
|
@echo " wasm Build the WebAssembly core module"
|
|
|
|
|
@echo
|
|
|
|
|
|
2021-08-30 02:14:06 +00:00
|
|
|
|
.PHONY: build
|
|
|
|
|
build:
|
|
|
|
|
@echo " Check C core library for style issues"
|
|
|
|
|
@make -s core
|
|
|
|
|
@echo " Build WebAssembly core module"
|
|
|
|
|
@make -s wasm
|
|
|
|
|
@echo " Bundle directory tree into HTML file"
|
|
|
|
|
@make -s bundle
|
|
|
|
|
|
2021-08-22 22:32:18 +00:00
|
|
|
|
.PHONY: bundle
|
|
|
|
|
bundle:
|
|
|
|
|
@java app/Bundle.java vbemu
|
|
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
|
clean:
|
2022-04-15 01:51:09 +00:00
|
|
|
|
@rm -f vbemu_*.html app/core/core.wasm
|
2021-08-22 22:32:18 +00:00
|
|
|
|
|
|
|
|
|
.PHONY: core
|
|
|
|
|
core:
|
2021-08-30 02:14:06 +00:00
|
|
|
|
@gcc core/vb.c -I core \
|
|
|
|
|
-fsyntax-only -Wall -Wextra -Werror -Wpedantic -std=c90
|
2021-09-02 00:16:22 +00:00
|
|
|
|
@gcc core/vb.c -I core -D VB_LITTLEENDIAN \
|
2021-08-30 02:14:06 +00:00
|
|
|
|
-fsyntax-only -Wall -Wextra -Werror -Wpedantic -std=c90
|
2022-04-21 03:37:05 +00:00
|
|
|
|
@emcc core/vb.c -I core \
|
|
|
|
|
-fsyntax-only -Wall -Wextra -Werror -Wpedantic -std=c90
|
|
|
|
|
@emcc core/vb.c -I core -D VB_LITTLEENDIAN \
|
|
|
|
|
-fsyntax-only -Wall -Wextra -Werror -Wpedantic -std=c90
|
2021-08-22 22:32:18 +00:00
|
|
|
|
|
|
|
|
|
.PHONY: wasm
|
|
|
|
|
wasm:
|
2022-04-15 01:51:09 +00:00
|
|
|
|
@emcc -o app/core/core.wasm wasm/wasm.c core/vb.c -Icore \
|
|
|
|
|
-D VB_LITTLEENDIAN --no-entry -O2 -flto -s WASM=1 \
|
|
|
|
|
-D "VB_EXPORT=__attribute__((used))" \
|
|
|
|
|
-s EXPORTED_RUNTIME_METHODS=[] -s ALLOW_MEMORY_GROWTH \
|
|
|
|
|
-s MAXIMUM_MEMORY=4GB -fno-strict-aliasing
|
|
|
|
|
@rm -f app/core/*.wasm.tmp*
|
2023-03-08 16:42:27 +00:00
|
|
|
|
|