# $Id: Makefile.kmk 56297 2015-06-09 14:31:41Z vboxsync $ ## @file # Sub-Makefile for the VBox Disassembler. # # # Copyright (C) 2006-2015 Oracle Corporation # # This file is part of VirtualBox Open Source Edition (OSE), as # available from http://www.virtualbox.org. This file is free software; # you can redistribute it and/or modify it under the terms of the GNU # General Public License (GPL) as published by the Free Software # Foundation, in version 2 as it comes in the "COPYING" file of the # VirtualBox OSE distribution. VirtualBox OSE is distributed in the # hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk ifdef VBOX_WITH_TESTCASES 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 += 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: $(