|
|
@ -3,48 +3,33 @@ include Makefile.inc
|
|
|
|
BENCH_DIR=../../${WASM2OBJ_NAME}/code_benches
|
|
|
|
BENCH_DIR=../../${WASM2OBJ_NAME}/code_benches
|
|
|
|
|
|
|
|
|
|
|
|
TESTS=fibonacci empty work work1k work10k work100k work1m
|
|
|
|
TESTS=fibonacci empty work work1k work10k work100k work1m
|
|
|
|
#TESTS=forever filesys sockserver sockclient empty
|
|
|
|
TESTS+=forever filesys sockserver sockclient empty
|
|
|
|
|
|
|
|
|
|
|
|
TESTSRT=$(TESTS:%=%_rt)
|
|
|
|
TESTSRT=$(TESTS:%=%_rt)
|
|
|
|
BENCHES=basic_math binarytrees bitcount blowfish crc dijkstra fft function_pointers \
|
|
|
|
BENCHES=adpcm basic_math binarytrees bitcount blowfish crc dijkstra fft function_pointers \
|
|
|
|
gsm libjpeg mandelbrot patricia pgp qsort rsynth sha sqlite stringsearch susan
|
|
|
|
|
|
|
|
#BENCHES=adpcm basic_math binarytrees bitcount blowfish crc dijkstra fft function_pointers \
|
|
|
|
|
|
|
|
gsm libjpeg mandelbrot patricia pgp qsort rsynth sha sqlite stringsearch susan
|
|
|
|
gsm libjpeg mandelbrot patricia pgp qsort rsynth sha sqlite stringsearch susan
|
|
|
|
BENCHESSF=$(BENCHES:%=%_sf)
|
|
|
|
|
|
|
|
|
|
|
|
# adpcm_CFLAGS=-Wno-implicit-int -Wno-implicit-function-declaration
|
|
|
|
adpcm_CFLAGS=-Wno-implicit-int -Wno-implicit-function-declaration
|
|
|
|
# crc_CFLAGS=-Wno-implicit-int -Wno-format
|
|
|
|
crc_CFLAGS=-Wno-implicit-int -Wno-format
|
|
|
|
# dijkstra_CFLAGS=-Wno-return-type
|
|
|
|
dijkstra_CFLAGS=-Wno-return-type
|
|
|
|
# gsm_CFLAGS=-DSASR -Wno-everything
|
|
|
|
gsm_CFLAGS=-DSASR -Wno-everything
|
|
|
|
# libjpeg_CFLAGS=-Wno-incompatible-library-redeclaration -Wno-implicit-function-declaration -Wno-shift-negative-value
|
|
|
|
libjpeg_CFLAGS=-Wno-incompatible-library-redeclaration -Wno-implicit-function-declaration -Wno-shift-negative-value
|
|
|
|
# pgp_CFLAGS=-DUNIX -D_BSD -DPORTABLE -DUSE_NBIO -DMPORTABLE -I${BENCH_DIR}/pgp/ -Wno-everything
|
|
|
|
pgp_CFLAGS=-DUNIX -D_BSD -DPORTABLE -DUSE_NBIO -DMPORTABLE -I${BENCH_DIR}/pgp/ -Wno-everything
|
|
|
|
# rsynth_CFLAGS=-I${BENCH_DIR}/rsynth -Wno-everything -I/usr/local/include
|
|
|
|
rsynth_CFLAGS=-I${BENCH_DIR}/rsynth -Wno-everything -I/usr/local/include
|
|
|
|
# sha_CLFAGS=-Wno-everything
|
|
|
|
sha_CLFAGS=-Wno-everything
|
|
|
|
|
|
|
|
susan_CFLAGS=-Wno-everything
|
|
|
|
susan_CFLAGS=-Wno-everything
|
|
|
|
|
|
|
|
|
|
|
|
.PHONY: all clean rttests sftests
|
|
|
|
.PHONY: all clean rttests
|
|
|
|
|
|
|
|
|
|
|
|
all: rttests sftests
|
|
|
|
all: rttests
|
|
|
|
@echo "Compilation done!"
|
|
|
|
@echo "Compilation done!"
|
|
|
|
|
|
|
|
|
|
|
|
sftests: $(BENCHESSF)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
rttests: $(TESTSRT)
|
|
|
|
rttests: $(TESTSRT)
|
|
|
|
|
|
|
|
|
|
|
|
clean:
|
|
|
|
clean:
|
|
|
|
@rm -rf ${TMP_DIR}
|
|
|
|
@rm -rf ${TMP_DIR}
|
|
|
|
#@rm -f ${BIN_DIR}/*_wasm.so
|
|
|
|
#@rm -f ${BIN_DIR}/*_wasm.so
|
|
|
|
|
|
|
|
|
|
|
|
%_sf:
|
|
|
|
|
|
|
|
@mkdir -p ${TMP_DIR}
|
|
|
|
|
|
|
|
@echo "Compiling $(@:%_sf=%)"
|
|
|
|
|
|
|
|
${WASMCC} ${$(@:%_sf=%)_CFLAGS} ${WASMCFLAGS} ${OPTFLAGS} ${BENCH_DIR}/$(@:%_sf=%)/*.c $(WASM2OBJ_DUMMY) -o ${TMP_DIR}/$(@:%_sf=%).wasm
|
|
|
|
|
|
|
|
${WASM2OBJ_EXECUTABLE} ${TMP_DIR}/$(@:%_sf=%).wasm -o ${TMP_DIR}/$(@:%_sf=%).bc
|
|
|
|
|
|
|
|
${CC} ${CFLAGS} ${OPTFLAGS} -D${USE_MEM} -D${ARCH} ${TMP_DIR}/$(@:%_sf=%).bc ${WASM2OBJ_MEMC} ${WASM2OBJ_RT_LIBC} ${WASM2OBJ_RT_ENV} ${WASM2OBJ_RT_RT} -lm -o ${TMP_DIR}/$(@:%_sf=%)_wasm.out
|
|
|
|
|
|
|
|
${WASM2OBJ_EXECUTABLE} --inline-constant-globals --runtime-globals ${TMP_DIR}/$(@:%_sf=%).wasm -o ${TMP_DIR}/$(@:%_sf=%).bc
|
|
|
|
|
|
|
|
${CC} --shared -fPIC ${OPTFLAGS} -I${SERVERLESS_RT_INC} -D${USE_MEM} ${TMP_DIR}/$(@:%_sf=%).bc ${SERVERLESS_MEMC} ${SERVERLESS_WASMISA} -lm -o ${TMP_DIR}/$(@:%_sf=%)_wasm.so
|
|
|
|
|
|
|
|
@cp ${TMP_DIR}/$(@:%_sf=%)_wasm.so ${SERVERLESS_BIN_DIR}
|
|
|
|
|
|
|
|
# @rm -rf ${TMP_DIR}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%_rt:
|
|
|
|
%_rt:
|
|
|
|
@mkdir -p ${TMP_DIR}
|
|
|
|
@mkdir -p ${TMP_DIR}
|
|
|
|
@echo "Compiling $(@:%_rt=%)"
|
|
|
|
@echo "Compiling $(@:%_rt=%)"
|
|
|
|