Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 1 | # Makefile for powerpc selftests |
2 | |||||
3 | # ARCH can be overridden by the user for cross compiling | ||||
4 | ARCH ?= $(shell uname -m) | ||||
5 | ARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/) | ||||
6 | |||||
7 | ifeq ($(ARCH),powerpc) | ||||
8 | |||||
9 | GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown") | ||||
10 | |||||
Simon Guo | 15ec399 | 2016-09-30 10:32:51 +0800 | [diff] [blame] | 11 | CFLAGS := -std=gnu99 -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR)/include $(CFLAGS) |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 12 | |
Michael Ellerman | 84f887b | 2015-03-04 21:41:31 +1100 | [diff] [blame] | 13 | export CFLAGS |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 14 | |
Chris Smart | 4375088 | 2016-06-17 09:34:47 +1000 | [diff] [blame] | 15 | SUB_DIRS = alignment \ |
16 | benchmarks \ | ||||
Michael Ellerman | 65b6ba6 | 2015-10-14 20:50:35 +1100 | [diff] [blame] | 17 | copyloops \ |
Chris Smart | 438517e | 2016-05-02 13:51:38 +1000 | [diff] [blame] | 18 | context_switch \ |
Michael Ellerman | 65b6ba6 | 2015-10-14 20:50:35 +1100 | [diff] [blame] | 19 | dscr \ |
20 | mm \ | ||||
21 | pmu \ | ||||
Cyril Bur | ef18633 | 2016-09-23 16:18:19 +1000 | [diff] [blame] | 22 | signal \ |
Michael Ellerman | 65b6ba6 | 2015-10-14 20:50:35 +1100 | [diff] [blame] | 23 | primitives \ |
24 | stringloops \ | ||||
25 | switch_endian \ | ||||
26 | syscalls \ | ||||
27 | tm \ | ||||
Cyril Bur | 01127f1 | 2016-02-29 17:53:43 +1100 | [diff] [blame] | 28 | vphn \ |
Anshuman Khandual | f666ad4 | 2016-09-30 10:32:52 +0800 | [diff] [blame^] | 29 | math \ |
30 | ptrace | ||||
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 31 | |
32 | endif | ||||
33 | |||||
Michael Ellerman | a908f5d | 2015-03-18 12:02:41 +1100 | [diff] [blame] | 34 | all: $(SUB_DIRS) |
Michael Ellerman | cbfd7da | 2014-07-23 17:31:31 +1000 | [diff] [blame] | 35 | |
Michael Ellerman | a908f5d | 2015-03-18 12:02:41 +1100 | [diff] [blame] | 36 | $(SUB_DIRS): |
Michael Ellerman | cbfd7da | 2014-07-23 17:31:31 +1000 | [diff] [blame] | 37 | $(MAKE) -k -C $@ all |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 38 | |
Michael Ellerman | 6faeeea | 2015-03-11 15:06:01 +1100 | [diff] [blame] | 39 | include ../lib.mk |
40 | |||||
41 | override define RUN_TESTS | ||||
Michael Ellerman | a908f5d | 2015-03-18 12:02:41 +1100 | [diff] [blame] | 42 | @for TARGET in $(SUB_DIRS); do \ |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 43 | $(MAKE) -C $$TARGET run_tests; \ |
44 | done; | ||||
Michael Ellerman | 6faeeea | 2015-03-11 15:06:01 +1100 | [diff] [blame] | 45 | endef |
46 | |||||
47 | override define INSTALL_RULE | ||||
Linus Torvalds | d19d5ef | 2015-04-16 13:53:32 -0500 | [diff] [blame] | 48 | @for TARGET in $(SUB_DIRS); do \ |
Michael Ellerman | 6faeeea | 2015-03-11 15:06:01 +1100 | [diff] [blame] | 49 | $(MAKE) -C $$TARGET install; \ |
50 | done; | ||||
51 | endef | ||||
52 | |||||
53 | override define EMIT_TESTS | ||||
Linus Torvalds | d19d5ef | 2015-04-16 13:53:32 -0500 | [diff] [blame] | 54 | @for TARGET in $(SUB_DIRS); do \ |
Michael Ellerman | 6faeeea | 2015-03-11 15:06:01 +1100 | [diff] [blame] | 55 | $(MAKE) -s -C $$TARGET emit_tests; \ |
56 | done; | ||||
57 | endef | ||||
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 58 | |
59 | clean: | ||||
Michael Ellerman | a908f5d | 2015-03-18 12:02:41 +1100 | [diff] [blame] | 60 | @for TARGET in $(SUB_DIRS); do \ |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 61 | $(MAKE) -C $$TARGET clean; \ |
62 | done; | ||||
63 | rm -f tags | ||||
64 | |||||
65 | tags: | ||||
66 | find . -name '*.c' -o -name '*.h' | xargs ctags | ||||
67 | |||||
Linus Torvalds | d19d5ef | 2015-04-16 13:53:32 -0500 | [diff] [blame] | 68 | .PHONY: tags $(SUB_DIRS) |