2024-04-15 19:22:58 +00:00
|
|
|
CFLAGS ?= -Wall -g
|
2024-04-16 12:03:12 +00:00
|
|
|
GDBRUN = gdb --batch --ex run --ex bt --ex q --args
|
2024-04-18 22:28:12 +00:00
|
|
|
BUILD_TARGETS = ex1 ex3 ex7 ex8 ex9 ex10 ex11 ex12
|
|
|
|
TEST_TARGETS = ex1 ex3 ex7 ex8 ex9 ex11 ex12
|
2024-04-15 19:22:58 +00:00
|
|
|
|
2024-04-15 23:59:15 +00:00
|
|
|
.PHONY: all
|
|
|
|
all: build test
|
2024-04-15 19:16:14 +00:00
|
|
|
|
2024-04-15 23:59:15 +00:00
|
|
|
.PHONY: clean
|
2024-04-15 19:16:14 +00:00
|
|
|
clean:
|
2024-04-16 12:03:12 +00:00
|
|
|
rm -f $(BUILD_TARGETS)
|
2024-04-15 19:22:58 +00:00
|
|
|
|
2024-04-15 23:59:15 +00:00
|
|
|
.PHONY: build
|
2024-04-16 12:03:12 +00:00
|
|
|
build: $(BUILD_TARGETS)
|
|
|
|
|
|
|
|
.PHONY: gtest
|
|
|
|
gtest:
|
2024-04-18 22:49:10 +00:00
|
|
|
@$(foreach bt, $(TEST_TARGETS), make .gtest.$(bt) &&) \
|
2024-04-17 12:22:20 +00:00
|
|
|
printf '\ngYAY\n'
|
2024-04-15 23:59:15 +00:00
|
|
|
|
2024-04-18 22:49:10 +00:00
|
|
|
.gtest.%:
|
|
|
|
printf '\n==> %s\n' "$*" && $(GDBRUN) ./$*
|
|
|
|
|
2024-04-15 23:59:15 +00:00
|
|
|
.PHONY: test
|
2024-04-15 19:22:58 +00:00
|
|
|
test:
|
2024-04-18 22:49:10 +00:00
|
|
|
@$(foreach bt, $(TEST_TARGETS), make .test.$(bt) &&) \
|
2024-04-17 12:22:20 +00:00
|
|
|
printf '\nYAY\n'
|
2024-04-18 22:49:10 +00:00
|
|
|
|
|
|
|
.test.%:
|
|
|
|
printf '\n==> %s\n' "$*" && ./$*
|