TESTS = $(wildcard macho/*.sh)

test: $(TESTS)

# macOS's GNU make hasn't been updated since 3.8.1 perhaps due a concern
# of GPLv3. The --output-sync flag was introduced in GNU Make 4.0, so we
# can't use that flag on macOS.
#
# `tail -r | tail -r` is a poor-man's way to enable full buffering on a
# command output. `tail -r` outputs an input from the last line to the
# first.
$(TESTS):
	@./$@ 2>&1 | tail -r | tail -r

.PHONY: test $(TESTS)
