Makefile.kmk revision 772269936494ffaddd0750ba9e28e805ba81398c
c7edde5d34a970face99f956a8a47636c11c995evboxsync# $Id$
c7edde5d34a970face99f956a8a47636c11c995evboxsync## @file
c7edde5d34a970face99f956a8a47636c11c995evboxsync# Sub-Makefile for the VBox Disassembler.
c7edde5d34a970face99f956a8a47636c11c995evboxsync#
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync#
772269936494ffaddd0750ba9e28e805ba81398cvboxsync# Copyright (C) 2006-2012 Oracle Corporation
c7edde5d34a970face99f956a8a47636c11c995evboxsync#
c7edde5d34a970face99f956a8a47636c11c995evboxsync# This file is part of VirtualBox Open Source Edition (OSE), as
c7edde5d34a970face99f956a8a47636c11c995evboxsync# available from http://www.virtualbox.org. This file is free software;
c7edde5d34a970face99f956a8a47636c11c995evboxsync# you can redistribute it and/or modify it under the terms of the GNU
c7edde5d34a970face99f956a8a47636c11c995evboxsync# General Public License (GPL) as published by the Free Software
c7edde5d34a970face99f956a8a47636c11c995evboxsync# Foundation, in version 2 as it comes in the "COPYING" file of the
c7edde5d34a970face99f956a8a47636c11c995evboxsync# VirtualBox OSE distribution. VirtualBox OSE is distributed in the
c7edde5d34a970face99f956a8a47636c11c995evboxsync# hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
c7edde5d34a970face99f956a8a47636c11c995evboxsync#
c7edde5d34a970face99f956a8a47636c11c995evboxsync
25220f21b353551be8929b1ed772a94dd5bb6293vboxsyncSUB_DEPTH = ../../../..
c7edde5d34a970face99f956a8a47636c11c995evboxsyncinclude $(KBUILD_PATH)/subheader.kmk
c7edde5d34a970face99f956a8a47636c11c995evboxsyncifdef VBOX_WITH_TESTCASES
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsyncPROGRAMS += tstDisasm-2
c7edde5d34a970face99f956a8a47636c11c995evboxsynctstDisasm-2_TEMPLATE = VBOXR3TSTEXE
9ad5e3912962c3dbccc1afc4e7d62890fe906814vboxsynctstDisasm-2_DEFS = IN_DIS
c7edde5d34a970face99f956a8a47636c11c995evboxsynctstDisasm-2_SOURCES = \
c7edde5d34a970face99f956a8a47636c11c995evboxsync tstDisasm-2.cpp
c7edde5d34a970face99f956a8a47636c11c995evboxsynctstDisasm-2_LIBS = \
3b3bc8a9383a065307e540b83fc3a3d6c548a082vboxsync $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) \
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(LIB_RUNTIME)
c7edde5d34a970face99f956a8a47636c11c995evboxsync
7748b9362d6a39df9045d5d05ccb57871145a649vboxsync# Tests that will be build, disassembled and re-build from disassembly.
c7edde5d34a970face99f956a8a47636c11c995evboxsyncVBOX_DISAS_TESTS_BUILD = \
b24dc7f75620c058f5ba7df435cacd9bff05e8f0vboxsync tstAsmFnstsw-1.asm \
c7edde5d34a970face99f956a8a47636c11c995evboxsync tstAsmLock-1.asm \
8599686860198730ae53d5895386d1b57dbc060evboxsync tstAsmMovSeg-1.asm \
8599686860198730ae53d5895386d1b57dbc060evboxsync tstAsmMovzx-1.asm \
8599686860198730ae53d5895386d1b57dbc060evboxsync tstAsmPop-1.asm \
8599686860198730ae53d5895386d1b57dbc060evboxsync tstAsmPush-1.asm \
8599686860198730ae53d5895386d1b57dbc060evboxsync tstAsmSignExtend-1.asm \
117b4009ec13a933e59dd5f66259a2488063c950vboxsync tstAsmRegs-1.asm \
c7edde5d34a970face99f956a8a47636c11c995evboxsync
7748b9362d6a39df9045d5d05ccb57871145a649vboxsync# Tests that only contains invalid/undefined instructions.
c7edde5d34a970face99f956a8a47636c11c995evboxsyncVBOX_DISAS_TESTS_INVALID = \
c7edde5d34a970face99f956a8a47636c11c995evboxsync tstAsmLock-2.asm \
c7edde5d34a970face99f956a8a47636c11c995evboxsync tstAsmLock-3.asm
c7edde5d34a970face99f956a8a47636c11c995evboxsync
8599686860198730ae53d5895386d1b57dbc060evboxsync# Tests that will be disassembled and re-build from disassembly (list of binaries).
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync## @todo tstBinMovzx-1.bin: does C7 imply 32-bit reg in 16-bit mode, or what exactly does it do?
8599686860198730ae53d5895386d1b57dbc060evboxsyncVBOX_DISAS_TESTS_BINARIES := \
b24dc7f75620c058f5ba7df435cacd9bff05e8f0vboxsync tstBinMovzx-1.bin \
b24dc7f75620c058f5ba7df435cacd9bff05e8f0vboxsync tstBinFnstsw-1.bin
117b4009ec13a933e59dd5f66259a2488063c950vboxsyncifeq ($(USER)x,bird)
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsyncVBOX_DISAS_TESTS_BINARIES += \
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync tstBin-1.bin \
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync tstBin-2.bin \
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync tstBin-3.bin \
b9609c7ffe24b4438bca69c315a3d280decd83d1vboxsync tstBin-4.bin \
b9609c7ffe24b4438bca69c315a3d280decd83d1vboxsync tstBin-5.bin \
b9609c7ffe24b4438bca69c315a3d280decd83d1vboxsync tstBin-6.bin
3b3bc8a9383a065307e540b83fc3a3d6c548a082vboxsync# $(PATH_STAGE_BIN)/testcase/tstDisasm-2$(SUFF_EXEC)
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsyncendif
8599686860198730ae53d5895386d1b57dbc060evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync#
c7edde5d34a970face99f956a8a47636c11c995evboxsync# The gory bits...
c7edde5d34a970face99f956a8a47636c11c995evboxsync#
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync# Where we put the output files from the testcases.
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsyncVBOX_DISAS_TEST_OUT_DIR := $(PATH_TARGET)/Disassembler/testcase
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsyncBLDDIRS += $(VBOX_DISAS_TEST_OUT_DIR)
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync# Generate the rules for creating the .bin files.
c7edde5d34a970face99f956a8a47636c11c995evboxsyncVBOX_DISAS_TESTS_BIN = $(VBOX_DISAS_TESTS_BUILD) $(VBOX_DISAS_TESTS_INVALID)
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsyncVBOX_DISAS_TEST_CLEAN += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BIN:.asm=-16.bin)\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BIN:.asm=-32.bin)\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BIN:.asm=-64.bin))
c7edde5d34a970face99f956a8a47636c11c995evboxsync
23eb2c553a4eede4f244e510a7a8c64c79596195vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-16.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-16.bin,%.asm,$$(notdir $$(@))) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Assembling: $(<F) into $(@F)"
4c0fd6e5274870a536dbd067370c27731bc75f4bvboxsync $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=16 -o $@ $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
23eb2c553a4eede4f244e510a7a8c64c79596195vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-32.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-32.bin,%.asm,$$(notdir $$(@))) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Assembling: $(<F) into $(@F)"
4c0fd6e5274870a536dbd067370c27731bc75f4bvboxsync $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=32 -o $@ $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
23eb2c553a4eede4f244e510a7a8c64c79596195vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-64.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-64.bin,%.asm,$$(notdir $$(@))) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Assembling: $(<F) into $(@F)"
4c0fd6e5274870a536dbd067370c27731bc75f4bvboxsync $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=64 -o $@ $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync# Generate the rules for the 'build' tests.
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsyncVBOX_DISAS_TEST_CLEAN += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BUILD:.asm=-16-disas.asm)\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.asm)\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.asm))
c7edde5d34a970face99f956a8a47636c11c995evboxsync
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-16-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(tstDisasm-2_1_STAGE_TARGET) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Generating: $(@F) from $(<F)"
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync $(REDIRECT) -E VBOX_LOG_DEST=nofile -o $@ -- $(tstDisasm-2_1_STAGE_TARGET) --style=yasm --cpumode=16 $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(tstDisasm-2_1_STAGE_TARGET) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Generating: $(@F) from $(<F)"
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync $(REDIRECT) -E VBOX_LOG_DEST=nofile -o $@ -- $(tstDisasm-2_1_STAGE_TARGET) --style=yasm --cpumode=32 $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.asm)): $$(subst -disas.asm,.bin,$$@) $$(tstDisasm-2_1_STAGE_TARGET) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Generating: $(@F) from $(<F)"
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync $(REDIRECT) -E VBOX_LOG_DEST=nofile -o $@ -- $(tstDisasm-2_1_STAGE_TARGET) --style=yasm --cpumode=64 $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsyncVBOX_DISAS_TEST_CLEAN += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BUILD:.asm=-16-disas.bin)\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.bin)\
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.bin))
c7edde5d34a970face99f956a8a47636c11c995evboxsync
23eb2c553a4eede4f244e510a7a8c64c79596195vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-16-disas.bin)): $$(subst .bin,.asm,$$@) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Re-assembling: $(<F) into $(@F)"
4c0fd6e5274870a536dbd067370c27731bc75f4bvboxsync $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=16 -o $@ $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
23eb2c553a4eede4f244e510a7a8c64c79596195vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-32-disas.bin)): $$(subst .bin,.asm,$$@) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Re-assembling: $(<F) into $(@F)"
4c0fd6e5274870a536dbd067370c27731bc75f4bvboxsync $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=32 -o $@ $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
23eb2c553a4eede4f244e510a7a8c64c79596195vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BUILD:.asm=-64-disas.bin)): $$(subst .bin,.asm,$$@) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Re-assembling: $(<F) into $(@F)"
4c0fd6e5274870a536dbd067370c27731bc75f4bvboxsync $(TOOL_YASM_AS) -f bin -a x86 --force-strict -DTEST_BITS=64 -o $@ $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsyncVBOX_DISAS_TESTS += $(foreach test, $(VBOX_DISAS_TESTS_BUILD:.asm=), $(test)-16.tst $(test)-32.tst $(test)-64.tst)
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,\
c7edde5d34a970face99f956a8a47636c11c995evboxsync$(VBOX_DISAS_TESTS_BUILD:.asm=-16.tst)\
c7edde5d34a970face99f956a8a47636c11c995evboxsync$(VBOX_DISAS_TESTS_BUILD:.asm=-32.tst)\
23eb2c553a4eede4f244e510a7a8c64c79596195vboxsync$(VBOX_DISAS_TESTS_BUILD:.asm=-64.tst) ): $$(subst .tst,-disas.bin,$$@) | $$(dir $$@)
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(ECHO) "Verifying build: $(<F) and $(@F:.tst=.bin)"
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(RM) -f $@
c7edde5d34a970face99f956a8a47636c11c995evboxsync $(CMP) $(@:.tst=.bin) $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(APPEND) $@ "done"
8599686860198730ae53d5895386d1b57dbc060evboxsync @$(ECHO) " PASSED: $(<F) [re-assembled]"
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync# Generate the rules for the 'invalid' tests.
c7edde5d34a970face99f956a8a47636c11c995evboxsyncVBOX_DISAS_TESTS += $(foreach test, $(VBOX_DISAS_TESTS_INVALID:.asm=), $(test)-16.tst $(test)-32.tst $(test)-64.tst)
c7edde5d34a970face99f956a8a47636c11c995evboxsync
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-16.tst)): $$(patsubst %.tst,%.bin,$$@) $$(tstDisasm-2_1_STAGE_TARGET) | $$(dir $$@)
7748b9362d6a39df9045d5d05ccb57871145a649vboxsync @$(ECHO) "TESTING: $(@F) [--undef-op=all]"
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(RM) -f $@
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync $(REDIRECT) -E VBOX_LOG_DEST=nofile -- $(tstDisasm-2_1_STAGE_TARGET) --undef-op=all --cpumode=16 $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(APPEND) $@ "done"
8599686860198730ae53d5895386d1b57dbc060evboxsync @$(ECHO) " PASSED: $(@F) [--undef-op=all]"
c7edde5d34a970face99f956a8a47636c11c995evboxsync
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-32.tst)): $$(patsubst %.tst,%.bin,$$@) $$(tstDisasm-2_1_STAGE_TARGET) | $$(dir $$@)
7748b9362d6a39df9045d5d05ccb57871145a649vboxsync @$(ECHO) "TESTING: $(@F) [--undef-op=all]"
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(RM) -f $@
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync $(REDIRECT) -E VBOX_LOG_DEST=nofile -- $(tstDisasm-2_1_STAGE_TARGET) --undef-op=all --cpumode=32 $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(APPEND) $@ "done"
8599686860198730ae53d5895386d1b57dbc060evboxsync @$(ECHO) " PASSED: $(@F) [--undef-op=all]"
c7edde5d34a970face99f956a8a47636c11c995evboxsync
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync$(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_INVALID:.asm=-64.tst)): $$(patsubst %.tst,%.bin,$$@) $$(tstDisasm-2_1_STAGE_TARGET) | $$(dir $$@)
7748b9362d6a39df9045d5d05ccb57871145a649vboxsync @$(ECHO) "TESTING: $(@F) [--undef-op=all]"
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(RM) -f $@
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync $(REDIRECT) -E VBOX_LOG_DEST=nofile -- $(tstDisasm-2_1_STAGE_TARGET) --undef-op=all --cpumode=64 $<
c7edde5d34a970face99f956a8a47636c11c995evboxsync @$(APPEND) $@ "done"
8599686860198730ae53d5895386d1b57dbc060evboxsync @$(ECHO) " PASSED: $(@F) [--undef-op=all]"
8599686860198730ae53d5895386d1b57dbc060evboxsync
8599686860198730ae53d5895386d1b57dbc060evboxsync
8599686860198730ae53d5895386d1b57dbc060evboxsync# Generate the rules for the binary tests.
8599686860198730ae53d5895386d1b57dbc060evboxsyncdefine def_vbox_disas_binary_rules
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync$(outbase).asm: $(full_binary) $$$$(tstDisasm-2_1_STAGE_TARGET) | $(VBOX_DISAS_TEST_OUT_DIR)/
8599686860198730ae53d5895386d1b57dbc060evboxsync @$$(ECHO) "Generating: $$(@F) from $$(<F)"
6144154d0dabfabf32622da8f5f8afc82f31e763vboxsync $$(REDIRECT) -E VBOX_LOG_DEST=nofile -o $$@ -- $$(tstDisasm-2_1_STAGE_TARGET) --style=yasm --cpumode=$(bits) --undef-op=db $$<
8599686860198730ae53d5895386d1b57dbc060evboxsync
8599686860198730ae53d5895386d1b57dbc060evboxsync$(outbase).bin + $(outbase).lst: $(outbase).asm
8599686860198730ae53d5895386d1b57dbc060evboxsync @$$(ECHO) "Re-assembling: $$(<F) into $$(@F)"
8599686860198730ae53d5895386d1b57dbc060evboxsync $$(TOOL_YASM_AS) -f bin -a x86 --force-strict -l $(outbase).lst -o $$@ $$<
8599686860198730ae53d5895386d1b57dbc060evboxsync
8599686860198730ae53d5895386d1b57dbc060evboxsync$(outbase).tst: $(outbase).bin
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync @$$(ECHO) "Verifying build: $$(<F) against $(not-dir $(full_binary))"
8599686860198730ae53d5895386d1b57dbc060evboxsync @$$(RM) -f $$@
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync $$(CMP) -l $(full_binary) $$<
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync @$$(APPEND) $$@ "done"
8599686860198730ae53d5895386d1b57dbc060evboxsync @$$(ECHO) " PASSED: $$(<F) [binary]"
8599686860198730ae53d5895386d1b57dbc060evboxsync
8599686860198730ae53d5895386d1b57dbc060evboxsync$(name).tst:: $(outbase).tst
8599686860198730ae53d5895386d1b57dbc060evboxsyncVBOX_DISAS_TEST_CLEAN += $(outbase).tst $(outbase).bin $(outbase).asm
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsyncVBOX_DISAS_TESTS += $(name)-rebuild-$(bits).tst
8599686860198730ae53d5895386d1b57dbc060evboxsyncendef # def_vbox_disas_binary_rules
8599686860198730ae53d5895386d1b57dbc060evboxsync
8599686860198730ae53d5895386d1b57dbc060evboxsyncdefine def_vbox_disas_binary
8599686860198730ae53d5895386d1b57dbc060evboxsynclocal name := $(notdir $(basename $(binary)))
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsynclocal full_binary := $(abspathex $(binary),$(PATH_SUB_CURRENT))
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsynclocal outbase := $(VBOX_DISAS_TEST_OUT_DIR)/$(name)-rebuild-$(bits)
8599686860198730ae53d5895386d1b57dbc060evboxsync$(eval $(def_vbox_disas_binary_rules))
8599686860198730ae53d5895386d1b57dbc060evboxsyncendef # def_vbox_disas_binary
8599686860198730ae53d5895386d1b57dbc060evboxsync
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync## @todo 64-bit is problematic because of bugs like POP RDI ending up as POP EDI (incorrect default opmode).
8599686860198730ae53d5895386d1b57dbc060evboxsync#$(foreach bits, 32 16 64, $(foreach binary, $(VBOX_DISAS_TESTS_BINARIES), $(evalvalctx def_vbox_disas_binary)))
8599686860198730ae53d5895386d1b57dbc060evboxsync$(foreach bits, 32 16, $(foreach binary, $(VBOX_DISAS_TESTS_BINARIES), $(evalvalctx def_vbox_disas_binary)))
8599686860198730ae53d5895386d1b57dbc060evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync# Add the .tst to the clean up.
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsyncVBOX_DISAS_TEST_CLEAN += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS))
4c0fd6e5274870a536dbd067370c27731bc75f4bvboxsyncOTHER_CLEAN += $(VBOX_DISAS_TEST_CLEAN)
4c0fd6e5274870a536dbd067370c27731bc75f4bvboxsync
d4fc85c3ee5e6be624f59217c7e677187f4ed1c1vboxsync# We don't want any of the tests rules to run in parallel because the
d4fc85c3ee5e6be624f59217c7e677187f4ed1c1vboxsync# output will be difficult to follow. Abusing VBOX_DISAS_TEST_CLEAN here...
b652dbeaf501acb237830c671ca51f8c02d7a8a9vboxsync.NOTPARALLEL: $$(VBOX_DISAS_TEST_CLEAN)
d4fc85c3ee5e6be624f59217c7e677187f4ed1c1vboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsync#
6a99216810d8b67d82b7b9a644193713ae8a7617vboxsync# Add the tests to the target list for the testing pass.
6a99216810d8b67d82b7b9a644193713ae8a7617vboxsync# (kBuild r1646)
c7edde5d34a970face99f956a8a47636c11c995evboxsync#
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsyncTESTING += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/,$(VBOX_DISAS_TESTS))
c7edde5d34a970face99f956a8a47636c11c995evboxsync
6a99216810d8b67d82b7b9a644193713ae8a7617vboxsync
6a99216810d8b67d82b7b9a644193713ae8a7617vboxsync#
6a99216810d8b67d82b7b9a644193713ae8a7617vboxsync# The test aliases
6a99216810d8b67d82b7b9a644193713ae8a7617vboxsync#
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync# To run the tstAsmLock-3.asm test: kmk tstAsmLock-3.tst
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync# To run the 64-bit tstAsmLock-3.asm test: kmk tstAsmLock-3-64.tst
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync#
c7edde5d34a970face99f956a8a47636c11c995evboxsyncdefine def_vbox_test_aliases
c7edde5d34a970face99f956a8a47636c11c995evboxsynclocal test_base := $(basename $(test))
c7edde5d34a970face99f956a8a47636c11c995evboxsynclocal test_root := $(patsubst %-16,%,$(patsubst %-32,%,$(patsubst %-64,%,$(test_base))))
ae9aac6344d9e90d833e48bf87eb9fe02fd75459vboxsync$(test_base).tst:: $(VBOX_DISAS_TEST_OUT_DIR)/$(test)
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync$(test_root).tst:: $(test_base).tst
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync$(test_base).o:: $(test_base).tst
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync$(test_base).obj:: $(test_base).tst
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync$(test_root).o:: $(test_root).tst
2cae8ff5782536dc236e1161d351356ba2ac5e0fvboxsync$(test_root).obj:: $(test_root).tst
c7edde5d34a970face99f956a8a47636c11c995evboxsyncendef
c7edde5d34a970face99f956a8a47636c11c995evboxsync$(foreach test,$(VBOX_DISAS_TESTS),$(evalvalctx def_vbox_test_aliases))
c7edde5d34a970face99f956a8a47636c11c995evboxsync
c7edde5d34a970face99f956a8a47636c11c995evboxsyncendif # VBOX_WITH_TESTCASES
772269936494ffaddd0750ba9e28e805ba81398cvboxsyncinclude $(FILE_KBUILD_SUB_FOOTER)
c7edde5d34a970face99f956a8a47636c11c995evboxsync