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 EllermanCC := $(CROSS_COMPILE)$(CC) 120e56dacdSMichael EllermanCFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) 130e56dacdSMichael Ellerman 140e56dacdSMichael Ellermanexport CC CFLAGS 150e56dacdSMichael Ellerman 1696d01610SSam bobroffTARGETS = pmu copyloops mm tm 170e56dacdSMichael Ellerman 180e56dacdSMichael Ellermanendif 190e56dacdSMichael Ellerman 20*cbfd7dabSMichael Ellermanall: $(TARGETS) 21*cbfd7dabSMichael Ellerman 22*cbfd7dabSMichael Ellerman$(TARGETS): 23*cbfd7dabSMichael Ellerman $(MAKE) -k -C $@ all 240e56dacdSMichael Ellerman 250e56dacdSMichael Ellermanrun_tests: all 260e56dacdSMichael Ellerman @for TARGET in $(TARGETS); do \ 270e56dacdSMichael Ellerman $(MAKE) -C $$TARGET run_tests; \ 280e56dacdSMichael Ellerman done; 290e56dacdSMichael Ellerman 300e56dacdSMichael Ellermanclean: 310e56dacdSMichael Ellerman @for TARGET in $(TARGETS); do \ 320e56dacdSMichael Ellerman $(MAKE) -C $$TARGET clean; \ 330e56dacdSMichael Ellerman done; 340e56dacdSMichael Ellerman rm -f tags 350e56dacdSMichael Ellerman 360e56dacdSMichael Ellermantags: 370e56dacdSMichael Ellerman find . -name '*.c' -o -name '*.h' | xargs ctags 380e56dacdSMichael Ellerman 39*cbfd7dabSMichael Ellerman.PHONY: all run_tests clean tags $(TARGETS) 40