use grep -c instead of grep | wc -l

This commit is contained in:
Noah Swerhun 2021-12-25 23:56:55 -06:00
parent 0e8435d889
commit 04a58ffa04
2 changed files with 2 additions and 3 deletions

View file

@ -1 +0,0 @@
0

View file

@ -115,7 +115,7 @@ build() {
gen_makefile
[ ! -d "${OBJDIR}" ] && mkdir "${OBJDIR}"
export_vars
make -f "${MAKEFILE}" -e "${TARGET}" -n | grep "^${CC}" | wc -l > .cbuild_prog.tmp
make -f "${MAKEFILE}" -e "${TARGET}" -n | grep -c "^${CC}" > .cbuild_prog.tmp
if [ "$(cat .cbuild_prog.tmp)" = 0 ]; then
info "Target ${TARGET} up to date"
rm .cbuild_prog.tmp
@ -157,7 +157,7 @@ dry_run() {
__progress__() {
ntargets=$(cat .cbuild_prog.tmp)
export_vars
rtargets="$(make -f "${MAKEFILE}" -e "${TARGET}" -n | grep "^${CC}" | wc -l)"
rtargets="$(make -f "${MAKEFILE}" -e "${TARGET}" -n | grep -c "^${CC}")"
targetno=$((${ntargets} - ${rtargets} + 1))
if [ "${1}" = "object" ]; then
printf '[%3d/%d] ' "${targetno}" "${ntargets}"