blob: c2c4211ba58b83facb996ceab3ecac7f9077a31e [file] [log] [blame]
Michael Ellerman0e56dac2013-08-06 17:42:35 +10001# 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
Simon Guo15ec3992016-09-30 10:32:51 +080011CFLAGS := -std=gnu99 -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR)/include $(CFLAGS)
Michael Ellerman0e56dac2013-08-06 17:42:35 +100012
Michael Ellerman84f887b2015-03-04 21:41:31 +110013export CFLAGS
Michael Ellerman0e56dac2013-08-06 17:42:35 +100014
Chris Smart43750882016-06-17 09:34:47 +100015SUB_DIRS = alignment \
16 benchmarks \
Michael Ellerman65b6ba62015-10-14 20:50:35 +110017 copyloops \
Chris Smart438517e2016-05-02 13:51:38 +100018 context_switch \
Michael Ellerman65b6ba62015-10-14 20:50:35 +110019 dscr \
20 mm \
21 pmu \
Cyril Buref186332016-09-23 16:18:19 +100022 signal \
Michael Ellerman65b6ba62015-10-14 20:50:35 +110023 primitives \
24 stringloops \
25 switch_endian \
26 syscalls \
27 tm \
Cyril Bur01127f12016-02-29 17:53:43 +110028 vphn \
Anshuman Khandualf666ad42016-09-30 10:32:52 +080029 math \
30 ptrace
Michael Ellerman0e56dac2013-08-06 17:42:35 +100031
32endif
33
Michael Ellermana908f5d2015-03-18 12:02:41 +110034all: $(SUB_DIRS)
Michael Ellermancbfd7da2014-07-23 17:31:31 +100035
Michael Ellermana908f5d2015-03-18 12:02:41 +110036$(SUB_DIRS):
Michael Ellermancbfd7da2014-07-23 17:31:31 +100037 $(MAKE) -k -C $@ all
Michael Ellerman0e56dac2013-08-06 17:42:35 +100038
Michael Ellerman6faeeea2015-03-11 15:06:01 +110039include ../lib.mk
40
41override define RUN_TESTS
Michael Ellermana908f5d2015-03-18 12:02:41 +110042 @for TARGET in $(SUB_DIRS); do \
Michael Ellerman0e56dac2013-08-06 17:42:35 +100043 $(MAKE) -C $$TARGET run_tests; \
44 done;
Michael Ellerman6faeeea2015-03-11 15:06:01 +110045endef
46
47override define INSTALL_RULE
Linus Torvaldsd19d5ef2015-04-16 13:53:32 -050048 @for TARGET in $(SUB_DIRS); do \
Michael Ellerman6faeeea2015-03-11 15:06:01 +110049 $(MAKE) -C $$TARGET install; \
50 done;
51endef
52
53override define EMIT_TESTS
Linus Torvaldsd19d5ef2015-04-16 13:53:32 -050054 @for TARGET in $(SUB_DIRS); do \
Michael Ellerman6faeeea2015-03-11 15:06:01 +110055 $(MAKE) -s -C $$TARGET emit_tests; \
56 done;
57endef
Michael Ellerman0e56dac2013-08-06 17:42:35 +100058
59clean:
Michael Ellermana908f5d2015-03-18 12:02:41 +110060 @for TARGET in $(SUB_DIRS); do \
Michael Ellerman0e56dac2013-08-06 17:42:35 +100061 $(MAKE) -C $$TARGET clean; \
62 done;
63 rm -f tags
64
65tags:
66 find . -name '*.c' -o -name '*.h' | xargs ctags
67
Linus Torvaldsd19d5ef2015-04-16 13:53:32 -050068.PHONY: tags $(SUB_DIRS)