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 EFI VFR compiler 19 # 20 #--*/ 21 22 23 !IFNDEF EDK_SOURCE 24 !ERROR EDK_SOURCE environmental variable not set 25 !ENDIF 26 27 !IFNDEF TOOLCHAIN 28 TOOLCHAIN = TOOLCHAIN_MSVC 29 !ENDIF 30 31 !INCLUDE $(BUILD_DIR)\PlatformTools.env 32 33 .SUFFIXES : 34 35 TARGET_NAME = VfrCompile 36 37 ETO = $(EDK_TOOLS_OUTPUT) 38 SRC = $(EDK_TOOLS_SOURCE)\Uefi$(TARGET_NAME) 39 TARGET_EXE = $(ETO)\$(TARGET_NAME).exe 40 41 42 43 INC = -I $(SRC) \ 44 -I $(EDK_SOURCE)\Foundation\Include\Ia32 \ 45 -I $(EDK_SOURCE)\Foundation\Efi\Include \ 46 -I $(EDK_SOURCE)\Foundation\Framework\Include \ 47 -I $(EDK_SOURCE)\Foundation\Include\IndustryStandard \ 48 -I $(EDK_SOURCE)\Foundation\ \ 49 -I $(EDK_SOURCE)\Foundation\Core\Dxe \ 50 -I $(EDK_SOURCE)\Foundation\Efi \ 51 -I $(EDK_SOURCE)\Foundation\Framework \ 52 -I $(EDK_TOOLS_SOURCE)\Common \ 53 -I $(EDK_SOURCE)\Foundation\Include 54 55 ANTLR_FLAGS = -CC -e3 -ck 3 -k 2 56 DLG_FLAGS = -C2 -i -CC 57 LINK_FLAGS_PCCTS = /DEBUG /PDB:$*.pdb 58 C_FLAGS_PCCTS = -I. -I$(ANTLR_H) /WX /Od /EHsc /Zi /Fd$(ETO)\$(TARGET_NAME)Obj /D _CRT_SECURE_NO_DEPRECATE $(VERSION_FLAGS) \ 59 $(BUILD_STRING_FLAGS) /D PCCTS_USE_NAMESPACE_STD #/D CVFR_VARDATATYPEDB_DEBUG /D CIFROBJ_DEUBG /D VFREXP_DEBUG 60 61 VFR_GRAMMER_FILE = $(SRC)\VfrSyntax.g 62 63 VFR_ANTLR_SPAWN = $(ETO)\VfrSyntax.cpp \ 64 $(ETO)\EfiVfrParser.cpp \ 65 $(ETO)\EfiVfrParser.h \ 66 $(ETO)\VfrParser.dlg \ 67 $(ETO)\VfrTokens.h 68 69 VFR_DLG_SPAWN = $(ETO)\VfrLexer.cpp \ 70 $(ETO)\VfrLexer.h 71 72 ANTLR_H = $(PCCTS_DIR)\h 73 74 HEADER_FILES = $(SRC)\VfrFormPkg.h \ 75 $(SRC)\EfiVfr.h \ 76 $(SRC)\VfrCompiler.h \ 77 $(SRC)\VfrError.h \ 78 $(SRC)\VfrUtilityLib.h 79 80 OBJECTS = $(ETO)\AParser.obj \ 81 $(ETO)\DLexerBase.obj \ 82 $(ETO)\ATokenBuffer.obj \ 83 $(ETO)\VfrSyntax.obj \ 84 $(ETO)\EfiVfrParser.obj \ 85 $(ETO)\VfrLexer.obj \ 86 $(ETO)\VfrFormPkg.obj \ 87 $(ETO)\VfrError.obj \ 88 $(ETO)\VfrUtilityLib.obj \ 89 $(ETO)\VfrCompiler.obj 90 91 all : $(TARGET_EXE) 92 93 $(VFR_ANTLR_SPAWN) : $(VFR_GRAMMER_FILE) 94 $(ANTLR) $(ANTLR_FLAGS) -fl VfrParser.dlg -ft VfrTokens.h -o $(ETO) $(VFR_GRAMMER_FILE) 95 96 $(VFR_DLG_SPAWN) : $(ETO)\VfrParser.dlg 97 $(DLG) $(DLG_FLAGS) -cl VfrLexer -o $(ETO) $(ETO)\VfrParser.dlg 98 99 $(ETO)\VfrSyntax.obj : $(ETO)\VfrSyntax.cpp $(VFR_DLG_SPAWN) 100 $(CC) -c $(C_FLAGS_PCCTS) /Fo$@ $(INC) $(ETO)\VfrSyntax.cpp 101 102 $(ETO)\EfiVfrParser.obj : $(ETO)\EfiVfrParser.cpp $(ETO)\EfiVfrParser.h $(VFR_DLG_SPAWN) 103 $(CC) -c $(C_FLAGS_PCCTS) /Fo$@ $(INC) $(ETO)\EfiVfrParser.cpp 104 105 106 $(ETO)\AParser.obj : $(ANTLR_H)\AParser.cpp 107 $(CC) -c $(C_FLAGS_PCCTS) /Fo$@ $(ANTLR_H)\AParser.cpp 108 109 $(ETO)\ATokenBuffer.obj : $(ANTLR_H)\ATokenBuffer.cpp 110 $(CC) -c $(C_FLAGS_PCCTS) /Fo$@ $(ANTLR_H)\ATokenBuffer.cpp 111 112 $(ETO)\DLexerBase.obj : $(ANTLR_H)\DLexerBase.cpp 113 $(CC) -c $(C_FLAGS_PCCTS) /Fo$@ $(ANTLR_H)\DLexerBase.cpp 114 115 $(ETO)\VfrLexer.obj : $(ETO)\VfrLexer.cpp $(VFR_DLG_SPAWN) 116 $(CC) -c $(C_FLAGS_PCCTS) /Fo$@ $(INC) $(ETO)\VfrLexer.cpp 117 118 $(ETO)\VfrFormPkg.obj : $(SRC)\VfrFormPkg.cpp $(HEADER_FILES) 119 $(CC) -c $(C_FLAGS_PCCTS) $(INC) /Fo$@ $(SRC)\VfrFormPkg.cpp 120 121 $(ETO)\VfrError.obj : $(SRC)\VfrError.cpp $(HEADER_FILES) 122 $(CC) -c $(C_FLAGS_PCCTS) $(INC) /Fo$@ $(SRC)\VfrError.cpp 123 124 $(ETO)\VfrUtilityLib.obj : $(SRC)\VfrUtilityLib.cpp $(HEADER_FILES) 125 $(CC) -c $(C_FLAGS_PCCTS) $(INC) /Fo$@ $(SRC)\VfrUtilityLib.cpp 126 127 $(ETO)\VfrCompiler.obj : $(SRC)\VfrCompiler.cpp $(HEADER_FILES) 128 $(CC) -c $(C_FLAGS_PCCTS) $(INC) /Fo$@ $(SRC)\VfrCompiler.cpp 129 130 # 131 # Add Binary Build description for this tools. 132 # 133 134 !IF (("$(EFI_BINARY_TOOLS)" == "YES") && EXIST($(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe)) 135 $(TARGET_EXE): $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe 136 copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).exe $(TARGET_EXE) /Y 137 if exist $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb \ 138 copy $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb /Y 139 !ELSE 140 $(TARGET_EXE) : $(OBJECTS) $(HEADER_FILES) 141 $(LINK) $(MSVS_LINK_LIBPATHS) $(LINK_FLAGS_PCCTS) /OUT:$(TARGET_EXE) $(OBJECTS) 142 !IF ("$(EFI_BINARY_BUILD)" == "YES") 143 if not exist $(EFI_PLATFORM_BIN)\Tools mkdir $(EFI_PLATFORM_BIN)\Tools 144 if exist $(TARGET_EXE) copy $(TARGET_EXE) $(EFI_PLATFORM_BIN)\tools\$(TARGET_NAME).exe /Y 145 if exist $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb \ 146 copy $(EDK_TOOLS_OUTPUT)\$(TARGET_NAME).pdb $(EFI_PLATFORM_BIN)\Tools\$(TARGET_NAME).pdb /Y 147 !ENDIF 148 !ENDIF 149 150 clean: 151