diff --git a/staticmemory/Makefile b/staticmemory/Makefile index 61884779..77b9a510 100644 --- a/staticmemory/Makefile +++ b/staticmemory/Makefile @@ -35,11 +35,13 @@ debug: all $(CC) -o $@ $< $(CFLAGS) $(LIBS) clean: - rm -f $(TARGETS) + rm -f $(TARGETS) size.log debug.log -check: SHELL := /bin/bash -check: .SHELLFLAGS := -eo pipefail -c +# Redirect then grep (no pipe) so a nonzero exit fails the recipe on its own and +# it works under BSD make too, where SHELLFLAGS pipefail is unavailable. check: size-calculation debug-callback-example - ./size-calculation | grep -q 'Checking out bucket 4 size of 25...ok' - ./debug-callback-example | grep -q 'bucket size used was' + ./size-calculation > size.log + grep -q 'Checking out bucket 4 size of 25...ok' size.log + ./debug-callback-example > debug.log + grep -q 'bucket size used was' debug.log @echo "PASS: staticmemory checks" diff --git a/staticmemory/memory-bucket-optimizer/optimizer/Makefile b/staticmemory/memory-bucket-optimizer/optimizer/Makefile index d656988f..549827a6 100644 --- a/staticmemory/memory-bucket-optimizer/optimizer/Makefile +++ b/staticmemory/memory-bucket-optimizer/optimizer/Makefile @@ -29,14 +29,12 @@ memory_bucket_optimizer: memory_bucket_optimizer.c $(CC) $(CFLAGS) -o memory_bucket_optimizer memory_bucket_optimizer.c $(LDFLAGS) clean: - rm -f memory_bucket_optimizer + rm -f memory_bucket_optimizer mem.log .PHONY: all clean check -check: SHELL := /bin/bash -check: .SHELLFLAGS := -eo pipefail -c check: memory_bucket_optimizer $(MAKE) -C ../.. >/dev/null ../../debug-callback-example > mem.log 2>&1 - ./memory_bucket_optimizer mem.log | grep -q 'Optimization Summary:' + ./memory_bucket_optimizer mem.log @echo "PASS: staticmemory-bucket-optimizer checks"