chore: simplify Makefile prefix

main
Sean McBride 4 years ago
parent f6bc233e83
commit f99050706e

@ -11,8 +11,6 @@ SYS_NAME='sledge'
# /sledge # /sledge
HOST_SYS_MOUNT=${HOST_SYS_MOUNT:-"/${SYS_NAME}"} HOST_SYS_MOUNT=${HOST_SYS_MOUNT:-"/${SYS_NAME}"}
# SYS_WASMCEPTION='silverfish/wasmception'
# sledge # sledge
SYS_DOC_NAME=${SYS_NAME} SYS_DOC_NAME=${SYS_NAME}

@ -28,9 +28,9 @@ SYS_SRC_PREFIX=${SYS_SRC_PREFIX:-"/${SYS_NAME}"}
# The release directory containing the binary of the aWsm compiler # The release directory containing the binary of the aWsm compiler
SYS_COMPILER_REL_DIR=${SYS_COMPILER_REL_DIR:-"${SYS_SRC_PREFIX}/${COMPILER}/target/release"} SYS_COMPILER_REL_DIR=${SYS_COMPILER_REL_DIR:-"${SYS_SRC_PREFIX}/${COMPILER}/target/release"}
# /opt/sledge/bin? # /opt/sledge/bin
SYS_BIN_DIR=${SYS_BIN_DIR:-"${SYS_PREFIX}/bin"} SYS_BIN_DIR=${SYS_BIN_DIR:-"${SYS_PREFIX}/bin"}
# /opt/sledge/lib? # /opt/sledge/lib
SYS_LIB_DIR=${SYS_LIB_DIR:-"${SYS_PREFIX}/lib"} SYS_LIB_DIR=${SYS_LIB_DIR:-"${SYS_PREFIX}/lib"}
# The first argument can be either wasi or wasmception. This determines the system interface used # The first argument can be either wasi or wasmception. This determines the system interface used
@ -57,12 +57,9 @@ fi
rm -f "${SYS_BIN_DIR}"/* rm -f "${SYS_BIN_DIR}"/*
install -d -v "$SYS_BIN_DIR" || exit 1 install -d -v "$SYS_BIN_DIR" || exit 1
# Link each of the binaries in the system bin directory # Link the Awsm compiler. Rename to awsm if still using legacy "silverfish" name
BINS=${COMPILER_EXECUTABLE} # /sledge/awsm/target/release/silverfish /opt/sledge/bin/awsm
for bin in $BINS; do ln -sfv "${SYS_COMPILER_REL_DIR}/${COMPILER_EXECUTABLE}" "${SYS_BIN_DIR}/awsm"
# i.e. ./silverfish/target/release/silverfish -> /opt/sledge/bin/silverfish
ln -sfv "${SYS_COMPILER_REL_DIR}/${bin}" "${SYS_BIN_DIR}/${bin}"
done
for file in clang clang++; do for file in clang clang++; do
wrapper_file="$(mktemp)" wrapper_file="$(mktemp)"

@ -1,4 +1,3 @@
/* code from https://github.com/gwsystems/silverfish/blob/master/runtime/runtime.c */
#include <assert.h> #include <assert.h>
#include <math.h> #include <math.h>
#include <types.h> #include <types.h>

@ -1,5 +1,3 @@
/* https://github.com/gwsystems/silverfish/blob/master/runtime/memory/64bit_nix.c */
#include <assert.h> #include <assert.h>
#include "types.h" #include "types.h"

@ -1,4 +1,3 @@
/* https://github.com/gwsystems/silverfish/blob/master/runtime/libc/libc_backing.c */
#include <assert.h> #include <assert.h>
#include <ck_pr.h> #include <ck_pr.h>
#include <math.h> #include <math.h>

@ -1,4 +1,3 @@
/* Code from https://github.com/gwsystems/silverfish/blob/master/runtime/memory/64bit_nix.c */
#include "current_sandbox.h" #include "current_sandbox.h"
#include "panic.h" #include "panic.h"
#include "runtime.h" #include "runtime.h"

@ -22,9 +22,9 @@ clean:
@mkdir -p ${TMP_DIR} @mkdir -p ${TMP_DIR}
@echo "Compiling $(@:%_rt=%)" @echo "Compiling $(@:%_rt=%)"
${WASMCC} ${$(@:%_rt=%)_CFLAGS} ${WASMCFLAGS} ${OPTFLAGS} $(@:%_rt=%)/*.c $(AWSM_DUMMY) -o ${TMP_DIR}/$(@:%_rt=%).wasm ${WASMCC} ${$(@:%_rt=%)_CFLAGS} ${WASMCFLAGS} ${OPTFLAGS} $(@:%_rt=%)/*.c $(AWSM_DUMMY) -o ${TMP_DIR}/$(@:%_rt=%).wasm
${AWSM_EXECUTABLE} ${TMP_DIR}/$(@:%_rt=%).wasm -o ${TMP_DIR}/$(@:%_rt=%).bc ${AWSM_NAME} ${TMP_DIR}/$(@:%_rt=%).wasm -o ${TMP_DIR}/$(@:%_rt=%).bc
${CC} ${CFLAGS} ${OPTFLAGS} -D${USE_MEM} -D${ARCH} ${TMP_DIR}/$(@:%_rt=%).bc ${AWSM_MEMC} ${AWSM_RT_LIBC} ${AWSM_RT_ENV} ${AWSM_RT_RT} -lm -o ${TMP_DIR}/$(@:%_rt=%)_wasm.out ${CC} ${CFLAGS} ${OPTFLAGS} -D${USE_MEM} -D${ARCH} ${TMP_DIR}/$(@:%_rt=%).bc ${AWSM_MEMC} ${AWSM_RT_LIBC} ${AWSM_RT_ENV} ${AWSM_RT_RT} -lm -o ${TMP_DIR}/$(@:%_rt=%)_wasm.out
${AWSM_EXECUTABLE} --inline-constant-globals --runtime-globals ${TMP_DIR}/$(@:%_rt=%).wasm -o ${TMP_DIR}/$(@:%_rt=%).bc ${AWSM_NAME} --inline-constant-globals --runtime-globals ${TMP_DIR}/$(@:%_rt=%).wasm -o ${TMP_DIR}/$(@:%_rt=%).bc
${CC} --shared -fPIC ${OPTFLAGS} -I${SLEDGE_RT_INC} -D${USE_MEM} ${TMP_DIR}/$(@:%_rt=%).bc ${SLEDGE_MEMC} ${SLEDGE_WASMISA} -o ${TMP_DIR}/$(@:%_rt=%)_wasm.so ${CC} --shared -fPIC ${OPTFLAGS} -I${SLEDGE_RT_INC} -D${USE_MEM} ${TMP_DIR}/$(@:%_rt=%).bc ${SLEDGE_MEMC} ${SLEDGE_WASMISA} -o ${TMP_DIR}/$(@:%_rt=%)_wasm.so
@cp ${TMP_DIR}/$(@:%_rt=%)_wasm.so ${SLEDGE_BIN_DIR} @cp ${TMP_DIR}/$(@:%_rt=%)_wasm.so ${SLEDGE_BIN_DIR}
# @rm -rf ${TMP_DIR} # @rm -rf ${TMP_DIR}

@ -15,11 +15,8 @@ TMP_DIR=tmp/
WASMLINKFLAGS=-Wl,-z,stack-size=524288,--allow-undefined,--no-threads,--stack-first,--no-entry,--export-all,--export=main,--export=dummy WASMLINKFLAGS=-Wl,-z,stack-size=524288,--allow-undefined,--no-threads,--stack-first,--no-entry,--export-all,--export=main,--export=dummy
WASMCFLAGS=${WASMLINKFLAGS} -nostartfiles WASMCFLAGS=${WASMLINKFLAGS} -nostartfiles
# aWsm Compiler Runtime (WebAssembly -> Native) # aWsm Compiler Runtime (WebAssembly -> LLVM Bitcode)
# Currently, the component which compiles WebAssembly modules to native code, is named aWsm
# However, the executable itself still currently retains the older name silverfish
AWSM_NAME=awsm AWSM_NAME=awsm
AWSM_EXECUTABLE=silverfish
AWSM_BASE_DIR=../../${AWSM_NAME} AWSM_BASE_DIR=../../${AWSM_NAME}
AWSM_RT_DIR=${AWSM_BASE_DIR}/runtime/ AWSM_RT_DIR=${AWSM_BASE_DIR}/runtime/
AWSM_RT_MEM=${AWSM_RT_DIR}/memory/ AWSM_RT_MEM=${AWSM_RT_DIR}/memory/

Loading…
Cancel
Save