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 # Common information 31 # 32 33 INC=$(INC) \ 34 -I "$(EDK_TOOLS_COMMON)" 35 36 37 38 # 39 # Target specific information 40 # 41 42 TARGET_NAME=GenFvImage 43 44 TARGET_SOURCE_DIR = $(EDK_TOOLS_SOURCE)\$(TARGET_NAME) 45 TARGET_LIB = $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).lib 46 TARGET_EXE = $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).exe 47 TARGET_EXE_SOURCE = "$(TARGET_SOURCE_DIR)\GenFvImageExe.c" 48 49 TARGET_EXE_INCLUDE = "$(TARGET_SOURCE_DIR)\GenFvImageExe.h" \ 50 "$(TARGET_SOURCE_DIR)\GenFvImageLib.h" \ 51 "$(EDK_TOOLS_COMMON)\ParseInf.h" \ 52 "$(EDK_SOURCE)\Foundation\Include\TianoCommon.h" 53 54 TARGET_EXE_LIBS = "$(EDK_TOOLS_OUTPUT)\Common.lib" 55 TARGET_LIB_SOURCE = "$(TARGET_SOURCE_DIR)\GenFvImageLib.c" 56 57 TARGET_LIB_INCLUDE = "$(TARGET_SOURCE_DIR)\GenFvImageLib.h" \ 58 "$(TARGET_SOURCE_DIR)\GenFvImageLibInternal.h" \ 59 "$(EDK_TOOLS_COMMON)\ParseInf.h" \ 60 "$(EDK_SOURCE)\Foundation\Include\TianoCommon.h" \ 61 "$(EDK_SOURCE)\Foundation\Framework\Include\EfiFirmwareVolumeHeader.h" \ 62 "$(EDK_SOURCE)\Foundation\Framework\Include\EfiFirmwareFileSystem.h" \ 63 "$(EDK_SOURCE)\Foundation\Framework\Guid\FirmwareFileSystem\FirmwareFileSystem.h" 64 65 TARGET_LIB_LIBS = "$(EDK_TOOLS_OUTPUT)\Common.lib" 66 # 67 # Build targets 68 # 69 70 all: $(TARGET_EXE) 71 72 # 73 # Build EXE 74 # 75 76 $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj: $(TARGET_EXE_SOURCE) $(TARGET_EXE_INCLUDE) 77 $(CC) $(C_FLAGS) $(INC) $(TARGET_EXE_SOURCE) /Fo$(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj 78 79 # 80 # Add Binary Build description for this tool. 81 # 82 83 !IF (("$(EFI_BINARY_TOOLS)" == "YES") && EXIST($(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe)) 84 $(TARGET_EXE): $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe 85 copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe $(TARGET_EXE) /Y 86 if exist $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb \ 87 copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb /Y 88 !ELSE 89 $(TARGET_EXE): $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj $(TARGET_EXE_LIBS) $(TARGET_LIB) 90 $(LINK) $(MSVS_LINK_LIBPATHS) $(L_FLAGS) $(LIBS) /out:$(TARGET_EXE) $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj $(TARGET_LIB) $(TARGET_EXE_LIBS) 91 !IF ("$(EFI_BINARY_BUILD)" == "YES") 92 if not exist $(EFI_PLATFORM_BIN)\Tools mkdir $(EFI_PLATFORM_BIN)\Tools 93 if exist $(TARGET_EXE) copy $(TARGET_EXE) $(EFI_PLATFORM_BIN)\tools\$(TARGET_NAME).exe /Y 94 if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb \ 95 copy $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb /Y 96 !ENDIF 97 !ENDIF 98 99 # 100 # Build LIB 101 # 102 103 $(TARGET_LIB): $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.obj $(TARGET_LIB_LIBS) 104 $(LIB_EXE) $(LIB_FLAGS) $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.obj $(MSVS_LINK_LIBPATHS) $(TARGET_LIB_LIBS) RPCRT4.lib /OUT:$(TARGET_LIB) 105 106 $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.obj: $(TARGET_LIB_SOURCE) $(TARGET_LIB_INCLUDE) 107 $(CC) $(C_FLAGS) $(INC) $(TARGET_LIB_SOURCE) /Fo$(EDK_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.obj 108 109 clean: 110 @if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.* del $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.* > NUL 111 @if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* del $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* > NUL 112