# $Id: Makefile.kmk 31787 2010-08-19 13:04:31Z vboxsync $ ## @file # Sub-Makefile for the IPRT testcases. # # # Copyright (C) 2006-2010 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. # # The contents of this file may alternatively be used under the terms # of the Common Development and Distribution License Version 1.0 # (CDDL) only, as it comes in the "COPYING.CDDL" file of the # VirtualBox OSE distribution, in which case the provisions of the # CDDL are applicable instead of those of the GPL. # # You may elect to license modified versions of this file under the # terms and conditions of either the GPL or the CDDL or both. # SUB_DEPTH = ../../../.. include $(KBUILD_PATH)/subheader.kmk ifdef VBOX_WITH_TESTCASES # # Globals # # WARNING: Careful with this wrt to the other sub-makefiles this joins. # TEMPLATE = VBOXR3TSTEXE # Defined by the parent makefile as well (for errmsgdata.h). IPRT_OUT_DIR ?= $(PATH_TARGET)/Runtime # # Target lists # PROGRAMS += \ tstRTAssertCompile \ tstRTAvl \ tstRTBase64 \ tstRTBitOperations \ tstRTCidr \ tstRTCritSect \ tstRTDigest \ tstDir \ tstDir-2 \ tstDir-3 \ tstEnv \ tstErrUnique \ tstFile \ tstRTFileAio \ tstRTFileAppend-1 \ tstFileLock \ tstFork \ tstRTGetOpt \ tstRTGetOptArgv \ tstHandleTable \ tstRTHeapOffset \ tstRTHeapSimple \ tstInlineAsm \ tstLdr \ tstLdrLoad \ tstRTList \ tstRTLockValidator \ tstLog \ tstMemAutoPtr \ tstRTMemEf \ tstRTMemCache \ tstRTMemPool \ tstMove \ tstMp-1 \ tstOnce \ tstRTPath \ tstRTPipe \ tstRTPoll \ tstRTProcCreateEx \ tstPrfRT \ tstRand \ tstRTFsQueries \ tstSemEvent \ tstSemMutex \ tstSemPingPong \ tstRTSemRW \ tstSems \ tstRTSemXRoads \ tstRTSort \ tstRTStrAlloc \ tstRTStrCache \ tstRTStrFormat \ tstStrSimplePattern \ tstStrToNum \ tstRTStrVersion \ tstRTSystemQueryDmi \ tstRTSystemQueryOsInfo \ tstRTTemp \ tstTermCallbacks \ tstThread-1 \ tstTime \ tstTime-2 \ tstTime-3 \ tstTime-4 \ tstTimer \ tstTimerLR \ tstRTTimeSpec \ tstUtf8 \ tstRTUuid # tstSems PROGRAMS.win += \ tstRTProcWait \ tstRTCritSectW32 \ tstFileAppendWin-1 \ ntGetTimerResolution PROGRAMS.linux += \ tstRTProcWait \ tstRTProcIsRunningByName \ tstRTBitOperationsPIC3 \ tstInlineAsmPIC \ tstInlineAsmPIC3 PROGRAMS.solaris += \ tstRTCoreDump PROGRAMS.l4 += \ tstIoCtl PROGRAMS.darwin += \ tstDarwinSched ifdef VBOX_WITH_LIBCURL PROGRAMS += \ tstRTS3 endif if1of ($(KBUILD_TARGET_ARCH), amd64 x86) PROGRAMS += \ tstLdr-2 \ tstLdr-3 \ tstLdr-4 \ tstNoCrt-1 \ tstRTR0MemUserKernelDriver \ tstRTR0SemMutexDriver \ tstR0ThreadPreemptionDriver \ tstTSC SYSMODS += \ tstLdrObjR0 \ tstRTR0MemUserKernel \ tstRTR0SemMutex \ tstR0ThreadPreemption ifdef VBOX_WITH_RAW_MODE SYSMODS += tstLdrObj endif endif if1of ($(VBOX_LDR_FMT)), lx pe) LIBRARIES += \ tstLdr-4Imp endif # # Target configs in almost alphabetical order. # tstRTAssertCompile_TEMPLATE = VBOXR3TSTEXE tstRTAssertCompile_NOINST = true tstRTAssertCompile_SOURCES = tstRTAssertCompile.cpp tstRTAvl_TEMPLATE = VBOXR3TSTEXE tstRTAvl_SOURCES = tstRTAvl.cpp tstRTBase64_TEMPLATE = VBOXR3TSTEXE tstRTBase64_SOURCES = tstRTBase64.cpp tstRTBitOperations_TEMPLATE = VBOXR3TSTEXE tstRTBitOperations_SOURCES = tstRTBitOperations.cpp tstRTBitOperationsPIC3_TEMPLATE = VBOXR3TSTEXE tstRTBitOperationsPIC3_SOURCES = tstRTBitOperations.cpp tstRTBitOperationsPIC3_CXXFLAGS = -fPIC -fomit-frame-pointer -O3 tstRTBitOperationsPIC3_DEFS = PIC tstRTCidr_TEMPLATE = VBOXR3TSTEXE tstRTCidr_SOURCES = tstRTCidr.cpp tstRTCritSect_TEMPLATE = VBOXR3TSTEXE tstRTCritSect_SOURCES = tstRTCritSect.cpp tstRTCritSectW32_TEMPLATE = VBOXR3TSTEXE tstRTCritSectW32_SOURCES = tstRTCritSect.cpp tstRTCritSectW32_DEFS = TRY_WIN32_CRIT tstRTDigest_SOURCES = tstRTDigest.cpp tstDir_SOURCES = tstDir.cpp tstDir-2_SOURCES = tstDir-2.cpp tstDir-3_SOURCES = tstDir-3.cpp tstEnv_SOURCES = tstEnv.cpp # Note: tstErrUnique.cpp depends on a header generated by the makefile above us. tstErrUnique_SOURCES = tstErrUnique.cpp tstErrUnique_INCS = $(IPRT_OUT_DIR)/ tstErrUnique.cpp_DEPS = $(IPRT_OUT_DIR)/errmsgdata.h tstFile_SOURCES = tstFile.cpp tstRTFileAio_SOURCES = VBOXR3TSTEXE tstRTFileAio_SOURCES = tstRTFileAio.cpp tstRTFileAppend-1_TEMPLATE = VBOXR3TSTEXE tstRTFileAppend-1_SOURCES = tstRTFileAppend-1.cpp tstFileAppendWin-1_SOURCES = tstFileAppendWin-1.cpp tstFileLock_SOURCES = tstFileLock.cpp tstFork_SOURCES = tstFork.cpp tstRTGetOpt_TEMPLATE = VBOXR3TSTEXE tstRTGetOpt_SOURCES = tstRTGetOpt.cpp tstRTGetOptArgv_TEMPLATE = VBOXR3TSTEXE tstRTGetOptArgv_SOURCES = tstRTGetOptArgv.cpp tstHandleTable_SOURCES = tstHandleTable.cpp tstRTHeapOffset_TEMPLATE = VBOXR3TSTEXE tstRTHeapOffset_SOURCES = tstRTHeapOffset.cpp tstRTHeapSimple_TEMPLATE = VBOXR3TSTEXE tstRTHeapSimple_SOURCES = tstRTHeapSimple.cpp tstIoCtl_SOURCES = tstIoCtl.cpp tstInlineAsm_SOURCES = tstInlineAsm.cpp tstInlineAsmPIC_SOURCES = tstInlineAsm.cpp tstInlineAsmPIC_CXXFLAGS = -fPIC tstInlineAsmPIC_DEFS = PIC tstInlineAsmPIC3_SOURCES = tstInlineAsm.cpp tstInlineAsmPIC3_CXXFLAGS = -fPIC -fomit-frame-pointer -O3 tstInlineAsmPIC3_DEFS = PIC tstLdr_SOURCES = tstLdr.cpp tstLdr-2_SOURCES = tstLdr-2.cpp tstLdr-2_DEFS = IN_DIS tstLdr-2_LIBS = \ $(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB) ifdef VBOX_WITH_RAW_MODE tstLdrObj_TEMPLATE = VBoxRc tstLdrObj_INST = $(INST_TESTCASE) tstLdrObj_SYSSUFF = .gc tstLdrObj_SOURCES = tstLdrObj.cpp tstLdrObj_DEFS = IN_DIS IN_RT_RC DIS_CORE_ONLY ifeq ($(VBOX_LDR_FMT32),elf) tstLdrObj_DEFS += VBOX_SOME_IMPORT_FUNCTION endif tstLdrObj_LIBS = \ $(PATH_LIB)/DisasmRC$(VBOX_SUFF_LIB) \ $(PATH_LIB)/RuntimeRC$(VBOX_SUFF_LIB) ifeq ($(VBOX_LDR_FMT32),pe) tstLdrObj_LIBS += \ $(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) endif # PE ifeq ($(VBOX_LDR_FMT32),elf) tstLdrObj_LDFLAGS = -e Entrypoint endif ifeq ($(VBOX_LDR_FMT32),lx) tstLdrObj_LIBS += \ $(PATH_LIB)/VMMGCBuiltin$(VBOX_SUFF_LIB) endif endif # VBOX_WITH_RAW_MODE tstLdr-3_SOURCES = tstLdr-3.cpp tstLdr-3_DEFS = IN_DIS tstLdr-3_LIBS = \ $(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB) tstLdr-4Imp_TEMPLATE = VBoxR0 ifeq ($(VBOX_LDR_FMT),lx) tstLdr-4Imp_SOURCES = tstLdr-4Imp-os2.def else ifeq ($(VBOX_LDR_FMT),pe) tstLdr-4Imp_SOURCES.win = tstLdr-4Imp-win.def endif tstLdrObjR0_TEMPLATE = VBoxR0 tstLdrObjR0_INST = $(INST_TESTCASE) tstLdrObjR0_SYSSUFF = .r0 tstLdrObjR0_SOURCES = tstLdrObjR0.cpp tstLdrDisasmTest.cpp tstLdrObjR0_DEFS = IN_DIS IN_RT_R0 DIS_CORE_ONLY ifeq ($(VBOX_LDR_FMT32),elf) tstLdrObjR0_DEFS += VBOX_SOME_IMPORT_FUNCTION endif ifn1of ($(KBUILD_TARGET), win) tstLdrObjR0_CXXFLAGS = $(VBOX_GCC_Wno-array_bounds) endif tstLdrObjR0_LIBS = \ $(PATH_LIB)/DisasmR0$(VBOX_SUFF_LIB) \ $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB) ifeq ($(VBOX_LDR_FMT),pe) tstLdrObjR0_LIBS += \ $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) \ $(TARGET_tstLdr-4Imp) endif ifeq ($(VBOX_LDR_FMT),elf) tstLdrObjR0_LDFLAGS = -e Entrypoint endif ifeq ($(VBOX_LDR_FMT),lx) tstLdrObjR0_LIBS += \ $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) \ $(TARGET_tstLdr-4Imp) endif tstLdr-4_SOURCES = tstLdr-4.cpp tstLdrDisasmTest.cpp tstLdr-4_DEFS = IN_DIS tstLdr-4_LIBS = \ $(PATH_LIB)/DisasmR3$(VBOX_SUFF_LIB) tstLdrLoad_SOURCES = tstLdrLoad.cpp tstRTList_TEMPLATE = VBOXR3TSTEXE tstRTList_SOURCES = tstRTList.cpp tstRTLockValidator_TEMPLATE = VBOXR3TSTEXE tstRTLockValidator_SOURCES = tstRTLockValidator.cpp tstLog_SOURCES = tstLog.cpp tstMemAutoPtr_SOURCES = tstMemAutoPtr.cpp tstRTMemEf_TEMPLATE = VBOXR3TSTEXE tstRTMemEf_SOURCES = tstRTMemEf.cpp tstRTMemCache_TEMPLATE = VBOXR3TSTEXE tstRTMemCache_SOURCES = tstRTMemCache.cpp tstRTMemPool_TEMPLATE = VBOXR3TSTEXE tstRTMemPool_SOURCES = tstRTMemPool.cpp tstRTR0MemUserKernel_TEMPLATE = VBoxR0 tstRTR0MemUserKernel_INST = $(INST_TESTCASE) tstRTR0MemUserKernel_DEFS = IN_RT_R0 tstRTR0MemUserKernel_SYSSUFF = .r0 tstRTR0MemUserKernel_SOURCES = tstRTR0MemUserKernel.cpp tstRTR0MemUserKernel_LIBS = $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB) if1of ($(VBOX_LDR_FMT), pe lx) tstRTR0MemUserKernel_LIBS += $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) endif tstRTR0MemUserKernelDriver_SOURCES = tstRTR0MemUserKernelDriver.cpp tstMove_SOURCES = tstMove.cpp tstMp-1_SOURCES = tstMp-1.cpp tstNoCrt-1_DEFS = RT_WITHOUT_NOCRT_WRAPPER_ALIASES tstNoCrt-1_SOURCES = \ tstNoCrt-1.cpp \ ../common/string/memcpy.asm \ ../common/string/mempcpy.asm \ ../common/string/memmove.asm \ ../common/string/memset.asm \ ../common/string/memchr.asm \ ../common/string/memcmp.asm \ ../common/string/strchr.asm \ ../common/string/strcmp.asm \ ../common/string/strcpy.asm \ ../common/string/strlen.asm tstOnce_SOURCES = tstOnce.cpp tstRTPath_TEMPLATE = VBOXR3TSTEXE tstRTPath_SOURCES = tstRTPath.cpp tstRTPipe_TEMPLATE = VBOXR3TSTEXE tstRTPipe_SOURCES = tstRTPipe.cpp tstRTPoll_TEMPLATE = VBOXR3TSTEXE tstRTPoll_SOURCES = tstRTPoll.cpp tstPrfRT_SOURCES = tstPrfRT.cpp tstRand_SOURCES = tstRand.cpp tstR0ThreadPreemption_TEMPLATE = VBoxR0 tstR0ThreadPreemption_INST = $(INST_TESTCASE) tstR0ThreadPreemption_DEFS = IN_RT_R0 tstR0ThreadPreemption_SYSSUFF = .r0 tstR0ThreadPreemption_SOURCES = tstR0ThreadPreemption.cpp tstR0ThreadPreemption_LIBS = $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB) if1of ($(VBOX_LDR_FMT), pe lx) tstR0ThreadPreemption_LIBS += $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) endif tstR0ThreadPreemptionDriver_TEMPLATE = VBOXR3TSTEXE tstR0ThreadPreemptionDriver_SOURCES = tstR0ThreadPreemptionDriver.cpp tstRTR0SemMutex_TEMPLATE = VBoxR0 tstRTR0SemMutex_INST = $(INST_TESTCASE) tstRTR0SemMutex_DEFS = IN_RT_R0 tstRTR0SemMutex_SYSSUFF = .r0 tstRTR0SemMutex_SOURCES = tstRTR0SemMutex.cpp tstRTR0SemMutex_LIBS = $(PATH_LIB)/RuntimeR0$(VBOX_SUFF_LIB) if1of ($(VBOX_LDR_FMT), pe lx) tstRTR0SemMutex_LIBS += $(PATH_LIB)/SUPR0$(VBOX_SUFF_LIB) endif tstRTR0SemMutexDriver_TEMPLATE = VBOXR3TSTEXE tstRTR0SemMutexDriver_SOURCES = tstRTR0SemMutexDriver.cpp tstRTFsQueries_SOURCES = tstRTFsQueries.cpp tstRTProcCreateEx_TEMPLATE = VBOXR3TSTEXE tstRTProcCreateEx_SOURCES = tstRTProcCreateEx.cpp tstRTProcWait_SOURCES = tstRTProcWait.cpp tstRTProcIsRunningByName_SOURCES = tstRTProcIsRunningByName.cpp tstRTS3_SOURCES = tstRTS3.cpp tstSemMutex_SOURCES = tstSemMutex.cpp tstSemEvent_SOURCES = tstSemEvent.cpp tstRTSemRW_TEMPLATE = VBOXR3TSTEXE tstRTSemRW_SOURCES = tstRTSemRW.cpp tstSemPingPong_SOURCES = tstSemPingPong.cpp tstSems_SOURCES = tstSems.cpp tstRTSemXRoads_TEMPLATE = VBOXR3TSTEXE tstRTSemXRoads_SOURCES = tstRTSemXRoads.cpp tstRTSort_TEMPLATE = VBOXR3TSTEXE tstRTSort_SOURCES = tstRTSort.cpp tstRTStrAlloc_TEMPLATE = VBOXR3TSTEXE tstRTStrAlloc_SOURCES = tstRTStrAlloc.cpp tstRTStrCache_TEMPLATE = VBOXR3TSTEXE tstRTStrCache_SOURCES = tstRTStrCache.cpp tstRTStrFormat_SOURCES = tstRTStrFormat.cpp tstStrSimplePattern_SOURCES = tstStrSimplePattern.cpp tstStrToNum_SOURCES = tstStrToNum.cpp tstRTStrVersion_TEMPLATE = VBOXR3TSTEXE tstRTStrVersion_SOURCES = tstRTStrVersion.cpp tstRTSystemQueryDmi_TEMPLATE = VBOXR3TSTEXE tstRTSystemQueryDmi_SOURCES = tstRTSystemQueryDmi.cpp tstRTSystemQueryOsInfo_TEMPLATE = VBOXR3TSTEXE tstRTSystemQueryOsInfo_SOURCES = tstRTSystemQueryOsInfo.cpp tstRTTemp_TEMPLATE = VBOXR3TSTEXE tstRTTemp_SOURCES = tstRTTemp.cpp tstTermCallbacks_SOURCES = tstTermCallbacks.cpp tstThread-1_SOURCES = tstThread-1.cpp tstTime_SOURCES = tstTime.cpp tstTime-2_SOURCES = tstTime-2.cpp tstTime-3_SOURCES = tstTime-3.cpp tstTime-4_SOURCES = tstTime-4.cpp tstTimer_SOURCES = tstTimer.cpp tstTimerLR_SOURCES = tstTimerLR.cpp tstRTTimeSpec_TEMPLATE = VBOXR3TSTEXE tstRTTimeSpec_SOURCES = tstRTTimeSpec.cpp tstTSC_SOURCES = tstTSC.cpp tstTSC_CXXFLAGS.linux += -O3 tstRTUuid_TEMPLATE = VBOXR3TSTEXE tstRTUuid_SOURCES = tstRTUuid.cpp tstUtf8_SOURCES = tstUtf8.cpp tstRTCoreDump_TEMPLACE = VBOXR3TSTEXE tstRTCoreDump_SOURCES = tstRTCoreDump.cpp # # odds and ends # tstDarwinSched_SOURCES = tstDarwinSched.cpp ntGetTimerResolution_SOURCES = ntGetTimerResolution.cpp ntGetTimerResolution_SDKS.win = WINPSDK W2K3DDK VBOX_NTDLL endif # VBOX_WITH_TESTCASES # # Various useful tools # # RTLdrFlt is similar to c++filt, except that it's for VMMR0.r0 stacks. PROGRAMS += RTLdrFlt RTLdrFlt_TEMPLATE = VBOXR3TSTEXE RTLdrFlt_SOURCES = RTLdrFlt.cpp include $(KBUILD_PATH)/subfooter.kmk