# $Id: Makefile.kmk $ ## @file # Sub-Makefile for the VBox Disassembler. # # # Copyright (C) 2006-2023 Oracle and/or its affiliates. # # This file is part of VirtualBox base platform packages, as # available from https://www.virtualbox.org. # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation, in version 3 of the # License. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # SPDX-License-Identifier: GPL-3.0-only # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk ifdef VBOX_WITH_TESTCASES if1of ($(KBUILD_TARGET_ARCH), amd64 x86) PROGRAMS += tstDisasm-1 tstDisasm-1_TEMPLATE = VBoxR3TstExe tstDisasm-1_DEFS = IN_DIS tstDisasm-1_SOURCES = \ tstDisasm-1.cpp \ tstDisasm-1A.asm tstDisasm-1_LIBS = \ $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) \ $(LIB_RUNTIME) PROGRAMS += tstDisasmCore-1 tstDisasmCore-1_EXTENDS = tstDisasm-1 tstDisasmCore-1_DEFS = IN_DIS DIS_CORE_ONLY tstDisasmCore-1_LIBS = \ $(PATH_STAGE_LIB)/DisasmCoreR3$(VBOX_SUFF_LIB) \ $(LIB_RUNTIME) endif PROGRAMS += tstDisasm-2 tstDisasm-2_TEMPLATE = VBoxR3TstExe tstDisasm-2_DEFS = IN_DIS tstDisasm-2_SOURCES = \ tstDisasm-2.cpp tstDisasm-2_LIBS = \ $(PATH_STAGE_LIB)/DisasmR3$(VBOX_SUFF_LIB) \ $(LIB_RUNTIME) # Tests that will be build, disassembled and re-build from disassembly. VBOX_DISAS_TESTS_BUILD = \ tstAsmFnstsw-1.asm \ tstAsmLock-1.asm \ tstAsmMovFixedReg-1.asm \ tstAsmMovSeg-1.asm \ tstAsmMovzx-1.asm \ tstAsmPop-1.asm \ tstAsmPush-1.asm \ tstAsmSignExtend-1.asm \ tstAsmRegs-1.asm \ tstAsm3DNow-1.asm # Tests that only contains invalid/undefined instructions. VBOX_DISAS_TESTS_INVALID = \ tstAsmLock-2.asm \ tstAsmLock-3.asm # Tests that will be disassembled and re-build from disassembly (list of binaries). ## @todo tstBinMovzx-1.bin: does C7 imply 32-bit reg in 16-bit mode, or what exactly does it do? VBOX_DISAS_TESTS_BINARIES := \ tstBinMovzx-1.bin \ tstBinFnstsw-1.bin ifeq ($(USER)x,bird) VBOX_DISAS_TESTS_BINARIES += \ tstBin-1.bin \ tstBin-2.bin \ tstBin-3.bin \ tstBin-4.bin \ tstBin-5.bin \ tstBin-6.bin # $(PATH_STAGE_BIN)/testcase/tstDisasm-2$(SUFF_EXEC) endif VBOX_DISAS_TESTS_BINARIES_NOT_16BIT := \ tstBinFnstsw-1.bin VBOX_DISAS_TESTS_BINARIES_NOT_32BIT := VBOX_DISAS_TESTS_BINARIES_NOT_64BIT := # # The gory bits... # # Where we put the output files from the testcases. VBOX_DISAS_TEST_OUT_DIR := $(PATH_TARGET)/Disassembler/testcase BLDDIRS += $(VBOX_DISAS_TEST_OUT_DIR) # Generate the rules for creating the .bin files. VBOX_DISAS_TESTS_BIN = $(VBOX_DISAS_TESTS_BUILD) $(VBOX_DISAS_TESTS_INVALID) VBOX_DISAS_TEST_CLEAN += $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, \ $(VBOX_DISAS_TESTS_BIN:.asm=-16.bin) \ $(VBOX_DISAS_TESTS_BIN:.asm=-32.bin) \ $(VBOX_DISAS_TESTS_BIN:.asm=-64.bin)) $(addprefix $(VBOX_DISAS_TEST_OUT_DIR)/, $(VBOX_DISAS_TESTS_BIN:.asm=-16.bin)): $(PATH_SUB_CURRENT)/$$(patsubst %-16.bin,%.asm,$$(notdir $$(@))) | $$(dir $$@) @$(ECHO) "Assembling: $(