1 ## @file 2 # 3 # Copyright (c) 2010, Intel Corporation. All rights reserved.<BR> 4 # 5 # This program and the accompanying materials 6 # are licensed and made available under the terms and conditions of the BSD License 7 # which accompanies this distribution. The full text of the license may be found at 8 # http://opensource.org/licenses/bsd-license.php 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 # 13 ## 14 15 BASETOOLS_DIR = $(EDK_TOOLS_PATH)\Bin\Win32 16 17 # 18 # Build Macro 19 # 20 ASSEMBLY_CODE_FILE_LIST = $(MODULE_DIR)\bootsect.asm \ 21 $(MODULE_DIR)\bs16.asm \ 22 $(MODULE_DIR)\bs32.asm \ 23 $(MODULE_DIR)\efi32.asm \ 24 $(MODULE_DIR)\Gpt.asm \ 25 $(MODULE_DIR)\Mbr.asm \ 26 $(MODULE_DIR)\start.asm \ 27 $(MODULE_DIR)\start16.asm \ 28 $(MODULE_DIR)\start32.asm 29 30 TARGET_FILES = $(OUTPUT_DIR)\bootsect.com \ 31 $(OUTPUT_DIR)\bs16.com \ 32 $(OUTPUT_DIR)\bs32.com \ 33 $(OUTPUT_DIR)\Gpt.com \ 34 $(OUTPUT_DIR)\Mbr.com \ 35 $(OUTPUT_DIR)\Start.com \ 36 $(OUTPUT_DIR)\Start16.com \ 37 $(OUTPUT_DIR)\Start32.com \ 38 $(OUTPUT_DIR)\Start64.com \ 39 $(OUTPUT_DIR)\St16_64.com \ 40 $(OUTPUT_DIR)\St32_64.com \ 41 $(OUTPUT_DIR)\efi32.com2 \ 42 $(OUTPUT_DIR)\efi64.com2 43 44 INC = 45 46 47 #OBJECTS = 48 49 LIBS = 50 51 COMMON_DEPS = 52 53 all: $(TARGET_FILES) 54 55 #============= 56 $(OUTPUT_DIR)\bootsect.obj:$(MODULE_DIR)\bootsect.asm 57 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\bootsect.obj" /FR"$(OUTPUT_DIR)\bootsect.txt" "$(MODULE_DIR)\bootsect.asm" 58 59 $(OUTPUT_DIR)\bootsect.com:$(OUTPUT_DIR)\bootsect.obj 60 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\bootsect.obj,$(OUTPUT_DIR)\bootsect.com,$(OUTPUT_DIR)\bootsect.map,,, 61 62 #============= 63 64 $(OUTPUT_DIR)\bs16.obj:$(MODULE_DIR)\bs16.asm 65 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\bs16.obj" "$(MODULE_DIR)\bs16.asm" 66 67 $(OUTPUT_DIR)\bs16.com:$(OUTPUT_DIR)\bs16.obj 68 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\bs16.obj,$(OUTPUT_DIR)\bs16.com,$(OUTPUT_DIR)\bs16.map,,, 69 70 #============= 71 72 $(OUTPUT_DIR)\bs32.obj:$(MODULE_DIR)\bs32.asm 73 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\bs32.obj" "$(MODULE_DIR)\bs32.asm" 74 75 $(OUTPUT_DIR)\bs32.com:$(OUTPUT_DIR)\bs32.obj 76 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\bs32.obj,$(OUTPUT_DIR)\bs32.com,$(OUTPUT_DIR)\bs32.map,,, 77 78 #============= 79 80 $(OUTPUT_DIR)\Gpt.obj:$(MODULE_DIR)\Gpt.asm 81 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\Gpt.obj" "$(MODULE_DIR)\Gpt.asm" 82 83 $(OUTPUT_DIR)\Gpt.com:$(OUTPUT_DIR)\Gpt.obj 84 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\Gpt.obj,$(OUTPUT_DIR)\Gpt.com,$(OUTPUT_DIR)\Gpt.map,,, 85 86 #============= 87 88 $(OUTPUT_DIR)\Mbr.obj:$(MODULE_DIR)\Mbr.asm 89 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\Mbr.obj" "$(MODULE_DIR)\Mbr.asm" 90 91 $(OUTPUT_DIR)\Mbr.com:$(OUTPUT_DIR)\Mbr.obj 92 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\Mbr.obj,$(OUTPUT_DIR)\Mbr.com,$(OUTPUT_DIR)\Mbr.map,,, 93 94 #============ 95 96 $(OUTPUT_DIR)\Start.obj:$(MODULE_DIR)\Start.asm 97 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\Start.obj" "$(MODULE_DIR)\Start.asm" 98 99 $(OUTPUT_DIR)\Start.com:$(OUTPUT_DIR)\Start.obj 100 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\Start.obj,$(OUTPUT_DIR)\Start.com,$(OUTPUT_DIR)\Start.map,,, 101 102 #============= 103 104 $(OUTPUT_DIR)\Start16.obj:$(MODULE_DIR)\Start16.asm 105 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\Start16.obj" "$(MODULE_DIR)\Start16.asm" 106 107 $(OUTPUT_DIR)\Start16.com:$(OUTPUT_DIR)\Start16.obj 108 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\Start16.obj,$(OUTPUT_DIR)\Start16.com,$(OUTPUT_DIR)\Start16.map,,, 109 110 #============= 111 112 $(OUTPUT_DIR)\Start32.obj:$(MODULE_DIR)\Start32.asm 113 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\Start32.obj" "$(MODULE_DIR)\Start32.asm" 114 115 $(OUTPUT_DIR)\Start32.com:$(OUTPUT_DIR)\Start32.obj 116 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\Start32.obj,$(OUTPUT_DIR)\Start32.com,$(OUTPUT_DIR)\Start32.map,,, 117 118 #============= 119 120 $(OUTPUT_DIR)\Start64.obj:$(MODULE_DIR)\Start64.asm 121 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\Start64.obj" "$(MODULE_DIR)\Start64.asm" 122 123 $(OUTPUT_DIR)\Start64.com:$(OUTPUT_DIR)\Start64.obj 124 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\Start64.obj,$(OUTPUT_DIR)\Start64.com,$(OUTPUT_DIR)\Start64.map,,, 125 126 #============= 127 128 $(OUTPUT_DIR)\St16_64.obj:$(MODULE_DIR)\St16_64.asm 129 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\St16_64.obj" "$(MODULE_DIR)\St16_64.asm" 130 131 $(OUTPUT_DIR)\St16_64.com:$(OUTPUT_DIR)\St16_64.obj 132 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\St16_64.obj,$(OUTPUT_DIR)\St16_64.com,$(OUTPUT_DIR)\St16_64.map,,, 133 134 #============= 135 136 $(OUTPUT_DIR)\St32_64.obj:$(MODULE_DIR)\St32_64.asm 137 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\St32_64.obj" "$(MODULE_DIR)\St32_64.asm" 138 139 $(OUTPUT_DIR)\St32_64.com:$(OUTPUT_DIR)\St32_64.obj 140 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\St32_64.obj,$(OUTPUT_DIR)\St32_64.com,$(OUTPUT_DIR)\St32_64.map,,, 141 142 #============= 143 144 $(OUTPUT_DIR)\efi32.obj:$(MODULE_DIR)\efi32.asm 145 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\efi32.obj" "$(MODULE_DIR)\efi32.asm" 146 147 $(OUTPUT_DIR)\efi32.com:$(OUTPUT_DIR)\efi32.obj 148 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\efi32.obj,$(OUTPUT_DIR)\efi32.com,$(OUTPUT_DIR)\efi32.map,,, 149 150 #============= 151 152 $(OUTPUT_DIR)\efi32.com2:$(OUTPUT_DIR)\efi32.com 153 $(BASETOOLS_DIR)\Split.exe -f $(OUTPUT_DIR)\efi32.com -t $(OUTPUT_DIR)\efi32.com2 -s 135168 154 155 #============= 156 157 $(OUTPUT_DIR)\efi64.obj:$(MODULE_DIR)\efi64.asm 158 "$(ASM)" /c /omf /Fo"$(OUTPUT_DIR)\efi64.obj" "$(MODULE_DIR)\efi64.asm" 159 160 $(OUTPUT_DIR)\efi64.com:$(OUTPUT_DIR)\efi64.obj 161 "$(ASMLINK)" /tiny $(OUTPUT_DIR)\efi64.obj,$(OUTPUT_DIR)\efi64.com,$(OUTPUT_DIR)\efi64.map,,, 162 163 #============= 164 165 $(OUTPUT_DIR)\efi64.com2:$(OUTPUT_DIR)\efi64.com 166 $(BASETOOLS_DIR)\Split.exe -f $(OUTPUT_DIR)\efi64.com -t $(OUTPUT_DIR)\efi64.com2 -s 135168 167 168 169 clean: 170 if exist $(DEBUG_DIR) rmdir /s /q $(DEBUG_DIR) 171 if exist $(OUTPUT_DIR) rmdir /s /q $(OUTPUT_DIR) 172 173 174