1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0 20e56dacdSMichael Ellerman# Makefile for powerpc selftests 30e56dacdSMichael Ellerman 40e56dacdSMichael Ellerman# ARCH can be overridden by the user for cross compiling 50e56dacdSMichael EllermanARCH ?= $(shell uname -m) 60e56dacdSMichael EllermanARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/) 70e56dacdSMichael Ellerman 80e56dacdSMichael Ellermanifeq ($(ARCH),powerpc) 90e56dacdSMichael Ellerman 1043750880SChris SmartSUB_DIRS = alignment \ 1143750880SChris Smart benchmarks \ 12b8b6ff01SMichael Ellerman cache_shape \ 1365b6ba63SMichael Ellerman copyloops \ 14bdb07f35SBenjamin Gray dexcr \ 1565b6ba63SMichael Ellerman dscr \ 1665b6ba63SMichael Ellerman mm \ 17647c734fSRaphael Moreira Zinsly nx-gzip \ 1865b6ba63SMichael Ellerman pmu \ 19ef186331SCyril Bur signal \ 2065b6ba63SMichael Ellerman primitives \ 2165b6ba63SMichael Ellerman stringloops \ 2265b6ba63SMichael Ellerman switch_endian \ 2365b6ba63SMichael Ellerman syscalls \ 2465b6ba63SMichael Ellerman tm \ 2585d86c8aSOliver O'Halloran eeh \ 2601127f1eSCyril Bur vphn \ 27f666ad41SAnshuman Khandual math \ 2857201d65SPratik R. Sampat papr_attributes \ 299118c5d3SNathan Lynch papr_vpd \ 3076b2ec3fSNathan Lynch papr_sysparm \ 31d2bf7932SNaveen N. Rao ptrace \ 320f4ef8a3SGanesh Goudar security \ 330f4ef8a3SGanesh Goudar mce 340e56dacdSMichael Ellerman 350e56dacdSMichael Ellermanendif 360e56dacdSMichael Ellerman 37a908f5deSMichael Ellermanall: $(SUB_DIRS) 38cbfd7dabSMichael Ellerman 39a908f5deSMichael Ellerman$(SUB_DIRS): 402db2c250SMichael Ellerman BUILD_TARGET=$(OUTPUT)/$@; mkdir -p $$BUILD_TARGET; $(MAKE) OUTPUT=$$BUILD_TARGET -k -C $@ all 410e56dacdSMichael Ellerman 426faeeea4SMichael Ellermaninclude ../lib.mk 43108e5e68SMadhavan Srinivasaninclude ./flags.mk 446faeeea4SMichael Ellerman 456faeeea4SMichael Ellermanoverride define RUN_TESTS 464ecd0868SBenjamin Gray +@for TARGET in $(SUB_DIRS); do \ 472db2c250SMichael Ellerman BUILD_TARGET=$(OUTPUT)/$$TARGET; \ 48a8ba798bSbamvor.zhangjian@huawei.com $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET run_tests;\ 490e56dacdSMichael Ellerman done; 506faeeea4SMichael Ellermanendef 516faeeea4SMichael Ellerman 526faeeea4SMichael Ellermanoverride define INSTALL_RULE 534ecd0868SBenjamin Gray +@for TARGET in $(SUB_DIRS); do \ 542db2c250SMichael Ellerman BUILD_TARGET=$(OUTPUT)/$$TARGET; \ 55*dda32e37SMichael Ellerman $(MAKE) OUTPUT=$$BUILD_TARGET INSTALL_PATH=$$INSTALL_PATH/$$TARGET -C $$TARGET install;\ 566faeeea4SMichael Ellerman done; 576faeeea4SMichael Ellermanendef 586faeeea4SMichael Ellerman 5958b33e78SMichael Ellermanemit_tests: 604ecd0868SBenjamin Gray +@for TARGET in $(SUB_DIRS); do \ 612db2c250SMichael Ellerman BUILD_TARGET=$(OUTPUT)/$$TARGET; \ 62*dda32e37SMichael Ellerman $(MAKE) OUTPUT=$$BUILD_TARGET COLLECTION=$(COLLECTION)/$$TARGET -s -C $$TARGET $@;\ 636faeeea4SMichael Ellerman done; 640e56dacdSMichael Ellerman 65337f1e36SShuah Khanoverride define CLEAN 664ecd0868SBenjamin Gray +@for TARGET in $(SUB_DIRS); do \ 672db2c250SMichael Ellerman BUILD_TARGET=$(OUTPUT)/$$TARGET; \ 682e8ec87dSMichael Ellerman $(MAKE) OUTPUT=$$BUILD_TARGET -C $$TARGET clean; \ 692e8ec87dSMichael Ellerman done; 700e56dacdSMichael Ellerman rm -f tags 71337f1e36SShuah Khanendef 720e56dacdSMichael Ellerman 730e56dacdSMichael Ellermantags: 740e56dacdSMichael Ellerman find . -name '*.c' -o -name '*.h' | xargs ctags 750e56dacdSMichael Ellerman 7658b33e78SMichael Ellerman.PHONY: tags $(SUB_DIRS) emit_tests 77