Either all arch or only one of them

This commit is contained in:
danghvu 2013-12-20 00:57:12 -06:00
parent 29e01a6895
commit 02db488199
2 changed files with 26 additions and 8 deletions

View File

@ -23,22 +23,35 @@ LIBNAME = capstone
LIBOBJ =
LIBOBJ += cs.o utils.o SStream.o MCInstrDesc.o MCRegisterInfo.o
ifneq (,$(findstring arm,$(CAPSTONE_ARCHS)))
ifneq (,$(filter $(CAPSTONE_ARCH), arm all))
LIBOBJ += arch/ARM/ARMDisassembler.o arch/ARM/ARMInstPrinter.o arch/ARM/mapping.o
CFLAGS += -DCS_SUPPORT_ARM
ifeq ($(CAPSTONE_ARCH), arm)
LIBNAME = capstone-arm
endif
ifneq (,$(findstring x86,$(CAPSTONE_ARCHS)))
endif
ifneq (, $(filter $(CAPSTONE_ARCH), x86 all))
LIBOBJ += arch/X86/X86DisassemblerDecoder.o arch/X86/X86Disassembler.o arch/X86/X86IntelInstPrinter.o arch/X86/X86ATTInstPrinter.o arch/X86/mapping.o
CFLAGS += -DCS_SUPPORT_X86
ifeq ($(CAPSTONE_ARCH), x86)
LIBNAME = capstone-x86
endif
ifneq (,$(findstring mips,$(CAPSTONE_ARCHS)))
endif
ifneq (, $(filter $(CAPSTONE_ARCH), mips all))
LIBOBJ += arch/Mips/MipsDisassembler.o arch/Mips/MipsInstPrinter.o arch/Mips/mapping.o
CFLAGS += -DCS_SUPPORT_AARCH64
endif
ifneq (,$(findstring aarch64,$(CAPSTONE_ARCHS)))
LIBOBJ += arch/AArch64/AArch64BaseInfo.o arch/AArch64/AArch64Disassembler.o arch/AArch64/AArch64InstPrinter.o arch/AArch64/mapping.o
CFLAGS += -DCS_SUPPORT_MIPS
ifeq ($(CAPSTONE_ARCH), mips)
LIBNAME = capstone-mips
endif
endif
ifneq (, $(filter $(CAPSTONE_ARCH), arm64 all))
LIBOBJ += arch/AArch64/AArch64BaseInfo.o arch/AArch64/AArch64Disassembler.o arch/AArch64/AArch64InstPrinter.o arch/AArch64/mapping.o
CFLAGS += -DCS_SUPPORT_AARCH64
ifeq ($(CAPSTONE_ARCH), arm64)
LIBNAME = capstone-arm64
endif
endif
LIBOBJ += MCInst.o
EXT = so

View File

@ -1,2 +1,7 @@
CAPSTONE_ARCHS = arm x86 mips aarch64
# comment out what you dont need
CAPSTONE_ARCH = arm
CAPSTONE_ARCH = arm64
CAPSTONE_ARCH = mips
CAPSTONE_ARCH = x86
CAPSTONE_ARCH = all # <— by default we support all archs