danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 1 | TMPDIR = /tmp/capstone_test |
| 2 | |
danghvu | 7b08804 | 2013-11-27 10:58:31 -0600 | [diff] [blame] | 3 | DIFF = diff -u -w |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 4 | |
| 5 | TEST = $(TMPDIR)/test |
| 6 | TEST_ARM = $(TMPDIR)/test_arm |
| 7 | TEST_ARM64 = $(TMPDIR)/test_arm64 |
Daniel Collin | 2ee675c | 2015-08-03 18:45:08 +0200 | [diff] [blame] | 8 | TEST_M68K = $(TMPDIR)/test_m68k |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 9 | TEST_MIPS = $(TMPDIR)/test_mips |
Nguyen Anh Quynh | 1055a2e | 2014-03-10 14:37:08 +0800 | [diff] [blame] | 10 | TEST_PPC = $(TMPDIR)/test_ppc |
| 11 | TEST_SPARC = $(TMPDIR)/test_sparc |
Nguyen Anh Quynh | 1c8405d | 2014-03-23 11:17:24 +0800 | [diff] [blame] | 12 | TEST_SYSZ = $(TMPDIR)/test_systemz |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 13 | TEST_X86 = $(TMPDIR)/test_x86 |
Nguyen Anh Quynh | 553bb48 | 2014-05-26 23:47:04 +0800 | [diff] [blame] | 14 | TEST_XCORE = $(TMPDIR)/test_xcore |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 15 | |
Nguyen Anh Quynh | d6ef46a | 2013-12-02 18:06:31 +0800 | [diff] [blame] | 16 | .PHONY: all expected python java ocaml |
| 17 | |
| 18 | all: |
danghvu | 0c478ab | 2014-05-12 14:35:54 -0500 | [diff] [blame] | 19 | cd python && $(MAKE) gen_const |
| 20 | cd java && $(MAKE) gen_const |
Nguyen Anh Quynh | 586be76 | 2014-09-21 23:23:38 +0800 | [diff] [blame] | 21 | cd ocaml && $(MAKE) gen_const |
Nguyen Anh Quynh | d6ef46a | 2013-12-02 18:06:31 +0800 | [diff] [blame] | 22 | |
danghvu | 9ed9d85 | 2013-12-01 13:27:05 -0600 | [diff] [blame] | 23 | tests: expected python java #oclma ruby |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 24 | |
danghvu | 486111c | 2013-12-05 19:36:28 -0600 | [diff] [blame] | 25 | test_java: expected java |
| 26 | test_python: expected python |
| 27 | |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 28 | expected: |
danghvu | 0c478ab | 2014-05-12 14:35:54 -0500 | [diff] [blame] | 29 | cd ../tests && $(MAKE) |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 30 | mkdir -p $(TMPDIR) |
| 31 | ../tests/test > $(TEST)_e |
| 32 | ../tests/test_arm > $(TEST_ARM)_e |
| 33 | ../tests/test_arm64 > $(TEST_ARM64)_e |
Daniel Collin | 2ee675c | 2015-08-03 18:45:08 +0200 | [diff] [blame] | 34 | ../tests/test_m68k > $(TEST_M68K)_e |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 35 | ../tests/test_mips > $(TEST_MIPS)_e |
Nguyen Anh Quynh | 1055a2e | 2014-03-10 14:37:08 +0800 | [diff] [blame] | 36 | ../tests/test_ppc > $(TEST_PPC)_e |
| 37 | ../tests/test_sparc > $(TEST_SPARC)_e |
Nguyen Anh Quynh | 1c8405d | 2014-03-23 11:17:24 +0800 | [diff] [blame] | 38 | ../tests/test_systemz > $(TEST_SYSZ)_e |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 39 | ../tests/test_x86 > $(TEST_X86)_e |
Nguyen Anh Quynh | 553bb48 | 2014-05-26 23:47:04 +0800 | [diff] [blame] | 40 | ../tests/test_xcore > $(TEST_XCORE)_e |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 41 | |
| 42 | python: FORCE |
danghvu | 0c478ab | 2014-05-12 14:35:54 -0500 | [diff] [blame] | 43 | cd python && $(MAKE) |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 44 | python python/test.py > $(TEST)_o |
| 45 | python python/test_arm.py > $(TEST_ARM)_o |
| 46 | python python/test_arm64.py > $(TEST_ARM64)_o |
Daniel Collin | 2ee675c | 2015-08-03 18:45:08 +0200 | [diff] [blame] | 47 | python python/test_m68k.py > $(TEST_M68K)_o |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 48 | python python/test_mips.py > $(TEST_MIPS)_o |
Nguyen Anh Quynh | 1055a2e | 2014-03-10 14:37:08 +0800 | [diff] [blame] | 49 | python python/test_ppc.py > $(TEST_PPC)_o |
| 50 | python python/test_sparc.py > $(TEST_SPARC)_o |
Nguyen Anh Quynh | 1c8405d | 2014-03-23 11:17:24 +0800 | [diff] [blame] | 51 | python python/test_systemz.py > $(TEST_SYSZ)_o |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 52 | python python/test_x86.py > $(TEST_X86)_o |
Nguyen Anh Quynh | 553bb48 | 2014-05-26 23:47:04 +0800 | [diff] [blame] | 53 | python python/test_xcore.py > $(TEST_XCORE)_o |
danghvu | 9ed9d85 | 2013-12-01 13:27:05 -0600 | [diff] [blame] | 54 | $(MAKE) test_diff |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 55 | |
| 56 | java: FORCE |
danghvu | 0c478ab | 2014-05-12 14:35:54 -0500 | [diff] [blame] | 57 | cd java && $(MAKE) |
| 58 | cd java && ./run.sh > $(TEST)_o |
| 59 | cd java && ./run.sh arm > $(TEST_ARM)_o |
| 60 | cd java && ./run.sh arm64 > $(TEST_ARM64)_o |
| 61 | cd java && ./run.sh mips > $(TEST_MIPS)_o |
| 62 | cd java && ./run.sh ppc > $(TEST_PPC)_o |
| 63 | cd java && ./run.sh sparc > $(TEST_SPARC)_o |
| 64 | cd java && ./run.sh systemz > $(TEST_SYSZ)_o |
| 65 | cd java && ./run.sh x86 > $(TEST_X86)_o |
Nguyen Anh Quynh | 553bb48 | 2014-05-26 23:47:04 +0800 | [diff] [blame] | 66 | cd java && ./run.sh xcore > $(TEST_XCORE)_o |
danghvu | 9ed9d85 | 2013-12-01 13:27:05 -0600 | [diff] [blame] | 67 | $(MAKE) test_diff |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 68 | |
Nguyen Anh Quynh | d6ef46a | 2013-12-02 18:06:31 +0800 | [diff] [blame] | 69 | ocaml: FORCE |
| 70 | |
danghvu | 9ed9d85 | 2013-12-01 13:27:05 -0600 | [diff] [blame] | 71 | test_diff: FORCE |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 72 | $(DIFF) $(TEST)_e $(TEST)_o |
| 73 | $(DIFF) $(TEST_ARM)_e $(TEST_ARM)_o |
| 74 | $(DIFF) $(TEST_ARM64)_e $(TEST_ARM64)_o |
Daniel Collin | 2ee675c | 2015-08-03 18:45:08 +0200 | [diff] [blame] | 75 | $(DIFF) $(TEST_M68K)_e $(TEST_M68K)_o |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 76 | $(DIFF) $(TEST_MIPS)_e $(TEST_MIPS)_o |
Nguyen Anh Quynh | 1055a2e | 2014-03-10 14:37:08 +0800 | [diff] [blame] | 77 | $(DIFF) $(TEST_PPC)_e $(TEST_PPC)_o |
| 78 | $(DIFF) $(TEST_SPARC)_e $(TEST_SPARC)_o |
Nguyen Anh Quynh | 1c8405d | 2014-03-23 11:17:24 +0800 | [diff] [blame] | 79 | $(DIFF) $(TEST_SYSZ)_e $(TEST_SYSZ)_o |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 80 | $(DIFF) $(TEST_X86)_e $(TEST_X86)_o |
Nguyen Anh Quynh | 553bb48 | 2014-05-26 23:47:04 +0800 | [diff] [blame] | 81 | $(DIFF) $(TEST_XCORE)_e $(TEST_XCORE)_o |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 82 | |
danghvu | c698fb6 | 2013-12-01 13:48:53 -0600 | [diff] [blame] | 83 | clean: |
| 84 | rm -rf $(TMPDIR) |
danghvu | 0c478ab | 2014-05-12 14:35:54 -0500 | [diff] [blame] | 85 | cd java && $(MAKE) clean |
| 86 | cd python && $(MAKE) clean |
Nguyen Anh Quynh | 586be76 | 2014-09-21 23:23:38 +0800 | [diff] [blame] | 87 | cd ocaml && $(MAKE) clean |
danghvu | c698fb6 | 2013-12-01 13:48:53 -0600 | [diff] [blame] | 88 | |
Nguyen Anh Quynh | 984d450 | 2014-10-01 16:42:29 +0800 | [diff] [blame] | 89 | check: |
| 90 | make -C ocaml check |
| 91 | make -C python check |
| 92 | make -C java check |
| 93 | |
danghvu | 72a196e | 2013-11-27 10:00:13 -0600 | [diff] [blame] | 94 | FORCE: |