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 | |
| 11 | CC := $(CROSS_COMPILE)$(CC) |
| 12 | CFLAGS := -Wall -O2 -flto -Wall -Werror -DGIT_VERSION='"$(GIT_VERSION)"' -I$(CURDIR) $(CFLAGS) |
| 13 | |
| 14 | export CC CFLAGS |
| 15 | |
Sam bobroff | 96d0161 | 2014-06-05 16:19:22 +1000 | [diff] [blame] | 16 | TARGETS = pmu copyloops mm tm |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 17 | |
| 18 | endif |
| 19 | |
Michael Ellerman | cbfd7da | 2014-07-23 17:31:31 +1000 | [diff] [blame^] | 20 | all: $(TARGETS) |
| 21 | |
| 22 | $(TARGETS): |
| 23 | $(MAKE) -k -C $@ all |
Michael Ellerman | 0e56dac | 2013-08-06 17:42:35 +1000 | [diff] [blame] | 24 | |
| 25 | run_tests: all |
| 26 | @for TARGET in $(TARGETS); do \ |
| 27 | $(MAKE) -C $$TARGET run_tests; \ |
| 28 | done; |
| 29 | |
| 30 | clean: |
| 31 | @for TARGET in $(TARGETS); do \ |
| 32 | $(MAKE) -C $$TARGET clean; \ |
| 33 | done; |
| 34 | rm -f tags |
| 35 | |
| 36 | tags: |
| 37 | find . -name '*.c' -o -name '*.h' | xargs ctags |
| 38 | |
Michael Ellerman | cbfd7da | 2014-07-23 17:31:31 +1000 | [diff] [blame^] | 39 | .PHONY: all run_tests clean tags $(TARGETS) |