Spaces:
Running
Running
Download src/Makefile from SegerEnd/basic-pitch-wasm: direct link, hf CLI and curl.
- Browser
- Download file 814 Bytes
-
https://huggingface.co/spaces/SegerEnd/basic-pitch-wasm/resolve/main/src/Makefile
- Command line
-
hf download hf://spaces/SegerEnd/basic-pitch-wasm/src/Makefile
-
curl -L -o Makefile https://huggingface.co/spaces/SegerEnd/basic-pitch-wasm/resolve/main/src/Makefile
814 Bytes
| # make the command-line tool (basicpitch) and a static library (libbp.a) | |
| # make wasm ../basicpitch/bp.wasm and bp-plain.wasm, the model for the browser (notes.js does the rest) | |
| CC ?= cc | |
| CFLAGS ?= -O3 | |
| EXPORTS = _bp_load,_bp_unload,_bp_run,_bp_frame_count,_bp_transcribe,_bp_window_count,_bp_window,_malloc,_free | |
| EMFLAGS = -O3 --no-entry -s STANDALONE_WASM=1 -s ALLOW_MEMORY_GROWTH=1 -s EXPORTED_FUNCTIONS=$(EXPORTS) | |
| all: basicpitch libbp.a | |
| basicpitch: cli.c bp.c notes.c bp.h | |
| $(CC) $(CFLAGS) cli.c bp.c notes.c -o $@ -lm | |
| libbp.a: bp.c notes.c bp.h | |
| $(CC) $(CFLAGS) -c bp.c notes.c | |
| ar rcs $@ bp.o notes.o | |
| wasm: bp.c bp.h | |
| emcc $(EMFLAGS) -msimd128 bp.c -o ../basicpitch/bp.wasm | |
| emcc $(EMFLAGS) bp.c -o ../basicpitch/bp-plain.wasm | |
| clean: | |
| rm -f basicpitch libbp.a *.o | |