1TMPDIR = /tmp/capstone_test 2 3DIFF = diff -u -w 4 5TEST = $(TMPDIR)/test 6TEST_ARM = $(TMPDIR)/test_arm 7TEST_ARM64 = $(TMPDIR)/test_arm64 8TEST_M68K = $(TMPDIR)/test_m68k 9TEST_MIPS = $(TMPDIR)/test_mips 10TEST_MOS65XX = $(TMPDIR)/test_mos65xx 11TEST_PPC = $(TMPDIR)/test_ppc 12TEST_SPARC = $(TMPDIR)/test_sparc 13TEST_SYSZ = $(TMPDIR)/test_systemz 14TEST_X86 = $(TMPDIR)/test_x86 15TEST_XCORE = $(TMPDIR)/test_xcore 16 17PYTHON2 ?= python 18 19.PHONY: all expected python java ocaml 20 21all: 22 cd python && $(MAKE) gen_const 23 cd java && $(MAKE) gen_const 24 cd ocaml && $(MAKE) gen_const 25 26tests: expected python java #oclma ruby 27 28test_java: expected java 29test_python: expected python 30 31expected: 32 cd ../tests && $(MAKE) 33 mkdir -p $(TMPDIR) 34 ../tests/test > $(TEST)_e 35 ../tests/test_arm > $(TEST_ARM)_e 36 ../tests/test_arm64 > $(TEST_ARM64)_e 37 ../tests/test_m68k > $(TEST_M68K)_e 38 ../tests/test_mips > $(TEST_MIPS)_e 39 ../tests/test_mos65xx > $(TEST_MOS65XX)_e 40 ../tests/test_ppc > $(TEST_PPC)_e 41 ../tests/test_sparc > $(TEST_SPARC)_e 42 ../tests/test_systemz > $(TEST_SYSZ)_e 43 ../tests/test_x86 > $(TEST_X86)_e 44 ../tests/test_xcore > $(TEST_XCORE)_e 45 46python: FORCE 47 cd python && $(MAKE) 48 $(PYTHON2) python/test.py > $(TEST)_o 49 $(PYTHON2) python/test_arm.py > $(TEST_ARM)_o 50 $(PYTHON2) python/test_arm64.py > $(TEST_ARM64)_o 51 $(PYTHON2) python/test_m68k.py > $(TEST_M68K)_o 52 $(PYTHON2) python/test_mips.py > $(TEST_MIPS)_o 53 $(PYTHON2) python/test_mos65xx.py > $(TEST_MOS65XX)_o 54 $(PYTHON2) python/test_ppc.py > $(TEST_PPC)_o 55 $(PYTHON2) python/test_sparc.py > $(TEST_SPARC)_o 56 $(PYTHON2) python/test_systemz.py > $(TEST_SYSZ)_o 57 $(PYTHON2) python/test_x86.py > $(TEST_X86)_o 58 $(PYTHON2) python/test_xcore.py > $(TEST_XCORE)_o 59 $(MAKE) test_diff 60 61java: FORCE 62 cd java && $(MAKE) 63 cd java && ./run.sh > $(TEST)_o 64 cd java && ./run.sh arm > $(TEST_ARM)_o 65 cd java && ./run.sh arm64 > $(TEST_ARM64)_o 66 cd java && ./run.sh mips > $(TEST_MIPS)_o 67 cd java && ./run.sh ppc > $(TEST_PPC)_o 68 cd java && ./run.sh sparc > $(TEST_SPARC)_o 69 cd java && ./run.sh systemz > $(TEST_SYSZ)_o 70 cd java && ./run.sh x86 > $(TEST_X86)_o 71 cd java && ./run.sh xcore > $(TEST_XCORE)_o 72 $(MAKE) test_diff 73 74ocaml: FORCE 75 76test_diff: FORCE 77 $(DIFF) $(TEST)_e $(TEST)_o 78 $(DIFF) $(TEST_ARM)_e $(TEST_ARM)_o 79 $(DIFF) $(TEST_ARM64)_e $(TEST_ARM64)_o 80 $(DIFF) $(TEST_M68K)_e $(TEST_M68K)_o 81 $(DIFF) $(TEST_MIPS)_e $(TEST_MIPS)_o 82 $(DIFF) $(TEST_MOS65XX)_e $(TEST_MOS65XX)_o 83 $(DIFF) $(TEST_PPC)_e $(TEST_PPC)_o 84 $(DIFF) $(TEST_SPARC)_e $(TEST_SPARC)_o 85 $(DIFF) $(TEST_SYSZ)_e $(TEST_SYSZ)_o 86 $(DIFF) $(TEST_X86)_e $(TEST_X86)_o 87 $(DIFF) $(TEST_XCORE)_e $(TEST_XCORE)_o 88 89clean: 90 rm -rf $(TMPDIR) 91 cd java && $(MAKE) clean 92 cd python && $(MAKE) clean 93 cd ocaml && $(MAKE) clean 94 95check: 96 make -C ocaml check 97 make -C python check 98 make -C java check 99 100FORCE: 101