From 200f6f68c1ade281c76e7d0324d5191485b9ed66 Mon Sep 17 00:00:00 2001 From: Danny Lin Date: Tue, 9 Nov 2021 22:09:10 -0800 Subject: [PATCH] build: make: Add support for radio files and board info --- src/build/make.ts | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/build/make.ts b/src/build/make.ts index a09d3dd..ae84f5e 100644 --- a/src/build/make.ts +++ b/src/build/make.ts @@ -16,6 +16,9 @@ export interface Symlink { export interface ModulesMakefile { device: string vendor: string + + radioFiles?: Array + symlinks: Array } @@ -30,6 +33,7 @@ export interface ProductMakefile { export interface BoardMakefile { abOtaPartitions?: Array + 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') }