Skip to content
This repository has been archived by the owner on Aug 15, 2024. It is now read-only.

Commit

Permalink
fix(build.sh): Fix array expansion
Browse files Browse the repository at this point in the history
Signed-off-by: h4rl <98224660+h4rldev@users.noreply.github.com>
  • Loading branch information
h4rldev authored Jul 12, 2024
1 parent 6c8d4c6 commit c670939
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,15 +121,15 @@ compile() {
fi
else
if ${DEBUG}; then
gcc "${CFLAGS}" -ggdb -c "${C_FILES[${i}]}" -o "${OUT}/${TRIMMED_C_FILENAME}.o"
gcc ${CFLAGS} -ggdb -c "${C_FILES[${i}]}" -o "${OUT}/${TRIMMED_C_FILENAME}.o"
else
gcc -O3 ${CFLAGS} -c "${C_FILES[${i}]}" -o "${OUT}/${TRIMMED_C_FILENAME}.o"
gcc ${CFLAGS} -c "${C_FILES[${i}]}" -o "${OUT}/${TRIMMED_C_FILENAME}.o"
fi
fi
done

echo -e "${BLUE}>${CLEAR} Compiling: main.c.."
gcc -O3 "${CFLAGS}" -c "${SRC}/main.c" -o "${OUT}/main.o"
gcc "${CFLAGS}" -c "${SRC}/main.c" -o "${OUT}/main.o"

echo -e "${GREEN}${CLEAR} Compiled ${CYAN}${TRIMMED_C_FILENAMES[*]}${CLEAR} & ${CYAN}main${CLEAR} successfully"
}
Expand Down Expand Up @@ -164,11 +164,11 @@ link() {
echo -ne "${YELLOW}!${CLEAR} ${CYAN}${EXECUTABLE_NAME}${CLEAR} seems to already exist, you wanna relink it? [${GREEN}Y${CLEAR}/${RED}n${CLEAR}]: "
read -r RELINK
if [[ ! ${RELINK} =~ [Nn] ]]; then
gcc ${CFLAGS} -o "${BIN}/${EXECUTABLE_NAME}" "${TRIMMED_FILES[*]}" "${LINKER_FLAGS}"
gcc ${CFLAGS} -o "${BIN}/${EXECUTABLE_NAME}" ${TRIMMED_FILES[*]} ${LINKER_FLAGS}
echo -e "${GREEN}${CLEAR} Linked ${CYAN}${TRIMMED_FILES}${CLEAR} successfully"
fi
else
gcc ${CFLAGS} -o "${BIN}/${EXECUTABLE_NAME}" "${TRIMMED_FILES[*]}" "${LINKER_FLAGS}"
gcc ${CFLAGS} -o "${BIN}/${EXECUTABLE_NAME}" ${TRIMMED_FILES[*]} ${LINKER_FLAGS}
echo -e "${GREEN}${CLEAR} Linked ${CYAN}${TRIMMED_FILES}${CLEAR} successfully"

fi
Expand Down

0 comments on commit c670939

Please sign in to comment.