31 lines
547 B
Makefile
31 lines
547 B
Makefile
CFLAGS ?= -Wall -g
|
|
GDBRUN = gdb --batch --ex run --ex bt --ex q --args
|
|
BUILD_TARGETS = ex1 ex3 ex7 ex8 ex9 ex10 ex11 ex12
|
|
TEST_TARGETS = ex1 ex3 ex7 ex8 ex9 ex11 ex12
|
|
|
|
.PHONY: all
|
|
all: build test
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f $(BUILD_TARGETS)
|
|
|
|
.PHONY: build
|
|
build: $(BUILD_TARGETS)
|
|
|
|
.PHONY: gtest
|
|
gtest:
|
|
@$(foreach bt, \
|
|
$(TEST_TARGETS), \
|
|
printf '\n==> $(bt)\n' && $(GDBRUN) ./$(bt) && \
|
|
) \
|
|
printf '\ngYAY\n'
|
|
|
|
.PHONY: test
|
|
test:
|
|
@$(foreach bt, \
|
|
$(TEST_TARGETS), \
|
|
printf '\n==> %s\n' "$(bt)" && ./$(bt) && \
|
|
) \
|
|
printf '\nYAY\n'
|