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