Commit | Line | Data |
---|---|---|
0e56dacd ME |
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 | ||
a4cf0a2e | 11 | CFLAGS := -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) |
0e56dacd | 12 | |
84f887bf | 13 | export CFLAGS |
0e56dacd | 14 | |
65b6ba63 ME |
15 | SUB_DIRS = benchmarks \ |
16 | copyloops \ | |
17 | dscr \ | |
18 | mm \ | |
19 | pmu \ | |
20 | primitives \ | |
21 | stringloops \ | |
22 | switch_endian \ | |
23 | syscalls \ | |
24 | tm \ | |
25 | vphn | |
0e56dacd ME |
26 | |
27 | endif | |
28 | ||
a908f5de | 29 | all: $(SUB_DIRS) |
cbfd7dab | 30 | |
a908f5de | 31 | $(SUB_DIRS): |
cbfd7dab | 32 | $(MAKE) -k -C $@ all |
0e56dacd | 33 | |
6faeeea4 ME |
34 | include ../lib.mk |
35 | ||
36 | override define RUN_TESTS | |
a908f5de | 37 | @for TARGET in $(SUB_DIRS); do \ |
0e56dacd ME |
38 | $(MAKE) -C $$TARGET run_tests; \ |
39 | done; | |
6faeeea4 ME |
40 | endef |
41 | ||
42 | override define INSTALL_RULE | |
d19d5efd | 43 | @for TARGET in $(SUB_DIRS); do \ |
6faeeea4 ME |
44 | $(MAKE) -C $$TARGET install; \ |
45 | done; | |
46 | endef | |
47 | ||
48 | override define EMIT_TESTS | |
d19d5efd | 49 | @for TARGET in $(SUB_DIRS); do \ |
6faeeea4 ME |
50 | $(MAKE) -s -C $$TARGET emit_tests; \ |
51 | done; | |
52 | endef | |
0e56dacd ME |
53 | |
54 | clean: | |
a908f5de | 55 | @for TARGET in $(SUB_DIRS); do \ |
0e56dacd ME |
56 | $(MAKE) -C $$TARGET clean; \ |
57 | done; | |
58 | rm -f tags | |
59 | ||
60 | tags: | |
61 | find . -name '*.c' -o -name '*.h' | xargs ctags | |
62 | ||
d19d5efd | 63 | .PHONY: tags $(SUB_DIRS) |