Makefile 1.0 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
# 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")

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

13
export CFLAGS
14

15
SUB_DIRS = pmu copyloops mm tm primitives stringloops vphn switch_endian dscr benchmarks syscalls
16 17 18

endif

19
all: $(SUB_DIRS)
20

21
$(SUB_DIRS):
22
	$(MAKE) -k -C $@ all
23

24 25 26
include ../lib.mk

override define RUN_TESTS
27
	@for TARGET in $(SUB_DIRS); do \
28 29
		$(MAKE) -C $$TARGET run_tests; \
	done;
30 31 32
endef

override define INSTALL_RULE
33
	@for TARGET in $(SUB_DIRS); do \
34 35 36 37 38
		$(MAKE) -C $$TARGET install; \
	done;
endef

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

clean:
45
	@for TARGET in $(SUB_DIRS); do \
46 47 48 49 50 51 52
		$(MAKE) -C $$TARGET clean; \
	done;
	rm -f tags

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

53
.PHONY: tags $(SUB_DIRS)