Removed the AutoGen-Code type of file build; added new macro for replacement.
[mirror_edk2.git] / BaseTools / Conf / build_rule.template
index 3fede25e6462cb5eb7b9012f39da2cac4d2e4516..91407f17eb5f0367bf4f7e8201e1a3930d56ee3b 100644 (file)
@@ -82,36 +82,35 @@ ToolChainFamilyMapping = {
 
 ## Build rules for makefile
 # Placeholders for string substitution
-#      ${fdir}         File relative directory within a module
+#   ${fpath}  File path relative to $(WORKSPACE)
+#   ${fdir}    File relative directory within a module
 #   ${fname}   File full name without path
 #   ${fbase}   File name without extension and path
-#   ${fext}     File extension
-#   ${dep}      Dependency file
-#   ${sep}      Directory separator
+#   ${fext}   File extension
+#   ${fdep}   File dependencies
+#   ${sep}    Directory separator
 #
 Makefile = {
 "nmake"        : {
 "C-Code"    : '''\
-${BEGIN}$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(WORKSPACE_DIR)${sep}${dep}
-${END} "$(CC)" $(CC_FLAGS) $(INC) /Fo$@ $(MODULE_DIR)${sep}${fdir}${sep}${fname}
-''',
-
-"AutoGen-Code"    : '''\
-${BEGIN}$(OUTPUT_DIR)${sep}${fbase}.obj : $(WORKSPACE_DIR)${sep}${dep}
-${END} "$(CC)" $(CC_FLAGS) $(INC) /Fo$@ $(DEBUG_DIR)${sep}${fname}
+$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(COMMON_DEPS)
+${BEGIN}$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(WORKSPACE)${sep}${fdep}
+${END} "$(CC)" $(CC_FLAGS) $(INC) /Fo$@ $(WORKSPACE)${sep}${fpath}
 ''',
 
 "Masm-Code" : '''\
-${BEGIN}$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(WORKSPACE_DIR)${sep}${dep}
-${END} "$(PP)" $(PP_FLAGS) $(INC) $(MODULE_DIR)${sep}${fdir}${sep}${fname} > $(@D)${sep}${fbase}.i
+$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(COMMON_DEPS)
+${BEGIN}$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(WORKSPACE)${sep}${fdep}
+${END} "$(PP)" $(PP_FLAGS) $(INC) $(WORKSPACE)${sep}${fpath} > $(@D)${sep}${fbase}.i
        Trim -CONVERT $(@D)${sep}${fbase}.i
        "$(ASM)" $(ASM_FLAGS) /Fo$@ $(@D)${sep}${fbase}.iii
 ''',
 
 "Iasm-Code" : '''\
-${BEGIN}$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(WORKSPACE_DIR)${sep}${dep}
-${END} "$(APP)" $(APP_FLAGS) $(INC) $< $(PP_OUTPUT)$(@D)${sep}${fbase}.i
-       "$(ASM)" $(ASM_FLAGS) $(ASM_OUTPUT)$@ $(@D)${sep}${fbase}.i
+$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(COMMON_DEPS)
+${BEGIN}$(OUTPUT_DIR)${sep}${fdir}${sep}${fbase}.obj : $(WORKSPACE)${sep}${fdep}
+${END} "$(APP)" $(APP_FLAGS) $(INC) $(WORKSPACE)${sep}${fpath} > $(@D)${sep}${fbase}.i
+       "$(ASM)" $(ASM_FLAGS) /Fo$@ $(@D)${sep}${fbase}.i
 ''',
 
 "Visual-Form-Representation" :