|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
SHELL := /bin/bash
|
|
|
|
|
|
|
|
|
|
CFLAGS ?= -Wall -g
|
|
|
|
|
GDBRUN = gdb --batch --ex run --ex bt --ex q --args
|
|
|
|
|
BUILD_TARGETS = $(foreach ex,$(wildcard ex*.c),$(subst .c,,$(ex)))
|
|
|
|
@ -22,8 +24,8 @@ gtest:
|
|
|
|
|
printf '\ngYAY\n'
|
|
|
|
|
|
|
|
|
|
.gtest.%:
|
|
|
|
|
@test_argv=$$(cat .$*.argv 2>/dev/null || echo) && \
|
|
|
|
|
printf '\n==> %s\n' "$*" && $(GDBRUN) ./$*
|
|
|
|
|
@if test -f .$*.argv; then readarray -t test_argv <.$*.argv; fi && \
|
|
|
|
|
printf '\n==> %s\n' "$*" && $(GDBRUN) ./$* "$${test_argv[@]}"
|
|
|
|
|
|
|
|
|
|
.PHONY: test
|
|
|
|
|
test:
|
|
|
|
@ -31,5 +33,5 @@ test:
|
|
|
|
|
printf '\nYAY\n'
|
|
|
|
|
|
|
|
|
|
.test.%:
|
|
|
|
|
@test_argv=$$(cat .$*.argv 2>/dev/null || echo) && \
|
|
|
|
|
printf '\n==> %s\n' "$*" && ./$* $$test_argv
|
|
|
|
|
@if test -f .$*.argv; then readarray -t test_argv <.$*.argv; fi && \
|
|
|
|
|
printf '\n==> %s\n' "$*" && ./$* "$${test_argv[@]}"
|
|
|
|
|