From df5d4f5a1f40a49a13dbc03f9eea21eacfbbbb54 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 18 Apr 2024 18:49:10 -0400 Subject: [PATCH] Kinda extra credit ex12 --- lcthw/Makefile | 16 ++++++++-------- lcthw/ex12.c | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/lcthw/Makefile b/lcthw/Makefile index de28cc9..8e85c60 100644 --- a/lcthw/Makefile +++ b/lcthw/Makefile @@ -15,16 +15,16 @@ build: $(BUILD_TARGETS) .PHONY: gtest gtest: - @$(foreach bt, \ - $(TEST_TARGETS), \ - printf '\n==> $(bt)\n' && $(GDBRUN) ./$(bt) && \ - ) \ + @$(foreach bt, $(TEST_TARGETS), make .gtest.$(bt) &&) \ printf '\ngYAY\n' +.gtest.%: + printf '\n==> %s\n' "$*" && $(GDBRUN) ./$* + .PHONY: test test: - @$(foreach bt, \ - $(TEST_TARGETS), \ - printf '\n==> %s\n' "$(bt)" && ./$(bt) && \ - ) \ + @$(foreach bt, $(TEST_TARGETS), make .test.$(bt) &&) \ printf '\nYAY\n' + +.test.%: + printf '\n==> %s\n' "$*" && ./$* diff --git a/lcthw/ex12.c b/lcthw/ex12.c index 78e218e..9663158 100644 --- a/lcthw/ex12.c +++ b/lcthw/ex12.c @@ -7,7 +7,7 @@ int main(int argc, char *argv[]) char full_name[] = { 'Z', 'e', 'd', ' ', 'A', '.', ' ', - 'S', 'h', 'a', 'w', + 'S', 'h', 'a', 'w', '\0', }; // WARNING: On some systems you may have to change the