Add the ModifyInf tool
[mirror_edk2.git] / Tools / Source / TianoTools / GenFdImage / Makefile
1 #/*++
2 #
3 # Copyright (c) 2001 Intel Corporation. All rights reserved.
4 #
5 # This software and associated documentation (if any) is furnished under
6 # a license and may only be used or copied in accordance with the terms
7 # of the license. Except as permitted by such license, no part of this
8 # software or documentation may be reproduced, stored in a retrieval
9 # system, or transmitted in any form or by any means without the express
10 # written consent of Intel Corporation.
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 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 -I "$(TIANO_TOOLS_SOURCE)\GenFvImage"
41
42 #
43 # Target specific information
44 #
45
46 TARGET_NAME=GenFdImage
47 TARGET_SOURCE_DIR = $(TIANO_TOOLS_SOURCE)\$(TARGET_NAME)
48
49 TARGET_LIB = $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME).lib
50 TARGET_EXE = $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME).exe
51
52 TARGET_EXE_SOURCE = "$(TARGET_SOURCE_DIR)\GenFdImageExe.c"
53 TARGET_EXE_INCLUDE = "$(TARGET_SOURCE_DIR)\GenFdImageExe.h" \
54 "$(TARGET_SOURCE_DIR)\GenFdImage.h" \
55 "$(COMMON_SOURCE)\ParseInf.h" \
56 "$(EDK_SOURCE)\Foundation\Include\TianoCommon.h"
57 TARGET_EXE_LIBS = "$(TIANO_TOOLS_OUTPUT)\Common.lib" \
58 "$(TIANO_TOOLS_OUTPUT)\GenFvImage.lib" \
59 "$(TIANO_TOOLS_OUTPUT)\PeimFixup.lib"
60
61 TARGET_LIB_SOURCE = "$(TARGET_SOURCE_DIR)\GenFdImageLib.c"
62 TARGET_LIB_INCLUDE = "$(TARGET_SOURCE_DIR)\GenFdImage.h" \
63 "$(TIANO_TOOLS_SOURCE)\GenFvImage\GenFvImage.h" \
64 "$(COMMON_SOURCE)\ParseInf.h" \
65 "$(EDK_SOURCE)\Foundation\Include\TianoCommon.h"
66 TARGET_LIB_LIBS = "$(TIANO_TOOLS_OUTPUT)\Common.lib" \
67 "$(TIANO_TOOLS_OUTPUT)\GenFvImage.lib" \
68 "$(TIANO_TOOLS_OUTPUT)\PeimFixup.lib"
69
70
71 #
72 # Build targets
73 #
74
75 all: $(TARGET_LIB) $(TARGET_EXE)
76
77 #
78 # Build EXE
79 #
80
81 $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME).obj: $(TARGET_EXE_SOURCE) $(TARGET_EXE_INCLUDE)
82 $(CC) $(C_FLAGS) $(INC) $(TARGET_EXE_SOURCE) /Fo$(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME).obj
83
84 $(TARGET_EXE): $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME).obj $(TARGET_EXE_LIBS) $(TARGET_LIB)
85 $(LINK) $(MSVS_LINK_LIBPATHS) $(L_FLAGS) $(LIBS) /out:$(TARGET_EXE) $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME).obj $(TARGET_LIB) $(TARGET_EXE_LIBS)
86
87 #
88 # Build LIB
89 #
90
91 $(TARGET_LIB): $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.obj $(TARGET_LIB_LIBS)
92 $(LIB) $(LIB_FLAGS) $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.obj /OUT:$(TARGET_LIB)
93
94 $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.obj: $(TARGET_LIB_SOURCE) $(TARGET_LIB_INCLUDE)
95 $(CC) $(C_FLAGS) $(INC) $(TARGET_LIB_SOURCE) /Fo$(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.obj
96
97
98 clean:
99 @if exist $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.* del /q $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME)Lib.* > NUL
100 @if exist $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME).* del /q $(TIANO_TOOLS_OUTPUT)\$(TARGET_NAME).* > NUL