Makefile 1.2 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
# Makefile for powerpc selftests

# ARCH can be overridden by the user for cross compiling
ARCH ?= $(shell uname -m)
ARCH := $(shell echo $(ARCH) | sed -e s/ppc.*/powerpc/)

ifeq ($(ARCH),powerpc)

GIT_VERSION = $(shell git describe --always --long --dirty || echo "unknown")

11
CFLAGS := -Wall -O2 -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS)
12

13
export CFLAGS
14

15 16
SUB_DIRS = benchmarks 		\
	   copyloops		\
17
	   context_switch	\
18 19 20 21 22 23 24 25
	   dscr			\
	   mm			\
	   pmu			\
	   primitives		\
	   stringloops		\
	   switch_endian	\
	   syscalls		\
	   tm			\
26 27
	   vphn         \
	   math
28 29 30

endif

31
all: $(SUB_DIRS)
32

33
$(SUB_DIRS):
34
	$(MAKE) -k -C $@ all
35

36 37 38
include ../lib.mk

override define RUN_TESTS
39
	@for TARGET in $(SUB_DIRS); do \
40 41
		$(MAKE) -C $$TARGET run_tests; \
	done;
42 43 44
endef

override define INSTALL_RULE
45
	@for TARGET in $(SUB_DIRS); do \
46 47 48 49 50
		$(MAKE) -C $$TARGET install; \
	done;
endef

override define EMIT_TESTS
51
	@for TARGET in $(SUB_DIRS); do \
52 53 54
		$(MAKE) -s -C $$TARGET emit_tests; \
	done;
endef
55 56

clean:
57
	@for TARGET in $(SUB_DIRS); do \
58 59 60 61 62 63 64
		$(MAKE) -C $$TARGET clean; \
	done;
	rm -f tags

tags:
	find . -name '*.c' -o -name '*.h' | xargs ctags

65
.PHONY: tags $(SUB_DIRS)