Home | History | Annotate | Download | only in ProcessDsc
      1 #/*++

      2 #  

      3 #  Copyright (c) 2004 - 2010, 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:

     13 #  

     14 #    Makefile

     15 #  

     16 #  Abstract:

     17 #  

     18 #    makefile for building the ProcessDsc utility.

     19 #    

     20 #--*/  

     21 
     22 #

     23 # Make sure environmental variable EDK_SOURCE is set

     24 #

     25 !IFNDEF EDK_SOURCE
     26 !ERROR EDK_SOURCE environmental variable not set 
     27 !ENDIF
     28 
     29 #

     30 # Do this if you want to compile from this directory

     31 #

     32 !IFNDEF TOOLCHAIN
     33 TOOLCHAIN = TOOLCHAIN_MSVC
     34 !ENDIF
     35 
     36 !INCLUDE $(BUILD_DIR)\PlatformTools.env
     37 
     38 #

     39 # Target specific information

     40 #

     41 
     42 TARGET_NAME         = ProcessDsc
     43 TARGET_SRC_DIR      = $(EDK_TOOLS_SOURCE)\$(TARGET_NAME)
     44 TARGET_EXE          = $(EDK_TOOLS_OUTPUT)\ProcessDsc.exe
     45 
     46 #

     47 # Build targets

     48 #

     49 
     50 all: $(TARGET_EXE)
     51 
     52 INC_DEPS  = $(TARGET_SRC_DIR)\DSCFile.h     $(INC_DEPS)
     53 INC_DEPS  = $(TARGET_SRC_DIR)\MultiThread.h $(INC_DEPS)
     54 INC_DEPS  = $(TARGET_SRC_DIR)\FWVolume.h    $(INC_DEPS)
     55 INC_DEPS  = $(TARGET_SRC_DIR)\Exceptions.h  $(INC_DEPS)
     56 INC_DEPS  = $(TARGET_SRC_DIR)\Common.h      $(INC_DEPS)
     57 
     58 LIBS      = $(LIBS) "$(EDK_TOOLS_OUTPUT)\Common.lib"
     59 
     60 OBJECTS   = $(EDK_TOOLS_OUTPUT)\DSCFile.obj     \
     61             $(EDK_TOOLS_OUTPUT)\MultiThread.obj \
     62             $(EDK_TOOLS_OUTPUT)\FWVolume.obj    \
     63             $(EDK_TOOLS_OUTPUT)\ProcessDsc.obj  \
     64             $(EDK_TOOLS_OUTPUT)\Exceptions.obj
     65 
     66 #

     67 # Compile each source file

     68 #

     69 C_FLAGS   = $(C_FLAGS) /MT /wd4201
     70 
     71 $(EDK_TOOLS_OUTPUT)\DSCFile.obj : $(TARGET_SRC_DIR)\DSCFile.c $(INC_DEPS)
     72   $(CC) $(C_FLAGS) $(TARGET_SRC_DIR)\DSCFile.c /Fo$@
     73 
     74 $(EDK_TOOLS_OUTPUT)\MultiThread.obj : $(TARGET_SRC_DIR)\MultiThread.c $(INC_DEPS)
     75   $(CC) $(C_FLAGS) $(TARGET_SRC_DIR)\MultiThread.c /Fo$@
     76 
     77 $(EDK_TOOLS_OUTPUT)\FWVolume.obj : $(TARGET_SRC_DIR)\FWVolume.c $(INC_DEPS)
     78   $(CC) $(C_FLAGS) $(TARGET_SRC_DIR)\FWVolume.c /Fo$@
     79 
     80 $(EDK_TOOLS_OUTPUT)\ProcessDsc.obj : $(TARGET_SRC_DIR)\ProcessDsc.c $(INC_DEPS)
     81   $(CC) $(C_FLAGS) $(TARGET_SRC_DIR)\ProcessDsc.c /Fo$@
     82 
     83 $(EDK_TOOLS_OUTPUT)\Exceptions.obj : $(TARGET_SRC_DIR)\Exceptions.c $(INC_DEPS)
     84   $(CC) $(C_FLAGS) $(TARGET_SRC_DIR)\Exceptions.c /Fo$@
     85 
     86 #

     87 # Add Binary Build description for this tool.

     88 #

     89 
     90 !IF (("$(EFI_BINARY_TOOLS)" == "YES") && EXIST($(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe))
     91 $(TARGET_EXE): $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe
     92   copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe $(TARGET_EXE) /Y
     93   if exist $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb \
     94   copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb /Y
     95 !ELSE
     96 $(TARGET_EXE) : $(OBJECTS) $(LIBS)
     97   $(LINK) $(MSVS_LINK_LIBPATHS) $(L_FLAGS) $(LIBS) /out:$(TARGET_EXE) $(OBJECTS) shlwapi.lib \
     98   /NODEFAULTLIB:libc.lib  /NODEFAULTLIB:msvcrt.lib /NODEFAULTLIB:libcd.lib \
     99   /NODEFAULTLIB:libcmtd.lib /NODEFAULTLIB:msvcrtd.lib
    100 !IF ("$(EFI_BINARY_BUILD)" == "YES")
    101   if not exist $(EFI_PLATFORM_BIN)\Tools mkdir $(EFI_PLATFORM_BIN)\Tools
    102   if exist $(TARGET_EXE) copy $(TARGET_EXE) $(EFI_PLATFORM_BIN)\tools\$(TARGET_NAME).exe /Y
    103   if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb \
    104   copy $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb /Y
    105 !ENDIF
    106 !ENDIF
    107 
    108 clean:
    109   @if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* del $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).* > NUL
    110   @if exist $(EDK_TOOLS_OUTPUT)\DscFile.* del $(EDK_TOOLS_OUTPUT)\DscFile.* > NUL
    111   @if exist $(EDK_TOOLS_OUTPUT)\MultiThread.* del $(EDK_TOOLS_OUTPUT)\MultiThread.* > NUL
    112   @if exist $(EDK_TOOLS_OUTPUT)\Exceptions* del $(EDK_TOOLS_OUTPUT)\Exceptions.* > NUL
    113   @if exist $(EDK_TOOLS_OUTPUT)\FwVolume.* del $(EDK_TOOLS_OUTPUT)\FwVolume.* > NUL
    114