box-o-sand/lcthw/Makefile

31 lines
547 B
Makefile
Raw Normal View History

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-17 12:22:20 +00:00
@$(foreach bt, \
$(TEST_TARGETS), \
printf '\n==> $(bt)\n' && $(GDBRUN) ./$(bt) && \
) \
printf '\ngYAY\n'
2024-04-15 23:59:15 +00:00
.PHONY: test
2024-04-15 19:22:58 +00:00
test:
2024-04-17 12:22:20 +00:00
@$(foreach bt, \
$(TEST_TARGETS), \
printf '\n==> %s\n' "$(bt)" && ./$(bt) && \
) \
printf '\nYAY\n'