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