10e56dacdSMichael Ellerman# Makefile for powerpc selftests 20e56dacdSMichael Ellerman 30e56dacdSMichael Ellerman# ARCH can be overridden by the user for cross compiling 40e56dacdSMichael EllermanARCH ?= $(shell uname -m) 50e56dacdSMichael EllermanARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/) 60e56dacdSMichael Ellerman 70e56dacdSMichael Ellermanifeq ($(ARCH),powerpc) 80e56dacdSMichael Ellerman 90e56dacdSMichael EllermanGIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown") 100e56dacdSMichael Ellerman 110e56dacdSMichael EllermanCFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) 120e56dacdSMichael Ellerman 1384f887bfSMichael Ellermanexport CFLAGS 140e56dacdSMichael Ellerman 15*65b6ba63SMichael EllermanSUB_DIRS = benchmarks \ 16*65b6ba63SMichael Ellerman copyloops \ 17*65b6ba63SMichael Ellerman dscr \ 18*65b6ba63SMichael Ellerman mm \ 19*65b6ba63SMichael Ellerman pmu \ 20*65b6ba63SMichael Ellerman primitives \ 21*65b6ba63SMichael Ellerman stringloops \ 22*65b6ba63SMichael Ellerman switch_endian \ 23*65b6ba63SMichael Ellerman syscalls \ 24*65b6ba63SMichael Ellerman tm \ 25*65b6ba63SMichael Ellerman vphn 260e56dacdSMichael Ellerman 270e56dacdSMichael Ellermanendif 280e56dacdSMichael Ellerman 29a908f5deSMichael Ellermanall: $(SUB_DIRS) 30cbfd7dabSMichael Ellerman 31a908f5deSMichael Ellerman$(SUB_DIRS): 32cbfd7dabSMichael Ellerman $(MAKE) -k -C $@ all 330e56dacdSMichael Ellerman 346faeeea4SMichael Ellermaninclude ../lib.mk 356faeeea4SMichael Ellerman 366faeeea4SMichael Ellermanoverride define RUN_TESTS 37a908f5deSMichael Ellerman @for TARGET in $(SUB_DIRS); do \ 380e56dacdSMichael Ellerman $(MAKE) -C $$TARGET run_tests; \ 390e56dacdSMichael Ellerman done; 406faeeea4SMichael Ellermanendef 416faeeea4SMichael Ellerman 426faeeea4SMichael Ellermanoverride define INSTALL_RULE 43d19d5efdSLinus Torvalds @for TARGET in $(SUB_DIRS); do \ 446faeeea4SMichael Ellerman $(MAKE) -C $$TARGET install; \ 456faeeea4SMichael Ellerman done; 466faeeea4SMichael Ellermanendef 476faeeea4SMichael Ellerman 486faeeea4SMichael Ellermanoverride define EMIT_TESTS 49d19d5efdSLinus Torvalds @for TARGET in $(SUB_DIRS); do \ 506faeeea4SMichael Ellerman $(MAKE) -s -C $$TARGET emit_tests; \ 516faeeea4SMichael Ellerman done; 526faeeea4SMichael Ellermanendef 530e56dacdSMichael Ellerman 540e56dacdSMichael Ellermanclean: 55a908f5deSMichael Ellerman @for TARGET in $(SUB_DIRS); do \ 560e56dacdSMichael Ellerman $(MAKE) -C $$TARGET clean; \ 570e56dacdSMichael Ellerman done; 580e56dacdSMichael Ellerman rm -f tags 590e56dacdSMichael Ellerman 600e56dacdSMichael Ellermantags: 610e56dacdSMichael Ellerman find . -name '*.c' -o -name '*.h' | xargs ctags 620e56dacdSMichael Ellerman 63d19d5efdSLinus Torvalds.PHONY: tags $(SUB_DIRS) 64