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 := -std=gnu99 -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) 12 13export CFLAGS 14 15SUB_DIRS = alignment \ 16 benchmarks \ 17 copyloops \ 18 context_switch \ 19 dscr \ 20 mm \ 21 pmu \ 22 signal \ 23 primitives \ 24 stringloops \ 25 switch_endian \ 26 syscalls \ 27 tm \ 28 vphn \ 29 math 30 31endif 32 33all: $(SUB_DIRS) 34 35$(SUB_DIRS): 36 $(MAKE) -k -C $@ all 37 38include ../lib.mk 39 40override define RUN_TESTS 41 @for TARGET in $(SUB_DIRS); do \ 42 $(MAKE) -C $$TARGET run_tests; \ 43 done; 44endef 45 46override define INSTALL_RULE 47 @for TARGET in $(SUB_DIRS); do \ 48 $(MAKE) -C $$TARGET install; \ 49 done; 50endef 51 52override define EMIT_TESTS 53 @for TARGET in $(SUB_DIRS); do \ 54 $(MAKE) -s -C $$TARGET emit_tests; \ 55 done; 56endef 57 58clean: 59 @for TARGET in $(SUB_DIRS); do \ 60 $(MAKE) -C $$TARGET clean; \ 61 done; 62 rm -f tags 63 64tags: 65 find . -name '*.c' -o -name '*.h' | xargs ctags 66 67.PHONY: tags $(SUB_DIRS) 68