Skip to content

Commit f020085

Browse files
committed
Update build.sh
1 parent 4819b41 commit f020085

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

build.sh

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
VERSION="1.17"
3+
VERSION="1.18"
44

55
help() {
66
echo "Version v"$VERSION
@@ -33,6 +33,19 @@ create_soft_link() {
3333
done
3434
}
3535

36+
create_bin_soft_link() {
37+
find -L $BUILD_PATH -maxdepth 1 -type l -delete
38+
FOLDERS=`find bin -mindepth 1 -maxdepth 1 -type d`
39+
for FOLDER in ${FOLDERS[@]}
40+
do
41+
SUBFOLDER=${FOLDER##*/}
42+
eval "ln -s \"`realpath --relative-to="$BUILD_PATH" "$OSCPU_PATH/$FOLDER"`\" \"$BUILD_PATH/${FOLDER##*/}\" 1>/dev/null 2>&1"
43+
done
44+
45+
# create soft link ($BUILD_PATH/*.bin -> $OSCPU_PATH/$BIN_FOLDER/*.bin). Why? Because of laziness!
46+
create_soft_link $BUILD_PATH $OSCPU_PATH/$BIN_FOLDER \"*.bin\"
47+
}
48+
3649
compile_dramsim3() {
3750
if [[ ! -f $OSCPU_PATH/$DRAMSIM3_FOLDER/build/libdramsim3.a ]]; then
3851
[[ ! `dpkg -l | grep cmake` ]] && sudo apt-get --yes install cmake
@@ -228,11 +241,10 @@ fi
228241

229242
# Simulate
230243
if [[ "$SIMULATE" == "true" ]]; then
231-
cd $BUILD_PATH
232-
233-
# create soft link ($BUILD_PATH/*.bin -> $OSCPU_PATH/$BIN_FOLDER/*.bin). Why? Because of laziness!
234-
create_soft_link $BUILD_PATH $OSCPU_PATH/$BIN_FOLDER \"*.bin\"
244+
create_bin_soft_link
235245

246+
cd $BUILD_PATH
247+
236248
# run simulation program
237249
echo "Simulating..."
238250
[[ "$GDB" == "true" ]] && gdb -s $EMU_FILE --args ./$EMU_FILE $PARAMETERS || ./$EMU_FILE $PARAMETERS
@@ -260,15 +272,7 @@ fi
260272

261273
# Run all
262274
if [[ -n $TEST_CASES ]]; then
263-
find -L $BUILD_PATH -maxdepth 1 -type l -delete
264-
FOLDERS=`find bin -mindepth 1 -maxdepth 1 -type d`
265-
for FOLDER in ${FOLDERS[@]}
266-
do
267-
SUBFOLDER=${FOLDER##*/}
268-
eval "ln -s \"`realpath --relative-to="$BUILD_PATH" "$OSCPU_PATH/$FOLDER"`\" \"$BUILD_PATH/${FOLDER##*/}\" 1>/dev/null 2>&1"
269-
done
270-
271-
create_soft_link $BUILD_PATH $OSCPU_PATH/$BIN_FOLDER \"*.bin\"
275+
create_bin_soft_link
272276

273277
cd $BUILD_PATH
274278

0 commit comments

Comments
 (0)