am-kernels/tests/cpu-tests/Makefile

36 lines
755 B
Makefile
Raw Permalink Normal View History

.PHONY: all run gdb clean latest $(ALL)
2020-08-11 17:38:42 +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" > $@
@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); \
else \
2024-02-20 06:51:34 +00:00
printf "[%14s] $(COLOR_RED)***FAIL***$(COLOR_NONE)\n" $* >> $(RESULT); \
fi
2020-08-11 17:38:42 +00:00
-@rm -f Makefile.$*
run: all
@cat $(RESULT)
@rm $(RESULT)
2020-08-11 17:38:42 +00:00
gdb: all
2020-08-11 17:38:42 +00:00
clean:
rm -rf Makefile.* build/
latest: