2021-10-20 04:56:40 +00:00
|
|
|
.PHONY: all run gdb clean latest $(ALL)
|
2020-08-11 17:38:42 +00:00
|
|
|
|
2021-08-13 10:04:41 +00:00
|
|
|
RESULT = .result
|
|
|
|
$(shell > $(RESULT))
|
|
|
|
|
|
|
|
COLOR_RED = \033[1;31m
|
|
|
|
COLOR_GREEN = \033[1;32m
|
|
|
|
COLOR_NONE = \033[0m
|
|
|
|
|
2020-08-11 17:38:42 +00:00
|
|
|
ALL = $(basename $(notdir $(shell find tests/. -name "*.c")))
|
|
|
|
|
|
|
|
all: $(addprefix Makefile., $(ALL))
|
2024-02-20 06:51:34 +00:00
|
|
|
@echo "test list [$(words $(ALL)) item(s)]:" $(ALL)
|
2020-08-11 17:38:42 +00:00
|
|
|
|
|
|
|
$(ALL): %: Makefile.%
|
|
|
|
|
|
|
|
Makefile.%: tests/%.c latest
|
2024-03-25 08:49:08 +00:00
|
|
|
@echo -e "NAME = $*\nSRCS = $<\ninclude $${AM_HOME}/Makefile" > $@
|
2021-08-13 10:04:41 +00:00
|
|
|
@if make -s -f $@ ARCH=$(ARCH) $(MAKECMDGOALS); then \
|
2024-02-20 06:51:34 +00:00
|
|
|
printf "[%14s] $(COLOR_GREEN)PASS$(COLOR_NONE)\n" $* >> $(RESULT); \
|
2021-08-13 10:04:41 +00:00
|
|
|
else \
|
2024-02-20 06:51:34 +00:00
|
|
|
printf "[%14s] $(COLOR_RED)***FAIL***$(COLOR_NONE)\n" $* >> $(RESULT); \
|
2021-08-13 10:04:41 +00:00
|
|
|
fi
|
2020-08-11 17:38:42 +00:00
|
|
|
-@rm -f Makefile.$*
|
|
|
|
|
2021-07-03 12:36:04 +00:00
|
|
|
run: all
|
2021-08-13 10:04:41 +00:00
|
|
|
@cat $(RESULT)
|
|
|
|
@rm $(RESULT)
|
2020-08-11 17:38:42 +00:00
|
|
|
|
2021-10-20 04:56:40 +00:00
|
|
|
gdb: all
|
|
|
|
|
2020-08-11 17:38:42 +00:00
|
|
|
clean:
|
|
|
|
rm -rf Makefile.* build/
|
|
|
|
|
|
|
|
latest:
|