fix and adjust cmd and web
This commit is contained in:
parent
f128116871
commit
72aa131585
@ -9,14 +9,14 @@ else
|
|||||||
BINDIR = ${PREFIX}/bin
|
BINDIR = ${PREFIX}/bin
|
||||||
endif
|
endif
|
||||||
|
|
||||||
MAIN_DIR := $(or $(MAIN_DIR),src)
|
COMMON_DIR := $(or $(COMMON_DIR),.)
|
||||||
DATA_DIR := $(or $(DATA_DIR),src)
|
DATA_DIR := $(or $(DATA_DIR),.)
|
||||||
PLUGIN_DIR := $(or $(PLUGIN_DIR),src)
|
PLUGIN_DIR := $(or $(PLUGIN_DIR),src)
|
||||||
|
|
||||||
CC = gcc
|
CC = gcc
|
||||||
|
|
||||||
CFLAGS = -O3 -Wall -Wpedantic -Wextra
|
CFLAGS = -O3 -Wall -Wpedantic -Wextra
|
||||||
CFLAGS_ALL = -I${DATA_DIR} -I${PLUGIN_DIR} -I${TINYWAV_DIR} -I${MIDI_PARSER_DIR}/include -fPIC ${CFLAGS} ${CFLAGS_EXTRA}
|
CFLAGS_ALL = -I${DATA_DIR}/src -I${PLUGIN_DIR} -I${TINYWAV_DIR} -I${MIDI_PARSER_DIR}/include -fPIC ${CFLAGS} ${CFLAGS_EXTRA}
|
||||||
|
|
||||||
LDFLAGS =
|
LDFLAGS =
|
||||||
LDFLAGS_ALL = ${LDFLAGS} ${LDFLAGS_EXTRA}
|
LDFLAGS_ALL = ${LDFLAGS} ${LDFLAGS_EXTRA}
|
||||||
@ -30,19 +30,19 @@ ifeq ($(UNAME_S), Darwin)
|
|||||||
build/${PROGRAM}: build/tmp/x86_64 build/tmp/arm64
|
build/${PROGRAM}: build/tmp/x86_64 build/tmp/arm64
|
||||||
lipo -create -output $@ $^
|
lipo -create -output $@ $^
|
||||||
|
|
||||||
build/tmp/x86_64: ${MAIN_DIR}/main.c ${DATA_DIR}/data.h ${PLUGIN_DIR}/plugin.h ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c | build/tmp
|
build/tmp/x86_64: ${COMMON_DIR}/src/main.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c | build/tmp
|
||||||
${CC} ${MAIN_DIR}/main.c ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch x86_64
|
${CC} ${COMMON_DIR}/src/main.c ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch x86_64
|
||||||
|
|
||||||
build/tmp/arm64: ${MAIN_DIR}/main.c ${DATA_DIR}/data.h ${PLUGIN_DIR}/plugin.h ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c | build/tmp
|
build/tmp/arm64: ${COMMON_DIR}/main.c ${DATA_DIR}/data.h ${PLUGIN_DIR}/plugin.h ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c | build/tmp
|
||||||
${CC} ${MAIN_DIR}/main.c ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch arm64
|
${CC} ${COMMON_DIR}/src/main.c ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL} -arch arm64
|
||||||
|
|
||||||
build/tmp:
|
build/tmp:
|
||||||
mkdir -p $@
|
mkdir -p $@
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
build/${PROGRAM}: ${MAIN_DIR}/main.c ${DATA_DIR}/data.h ${PLUGIN_DIR}/plugin.h ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c | build
|
build/${PROGRAM}: ${COMMON_DIR}/src/main.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c | build
|
||||||
${CC} ${MAIN_DIR}/main.c ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL}
|
${CC} ${COMMON_DIR}/src/main.c ${TINYWAV_DIR}/tinywav.c ${MIDI_PARSER_DIR}/src/midi-parser.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL}
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
BUNDLE_NAME := {{=it.product.bundleName}}
|
BUNDLE_NAME := {{=it.product.bundleName}}
|
||||||
CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.cmd_make.cflags ? it.cmd_make.cflags : ""}}
|
CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.cmd_make.cflags ? it.cmd_make.cflags : ""}}
|
||||||
LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.cmd_make.ldflags ? it.cmd_make.ldflags : ""}}
|
LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.cmd_make.ldflags ? it.cmd_make.ldflags : ""}}
|
||||||
MAIN_DIR := {{=it.cmd_make && it.cmd_make.mainDir ? it.cmd_make.mainDir : (it.make && it.make.mainDir ? it.make.mainDir : "")}}
|
COMMON_DIR := {{=it.cmd_make && it.cmd_make.commonDir ? it.cmd_make.commonDir : (it.make && it.make.commonDir ? it.make.commonDir : "")}}
|
||||||
DATA_DIR := {{=it.cmd_make && it.cmd_make.dataDir ? it.cmd_make.dataDir : (it.make && it.make.dataDir ? it.make.dataDir : "")}}
|
DATA_DIR := {{=it.cmd_make && it.cmd_make.dataDir ? it.cmd_make.dataDir : (it.make && it.make.dataDir ? it.make.dataDir : "")}}
|
||||||
PLUGIN_DIR := {{=it.cmd_make && it.cmd_make.pluginDir ? it.cmd_make.pluginDir : (it.make && it.make.pluginDir ? it.make.pluginDir : "")}}
|
PLUGIN_DIR := {{=it.cmd_make && it.cmd_make.pluginDir ? it.cmd_make.pluginDir : (it.make && it.make.pluginDir ? it.make.pluginDir : "")}}
|
||||||
TINYWAV_DIR := {{=it.cmd_make.tinywavDir}}
|
TINYWAV_DIR := {{=it.cmd_make.tinywavDir}}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
ALL += build/index.html build/cert.pem build/key.pem
|
ALL += build/index.html build/cert.pem build/key.pem
|
||||||
|
|
||||||
build/index.html: src/index.html | build
|
build/index.html: ${DATA_DIR}/src/index.html | build
|
||||||
cp $^ $@
|
cp $^ $@
|
||||||
|
|
||||||
build/key.pem: build/cert.pem
|
build/key.pem: build/cert.pem
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
include vars.mk
|
include vars.mk
|
||||||
|
|
||||||
|
COMMON_DIR := $(or $(COMMON_DIR),.)
|
||||||
|
DATA_DIR := $(or $(DATA_DIR),.)
|
||||||
|
PLUGIN_DIR := $(or $(PLUGIN_DIR),src)
|
||||||
|
|
||||||
CC = clang
|
CC = clang
|
||||||
|
|
||||||
CFLAGS = -Ofast -Wall -Wpedantic -Wextra
|
CFLAGS = -Ofast -Wall -Wpedantic -Wextra
|
||||||
CFLAGS_ALL = --target=wasm32 -flto -fvisibility=hidden ${CFLAGS} ${CFLAGS_EXTRA}
|
CFLAGS_ALL = -I${COMMON_DIR}/src -I${DATA_DIR}/src -I${PLUGIN_DIR} --target=wasm32 -flto -fvisibility=hidden ${CFLAGS} ${CFLAGS_EXTRA}
|
||||||
|
|
||||||
LDFLAGS_ALL = \
|
LDFLAGS_ALL = \
|
||||||
-Wl,--allow-undefined \
|
-Wl,--allow-undefined \
|
||||||
@ -29,17 +33,17 @@ ALL = build/${BUNDLE_NAME}.wasm build/${BUNDLE_NAME}_processor.js build/${BUNDLE
|
|||||||
|
|
||||||
default: all
|
default: all
|
||||||
|
|
||||||
-include demo.mk
|
-include ${COMMON_DIR}/demo.mk
|
||||||
|
|
||||||
all: ${ALL}
|
all: ${ALL}
|
||||||
|
|
||||||
build/${BUNDLE_NAME}.wasm: src/data.h src/memset.h src/plugin.h src/walloc.h src/processor.c | build
|
build/${BUNDLE_NAME}.wasm: ${COMMON_DIR}/src/memset.h ${COMMON_DIR}/src/walloc.h ${COMMON_DIR}/src/processor.c ${DATA_DIR}/src/data.h ${PLUGIN_DIR}/plugin.h | build
|
||||||
${CC} src/processor.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL}
|
${CC} ${COMMON_DIR}/src/processor.c -o $@ ${CFLAGS_ALL} ${LDFLAGS_ALL}
|
||||||
|
|
||||||
build/${BUNDLE_NAME}_processor.js: src/processor.js | build
|
build/${BUNDLE_NAME}_processor.js: ${DATA_DIR}/src/processor.js | build
|
||||||
cp $^ $@
|
cp $^ $@
|
||||||
|
|
||||||
build/${BUNDLE_NAME}.js: src/module.js | build
|
build/${BUNDLE_NAME}.js: ${DATA_DIR}/src/module.js | build
|
||||||
cp $^ $@
|
cp $^ $@
|
||||||
|
|
||||||
build:
|
build:
|
||||||
|
@ -1,4 +1,7 @@
|
|||||||
BUNDLE_NAME := {{=it.product.bundleName}}
|
BUNDLE_NAME := {{=it.product.bundleName}}
|
||||||
CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.web_make && it.web_make.cflags ? it.web_make.cflags : ""}}
|
CFLAGS_EXTRA := {{=it.make && it.make.cflags ? it.make.cflags : ""}} {{=it.web_make && it.web_make.cflags ? it.web_make.cflags : ""}}
|
||||||
LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.web_make && it.web_make.ldflags ? it.web_make.ldflags : ""}}
|
LDFLAGS_EXTRA := {{=it.make && it.make.ldflags ? it.make.ldflags : ""}} {{=it.web_make && it.web_make.ldflags ? it.web_make.ldflags : ""}}
|
||||||
|
COMMON_DIR := {{=it.web_make && it.web_make.commonDir ? it.web_make.commonDir : (it.make && it.make.commonDir ? it.make.commonDir : "")}}
|
||||||
|
DATA_DIR := {{=it.web_make && it.web_make.dataDir ? it.web_make.dataDir : (it.make && it.make.dataDir ? it.make.dataDir : "")}}
|
||||||
|
PLUGIN_DIR := {{=it.web_make && it.web_make.pluginDir ? it.web_make.pluginDir : (it.make && it.make.pluginDir ? it.make.pluginDir : "")}}
|
||||||
HAS_MIDI_IN := {{=it.product.buses.filter(x => x.type == "midi" && x.direction == "input").length > 0 ? "yes" : "no"}}
|
HAS_MIDI_IN := {{=it.product.buses.filter(x => x.type == "midi" && x.direction == "input").length > 0 ? "yes" : "no"}}
|
||||||
|
@ -121,6 +121,8 @@ void processor_process(instance *i, int32_t n_samples) {
|
|||||||
#if DATA_PRODUCT_PARAMETERS_OUTPUT_N > 0
|
#if DATA_PRODUCT_PARAMETERS_OUTPUT_N > 0
|
||||||
for (size_t j = 0; j < DATA_PRODUCT_PARAMETERS_OUTPUT_N; j++)
|
for (size_t j = 0; j < DATA_PRODUCT_PARAMETERS_OUTPUT_N; j++)
|
||||||
i->out_params[j] = plugin_get_parameter(&i->p, param_out_index[j]);
|
i->out_params[j] = plugin_get_parameter(&i->p, param_out_index[j]);
|
||||||
|
#else
|
||||||
|
(void)plugin_get_parameter;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user