xref: /linux/tools/testing/selftests/powerpc/Makefile (revision f666ad413db6f7fbfaeec6b11ed6f8e4b60dda38)
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
1115ec3997SSimon GuoCFLAGS := -std=gnu99 -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR)/include $(CFLAGS)
120e56dacdSMichael Ellerman
1384f887bfSMichael Ellermanexport CFLAGS
140e56dacdSMichael Ellerman
1543750880SChris SmartSUB_DIRS = alignment		\
1643750880SChris Smart	   benchmarks		\
1765b6ba63SMichael Ellerman	   copyloops		\
18438517ecSChris Smart	   context_switch	\
1965b6ba63SMichael Ellerman	   dscr			\
2065b6ba63SMichael Ellerman	   mm			\
2165b6ba63SMichael Ellerman	   pmu			\
22ef186331SCyril Bur	   signal		\
2365b6ba63SMichael Ellerman	   primitives		\
2465b6ba63SMichael Ellerman	   stringloops		\
2565b6ba63SMichael Ellerman	   switch_endian	\
2665b6ba63SMichael Ellerman	   syscalls		\
2765b6ba63SMichael Ellerman	   tm			\
2801127f1eSCyril Bur	   vphn         \
29*f666ad41SAnshuman Khandual	   math		\
30*f666ad41SAnshuman Khandual	   ptrace
310e56dacdSMichael Ellerman
320e56dacdSMichael Ellermanendif
330e56dacdSMichael Ellerman
34a908f5deSMichael Ellermanall: $(SUB_DIRS)
35cbfd7dabSMichael Ellerman
36a908f5deSMichael Ellerman$(SUB_DIRS):
37cbfd7dabSMichael Ellerman	$(MAKE) -k -C $@ all
380e56dacdSMichael Ellerman
396faeeea4SMichael Ellermaninclude ../lib.mk
406faeeea4SMichael Ellerman
416faeeea4SMichael Ellermanoverride define RUN_TESTS
42a908f5deSMichael Ellerman	@for TARGET in $(SUB_DIRS); do \
430e56dacdSMichael Ellerman		$(MAKE) -C $$TARGET run_tests; \
440e56dacdSMichael Ellerman	done;
456faeeea4SMichael Ellermanendef
466faeeea4SMichael Ellerman
476faeeea4SMichael Ellermanoverride define INSTALL_RULE
48d19d5efdSLinus Torvalds	@for TARGET in $(SUB_DIRS); do \
496faeeea4SMichael Ellerman		$(MAKE) -C $$TARGET install; \
506faeeea4SMichael Ellerman	done;
516faeeea4SMichael Ellermanendef
526faeeea4SMichael Ellerman
536faeeea4SMichael Ellermanoverride define EMIT_TESTS
54d19d5efdSLinus Torvalds	@for TARGET in $(SUB_DIRS); do \
556faeeea4SMichael Ellerman		$(MAKE) -s -C $$TARGET emit_tests; \
566faeeea4SMichael Ellerman	done;
576faeeea4SMichael Ellermanendef
580e56dacdSMichael Ellerman
590e56dacdSMichael Ellermanclean:
60a908f5deSMichael Ellerman	@for TARGET in $(SUB_DIRS); do \
610e56dacdSMichael Ellerman		$(MAKE) -C $$TARGET clean; \
620e56dacdSMichael Ellerman	done;
630e56dacdSMichael Ellerman	rm -f tags
640e56dacdSMichael Ellerman
650e56dacdSMichael Ellermantags:
660e56dacdSMichael Ellerman	find . -name '*.c' -o -name '*.h' | xargs ctags
670e56dacdSMichael Ellerman
68d19d5efdSLinus Torvalds.PHONY: tags $(SUB_DIRS)
69