changed build fail behavior, added clean checks
This commit is contained in:
parent
c29f47851f
commit
3a9379f32c
2 changed files with 13 additions and 6 deletions
BIN
a.out
Executable file
BIN
a.out
Executable file
Binary file not shown.
13
cbuild.sh
13
cbuild.sh
|
@ -117,22 +117,29 @@ build() {
|
||||||
export_vars
|
export_vars
|
||||||
make -f "${MAKEFILE}" -e "${TARGET}" -n | grep "^${CC}" | wc -l > .cbuild_prog.tmp
|
make -f "${MAKEFILE}" -e "${TARGET}" -n | grep "^${CC}" | wc -l > .cbuild_prog.tmp
|
||||||
info "Beginning build..."
|
info "Beginning build..."
|
||||||
make -f "${MAKEFILE}" -e "${TARGET}" &&
|
make -f "${MAKEFILE}" -e "${TARGET}"
|
||||||
|
ret=$?
|
||||||
|
[ "${ret}" = 0 ] &&
|
||||||
info "Build SUCCESSFUL" ||
|
info "Build SUCCESSFUL" ||
|
||||||
err "Build FAILURE"
|
err "Build FAILURE"
|
||||||
rm .cbuild_prog.tmp
|
rm .cbuild_prog.tmp
|
||||||
|
return "${ret}"
|
||||||
}
|
}
|
||||||
|
|
||||||
clean() {
|
clean() {
|
||||||
|
[ -d "${OBJDIR}" ] &&
|
||||||
rm -rf "${OBJDIR}"
|
rm -rf "${OBJDIR}"
|
||||||
|
[ -f "${MAKEFILE}" ] &&
|
||||||
chmod +w "${MAKEFILE}"
|
chmod +w "${MAKEFILE}"
|
||||||
|
[ -f "${TARGET}" ] && [ -f "${MAKEFILE}" ] &&
|
||||||
rm "${TARGET}" "${MAKEFILE}"
|
rm "${TARGET}" "${MAKEFILE}"
|
||||||
}
|
}
|
||||||
|
|
||||||
run() {
|
run() {
|
||||||
build
|
build || exit $?
|
||||||
info "Running [0m./${TARGET}"
|
info "Running [0m./${TARGET}"
|
||||||
"./${TARGET}"
|
"./${TARGET}" ||
|
||||||
|
err "Run FAILURE [0m./${TARGET}[31m returned $?"
|
||||||
}
|
}
|
||||||
|
|
||||||
dry_run() {
|
dry_run() {
|
||||||
|
|
Loading…
Reference in a new issue