summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--util/spd_tools/src/part_id_gen/part_id_gen.go16
1 files changed, 10 insertions, 6 deletions
diff --git a/util/spd_tools/src/part_id_gen/part_id_gen.go b/util/spd_tools/src/part_id_gen/part_id_gen.go
index 10388bfbf9..781c244cd4 100644
--- a/util/spd_tools/src/part_id_gen/part_id_gen.go
+++ b/util/spd_tools/src/part_id_gen/part_id_gen.go
@@ -244,6 +244,13 @@ type partIds struct {
memParts string
}
+func getFileHeader() string {
+ return `# SPDX-License-Identifier: GPL-2.0-or-later
+# This is an auto-generated file. Do not edit!!
+# Generated by:
+` + fmt.Sprintf("# %s\n\n", strings.Join(os.Args[0:], " "))
+}
+
/*
* For each part used by the variant, check if the SPD (as per the manifest) already has an ID
* assigned to it. If yes, then add the part name to the list of memory parts supported by the
@@ -339,22 +346,19 @@ func genPartIdInfo(parts []usedPart, partToSPDMap map[string]string, SPDToIndexM
}
fmt.Printf("%s", s)
+
+ s = getFileHeader() + s
err := ioutil.WriteFile(filepath.Join(makefileDirName, DRAMIdFileName), []byte(s), 0644)
return partIdList, err
}
-var generatedCodeLicense string = "## SPDX-License-Identifier: GPL-2.0-or-later"
-var autoGeneratedInfo string = "## This is an auto-generated file. Do not edit!!"
-
/*
* This function generates Makefile.inc under the variant directory path and adds assigned SPDs
* to SPD_SOURCES.
*/
func genMakefile(partIdList []partIds, makefileDirName string, SPDDir string) error {
- var s string
-
- s += fmt.Sprintf("%s\n%s\n\n", generatedCodeLicense, autoGeneratedInfo)
+ s := getFileHeader()
s += fmt.Sprintf("SPD_SOURCES =\n")
for i := 0; i < len(partIdList); i++ {