1# Makefile for powerpc selftests 2 3# ARCH can be overridden by the user for cross compiling 4ARCH ?= $(shell uname -m) 5ARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/) 6 7ifeq ($(ARCH),powerpc) 8 9GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown") 10 11CFLAGS := -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) 12 13export CFLAGS 14 15SUB_DIRS = benchmarks \ 16 copyloops \ 17 context_switch \ 18 dscr \ 19 mm \ 20 pmu \ 21 primitives \ 22 stringloops \ 23 switch_endian \ 24 syscalls \ 25 tm \ 26 vphn \ 27 math 28 29endif 30 31all: $(SUB_DIRS) 32 33$(SUB_DIRS): 34 $(MAKE) -k -C $@ all 35 36include ../lib.mk 37 38override define RUN_TESTS 39 @for TARGET in $(SUB_DIRS); do \ 40 $(MAKE) -C $$TARGET run_tests; \ 41 done; 42endef 43 44override define INSTALL_RULE 45 @for TARGET in $(SUB_DIRS); do \ 46 $(MAKE) -C $$TARGET install; \ 47 done; 48endef 49 50override define EMIT_TESTS 51 @for TARGET in $(SUB_DIRS); do \ 52 $(MAKE) -s -C $$TARGET emit_tests; \ 53 done; 54endef 55 56clean: 57 @for TARGET in $(SUB_DIRS); do \ 58 $(MAKE) -C $$TARGET clean; \ 59 done; 60 rm -f tags 61 62tags: 63 find . -name '*.c' -o -name '*.h' | xargs ctags 64 65.PHONY: tags $(SUB_DIRS) 66