#!/bin/bash

set -e

INST=$HOME/soft/exm-sc14/v1/
TURBINE=$INST/turbine
LB=$INST/lb
CUTILS=$INST/c-utils
STC_INST=$INST/stc

source $TURBINE/scripts/turbine-build-config.sh

CC=cc
CFLAGS="-std=c99 -Wall -O2 ${TURBINE_INCLUDES}"
LDFLAGS="${TURBINE_LIBS}"

MKSTATIC=$TURBINE/scripts/mkstatic/mkstatic.tcl

${CC} ${CFLAGS} embarrassing.c  ${LDFLAGS} -o embarrassing 
${CC} ${CFLAGS} -D LOGNORM embarrassing.c  ${LDFLAGS} -o embarrassing_lognorm

STC=$STC_INST/bin/stc
STC_OPTLEVEL=${STC_OPTLEVEL:--O2}
STC_FLAGS="$STC_OPTLEVEL"
STC_FLAGS+=" -T no-engine"

${STC} ${STC_FLAGS} -C embarrassing_lognorm.ic embarrassing_lognorm.swift
${MKSTATIC} embarrassing_lognorm.manifest -c embarrassing_lognorm_tcl.c

# Statically link
${CC} ${CFLAGS} embarrassing_lognorm_tcl.c  ${LDFLAGS} -o embarrassing_lognorm_tcl

echo "OK."

#!/bin/bash

set -e

INST=$HOME/soft/exm-sc14/v1/
TURBINE=$INST/turbine
LB=$INST/lb
CUTILS=$INST/c-utils
STC_INST=$INST/stc

source $TURBINE/scripts/turbine-build-config.sh

CC=cc
CFLAGS="-std=c99 -Wall -O2 ${TURBINE_INCLUDES}"
LDFLAGS="${TURBINE_LIBS}"

MKSTATIC=$TURBINE/scripts/mkstatic/mkstatic.tcl

${CC} ${CFLAGS} embarrassing.c  ${LDFLAGS} -o embarrassing 
${CC} ${CFLAGS} -D LOGNORM embarrassing.c  ${LDFLAGS} -o embarrassing_lognorm

STC=$STC_INST/bin/stc

for OPT in 0 1 2 3
do
  STC_OPTLEVEL="-O$OPT"
  STC_FLAGS="$STC_OPTLEVEL"
  STC_FLAGS+=" -T no-engine"

  PREFIX=embarrassing_lognorm
  PREFIX_OPT=${PREFIX}.O${OPT}
  PREFIX_TCL=${PREFIX}_tcl.O${OPT}
  ${STC} ${STC_FLAGS} -C ${PREFIX_OPT}.ic ${PREFIX}.swift ${PREFIX_OPT}.tcl
  ${MKSTATIC} ${PREFIX}.manifest -c ${PREFIX_TCL}.c

  # Dynamically link
  ${CC} -dynamic ${CFLAGS} ${PREFIX_TCL}.c ${LDFLAGS} -o ${PREFIX_TCL}

done

echo "OK."

Update bw script to generate multiple opt levels
Update bw script to generate multiple opt levels

git-svn-id: 0c5512015aa96f7d3f5c3ad598bd98edc52008b1@11975 dc4e9af1-7f46-4ead-bba6-71afc04862de
