Home | History | Annotate | Download | only in GenSection
      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 INC                 = $(INC) -I $(EDK_TOOLS_SOURCE)\Common
     33 
     34 LIBS                = $(LIBS) $(EDK_TOOLS_OUTPUT)\CustomizedCompress.lib
     35 
     36 #

     37 # Target specific information

     38 #

     39 
     40 TARGET_NAME         = GenSection
     41 TARGET_SOURCE_DIR   = $(EDK_TOOLS_SOURCE)\$(TARGET_NAME)
     42 TARGET_EXE          = $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).exe
     43 TARGET_EXE_SOURCE   = "$(TARGET_SOURCE_DIR)\GenSection.c"
     44 TARGET_EXE_LIBS     = "$(EDK_TOOLS_OUTPUT)\Common.lib"
     45 TARGET_EXE_INCLUDE  = "$(EDK_SOURCE)\Foundation\Include\TianoCommon.h" \
     46                      "$(EDK_SOURCE)\Foundation\Framework\Include\EfiFirmwareFileSystem.h" \
     47                      "$(EDK_SOURCE)\Foundation\Framework\Include\EfiFirmwareVolumeHeader.h" \
     48                      "$(EDK_TOOLS_COMMON)\ParseInf.h"
     49 
     50 #

     51 # Build targets

     52 #

     53 
     54 all: $(TARGET_EXE)
     55 
     56 #

     57 # Build EXE

     58 #

     59 
     60 $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj: $(TARGET_EXE_SOURCE) $(TARGET_EXE_INCLUDE)
     61   $(CC) $(C_FLAGS) $(INC) $(TARGET_EXE_SOURCE) /Fo$(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj
     62 
     63 #

     64 # Add Binary Build description for this tool.

     65 #

     66 
     67 !IF (("$(EFI_BINARY_TOOLS)" == "YES") && EXIST($(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe))
     68 $(TARGET_EXE): $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe
     69   copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe $(TARGET_EXE) /Y
     70   if exist $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb \
     71   copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb /Y
     72 !ELSE
     73 $(TARGET_EXE): $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj $(LIBS) $(TARGET_EXE_LIBS)
     74   $(LINK) /DEBUG $(MSVS_LINK_LIBPATHS) $(L_FLAGS) $(LIBS) /out:$(TARGET_EXE) $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).obj $(TARGET_EXE_LIBS)
     75 !IF ("$(EFI_BINARY_BUILD)" == "YES")
     76   if not exist $(EFI_PLATFORM_BIN)\Tools mkdir $(EFI_PLATFORM_BIN)\Tools
     77   if exist $(TARGET_EXE) copy $(TARGET_EXE) $(EFI_PLATFORM_BIN)\tools\$(TARGET_NAME).exe /Y
     78   if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb \
     79   copy $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb /Y
     80 !ENDIF
     81 !ENDIF
     82 
     83 clean:
     84   @if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* del $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* > NUL
     85