build: make: Add support for radio files and board info

This commit is contained in:
Danny Lin 2021-11-09 22:09:10 -08:00
parent adcfa688f2
commit 200f6f68c1

View file

@ -16,6 +16,9 @@ export interface Symlink {
export interface ModulesMakefile {
device: string
vendor: string
radioFiles?: Array<string>
symlinks: Array<Symlink>
}
@ -30,6 +33,7 @@ export interface ProductMakefile {
export interface BoardMakefile {
abOtaPartitions?: Array<string>
boardInfo?: string
}
export function sanitizeBasename(path: string) {
@ -53,6 +57,10 @@ export function serializeModulesMakefile(mk: ModulesMakefile) {
`ifeq ($(TARGET_DEVICE),${mk.device})`,
]
if (mk.radioFiles != undefined) {
blocks.push(mk.radioFiles.map(img => `$(call add-radio-file,${img})`).join('\n'))
}
for (let link of mk.symlinks) {
let destPath = partPathToMakePath(link.linkPartition, link.linkSubpath)
@ -65,10 +73,10 @@ include $(BUILD_SYSTEM)/base_rules.mk
$(LOCAL_BUILT_MODULE): TARGET := ${link.targetPath}
$(LOCAL_BUILT_MODULE): SYMLINK := ${destPath}
$(LOCAL_BUILT_MODULE):
\t@mkdir -p $(dir $@)
\t@mkdir -p $(dir $(SYMLINK))
\t@rm -rf $@
\t@rm -rf $(SYMLINK)
\t$(hide) mkdir -p $(dir $@)
\t$(hide) mkdir -p $(dir $(SYMLINK))
\t$(hide) rm -rf $@
\t$(hide) rm -rf $(SYMLINK)
\t$(hide) ln -sf $(TARGET) $(SYMLINK)
\t$(hide) touch $@`)
}
@ -112,5 +120,9 @@ export function serializeBoardMakefile(mk: BoardMakefile) {
addContBlock(blocks, 'AB_OTA_PARTITIONS', mk.abOtaPartitions)
if (mk.boardInfo != undefined) {
blocks.push(`TARGET_BOARD_INFO_FILE := ${mk.boardInfo}`)
}
return blocks.join('\n\n')
}