am-kernels/tests/cpu-tests/Makefile

36 lines
720 B
Makefile
Raw 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))
@echo "" $(ALL)
$(ALL): %: Makefile.%
Makefile.%: tests/%.c latest
@/bin/echo -e "NAME = $*\nSRCS = $<\ninclude $${AM_HOME}/Makefile" > $@
@if make -s -f $@ ARCH=$(ARCH) $(MAKECMDGOALS); then \
printf "[%14s] $(COLOR_GREEN)PASS!$(COLOR_NONE)\n" $* >> $(RESULT); \
else \
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: