From 8abb345ea923fec7b0dc0451ef3da8534f1cb455 Mon Sep 17 00:00:00 2001 From: Nguyen Anh Quynh Date: Sat, 1 Mar 2014 20:44:58 +0800 Subject: [PATCH] tests: only compile tests for selected archs. bug reported by @osxreverser --- tests/Makefile | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/tests/Makefile b/tests/Makefile index 7e18ee7b..5b6950f5 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -1,6 +1,8 @@ # Capstone Disassembler Engine # By Nguyen Anh Quynh , 2013> +include ../config.mk + INCDIR = ../include LIBDIR = .. @@ -36,7 +38,23 @@ endif .PHONY: all clean -SOURCES = test.c test_detail.c test_x86.c test_arm64.c test_arm.c test_mips.c test_ppc.c +SOURCES = test.c test_detail.c +ifneq (,$(findstring arm,$(CAPSTONE_ARCHS))) +SOURCES += test_arm.c +endif +ifneq (,$(findstring aarch64,$(CAPSTONE_ARCHS))) +SOURCES += test_arm64.c +endif +ifneq (,$(findstring mips,$(CAPSTONE_ARCHS))) +SOURCES += test_mips.c +endif +ifneq (,$(findstring powerpc,$(CAPSTONE_ARCHS))) +SOURCES += test_ppc.c +endif +ifneq (,$(findstring x86,$(CAPSTONE_ARCHS))) +SOURCES += test_x86.c +endif + OBJS = $(SOURCES:.c=.o) BINARY = $(SOURCES:.c=$(BIN_EXT))