xref: /linux/tools/testing/selftests/sparc64/Makefile (revision eb83d5f7)
1*eb83d5f7SShuah Khan (Samsung OSG)# SPDX-License-Identifier: GPL-2.0
23c62c91aSShuah Khan (Samsung OSG)uname_M := $(shell uname -m 2>/dev/null || echo not)
33c62c91aSShuah Khan (Samsung OSG)ARCH ?= $(shell echo $(uname_M) | sed -e s/x86_64/x86/)
43c62c91aSShuah Khan (Samsung OSG)
53c62c91aSShuah Khan (Samsung OSG)ifneq ($(ARCH),sparc64)
63c62c91aSShuah Khan (Samsung OSG)nothing:
73c62c91aSShuah Khan (Samsung OSG).PHONY: all clean run_tests install
83c62c91aSShuah Khan (Samsung OSG).SILENT:
93c62c91aSShuah Khan (Samsung OSG)else
103c62c91aSShuah Khan (Samsung OSG)
113c545084STom HromatkaSUBDIRS := drivers
123c545084STom Hromatka
133c545084STom HromatkaTEST_PROGS := run.sh
143c545084STom Hromatka
153c62c91aSShuah Khan (Samsung OSG)
163c545084STom Hromatka.PHONY: all clean
173c545084STom Hromatka
183c545084STom Hromatkainclude ../lib.mk
193c545084STom Hromatka
203c545084STom Hromatkaall:
213c545084STom Hromatka	@for DIR in $(SUBDIRS); do		\
223c545084STom Hromatka		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
233c545084STom Hromatka		mkdir $$BUILD_TARGET  -p;	\
243c545084STom Hromatka		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
253c545084STom Hromatka		#SUBDIR test prog name should be in the form: SUBDIR_test.sh \
263c545084STom Hromatka		TEST=$$DIR"_test.sh"; \
273c545084STom Hromatka		if [ -e $$DIR/$$TEST ]; then \
283c545084STom Hromatka			rsync -a $$DIR/$$TEST $$BUILD_TARGET/; \
293c545084STom Hromatka		fi \
303c545084STom Hromatka	done
313c545084STom Hromatka
323c545084STom Hromatkaoverride define INSTALL_RULE
333c545084STom Hromatka	mkdir -p $(INSTALL_PATH)
343c545084STom Hromatka	install -t $(INSTALL_PATH) $(TEST_PROGS) $(TEST_PROGS_EXTENDED) $(TEST_FILES)
353c545084STom Hromatka
363c545084STom Hromatka	@for SUBDIR in $(SUBDIRS); do \
373c545084STom Hromatka		BUILD_TARGET=$(OUTPUT)/$$SUBDIR;	\
383c545084STom Hromatka		mkdir $$BUILD_TARGET  -p;	\
393c545084STom Hromatka		$(MAKE) OUTPUT=$$BUILD_TARGET -C $$SUBDIR INSTALL_PATH=$(INSTALL_PATH)/$$SUBDIR install; \
403c545084STom Hromatka	done;
413c545084STom Hromatkaendef
423c545084STom Hromatka
433c545084STom Hromatkaoverride define CLEAN
443c545084STom Hromatka	@for DIR in $(SUBDIRS); do		\
453c545084STom Hromatka		BUILD_TARGET=$(OUTPUT)/$$DIR;	\
463c545084STom Hromatka		mkdir $$BUILD_TARGET  -p;	\
473c545084STom Hromatka		make OUTPUT=$$BUILD_TARGET -C $$DIR $@;\
483c545084STom Hromatka	done
493c545084STom Hromatkaendef
503c62c91aSShuah Khan (Samsung OSG)endif
51