1 #/*++ 2 # 3 # Copyright (c) 2004 - 2007, Intel Corporation. All rights reserved.<BR> 4 # This program and the accompanying materials 5 # are licensed and made available under the terms and conditions of the BSD License 6 # which accompanies this distribution. The full text of the license may be found at 7 # http://opensource.org/licenses/bsd-license.php 8 # 9 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 10 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 11 # 12 # Module Name: makefile 13 # 14 # Abstract: 15 # 16 # This file is used to build the EFI utility. 17 # 18 #--*/ 19 20 # 21 # Do this if you want to compile from this directory 22 # 23 !IFNDEF TOOLCHAIN 24 TOOLCHAIN = TOOLCHAIN_MSVC 25 !ENDIF 26 27 !INCLUDE $(BUILD_DIR)\PlatformTools.env 28 29 # 30 # Define some macros we use here. Should get rid of them someday and 31 # get rid of the extra level of indirection. 32 # 33 COMMON_SOURCE = $(EDK_TOOLS_COMMON) 34 35 # 36 # Common information 37 # 38 39 INC=$(INC) 40 41 # 42 # Target specific information 43 # 44 45 TARGET_NAME=GenDepex 46 TARGET_LIB_NAME=DepexParser 47 TARGET_SOURCE_DIR = $(EDK_TOOLS_SOURCE)\$(TARGET_NAME) 48 49 TARGET_LIB = $(EDK_TOOLS_OUTPUT)\$(TARGET_LIB_NAME).lib 50 TARGET_EXE = $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).exe 51 52 TARGET_LIB_SOURCE = "$(TARGET_SOURCE_DIR)\DepexParser.c" 53 TARGET_LIB_INCLUDE = "$(TARGET_SOURCE_DIR)\DepexParser.h" 54 55 TARGET_EXE_SOURCE = "$(TARGET_SOURCE_DIR)\GenDepex.c" 56 TARGET_EXE_INCLUDE = "$(EDK_SOURCE)\Foundation\Include\TianoCommon.h" 57 58 # 59 # Build targets 60 # 61 62 all: $(TARGET_EXE) 63 64 # 65 # Build EXE 66 # 67 68 $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj: $(TARGET_EXE_SOURCE) $(TARGET_EXE_INCLUDE) 69 $(CC) $(C_FLAGS) $(INC) $(TARGET_EXE_SOURCE) /Fo$(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj 70 71 # 72 # Add Binary Build description for this tool. 73 # 74 75 !IF (("$(EFI_BINARY_TOOLS)" == "YES") && EXIST($(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe)) 76 $(TARGET_EXE): $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe 77 copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe $(TARGET_EXE) /Y 78 if exist $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb \ 79 copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb /Y 80 !ELSE 81 $(TARGET_EXE): $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj $(TARGET_LIB) 82 $(LINK) $(MSVS_LINK_LIBPATHS) $(L_FLAGS) $(LIBS) /out:$(TARGET_EXE) $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj $(TARGET_LIB) 83 !IF ("$(EFI_BINARY_BUILD)" == "YES") 84 if not exist $(EFI_PLATFORM_BIN)\Tools mkdir $(EFI_PLATFORM_BIN)\Tools 85 if exist $(TARGET_EXE) copy $(TARGET_EXE) $(EFI_PLATFORM_BIN)\tools\$(TARGET_NAME).exe /Y 86 if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb \ 87 copy $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb /Y 88 !ENDIF 89 !ENDIF 90 91 # 92 # Build LIB 93 # 94 95 $(TARGET_LIB): $(EDK_TOOLS_OUTPUT)\$(TARGET_LIB_NAME).obj 96 $(LIB_EXE) $(LIB_FLAGS) $(EDK_TOOLS_OUTPUT)\$(TARGET_LIB_NAME).obj /OUT:$(TARGET_LIB) 97 98 $(EDK_TOOLS_OUTPUT)\$(TARGET_LIB_NAME).obj: $(TARGET_LIB_SOURCE) $(TARGET_LIB_INCLUDE) 99 $(CC) $(C_FLAGS) $(INC) $(TARGET_LIB_SOURCE) /Fo$(EDK_TOOLS_OUTPUT)\$(TARGET_LIB_NAME).obj 100 101 clean: 102 @if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* del $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* > NUL 103