Merge pull request #35862 from mansnils:MbedBuildGeneration
PiperOrigin-RevId: 292400516 Change-Id: I04bfa9c605c656d4bbdcdd79402c79cacc0cb248
This commit is contained in:
commit
a59426a65c
@ -2,6 +2,9 @@
|
|||||||
# Reverses a space-separated list of words.
|
# Reverses a space-separated list of words.
|
||||||
reverse = $(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1)))) $(firstword $(1))
|
reverse = $(if $(1),$(call reverse,$(wordlist 2,$(words $(1)),$(1)))) $(firstword $(1))
|
||||||
|
|
||||||
|
# Get macros only (i.e. the ones starting with -D) from two lists and remove duplicates
|
||||||
|
getmacros = $(patsubst -D%,%,$(filter -D%,$(sort $(filter -D%, $(1)) $(filter -D%, $(2)))))
|
||||||
|
|
||||||
# Look for platform or target-specific implementation files to replace reference
|
# Look for platform or target-specific implementation files to replace reference
|
||||||
# implementations with, given a tag. These are expected to occur in subfolders
|
# implementations with, given a tag. These are expected to occur in subfolders
|
||||||
# of a directory where a reference implementation exists, and have the same
|
# of a directory where a reference implementation exists, and have the same
|
||||||
@ -92,6 +95,12 @@ $(PRJDIR)$(3)/$(1)/.vscode/tasks.json : tensorflow/lite/micro/tools/make/templat
|
|||||||
@cp $$< $$@
|
@cp $$< $$@
|
||||||
|
|
||||||
generate_$(3)_$(1)_project: $(addprefix $(PRJDIR)$(3)/$(1)/, $(4) $(5) $(2))
|
generate_$(3)_$(1)_project: $(addprefix $(PRJDIR)$(3)/$(1)/, $(4) $(5) $(2))
|
||||||
|
ifeq (mbed, $(1))
|
||||||
|
$(eval macrolist := $(call getmacros, $7, $8))
|
||||||
|
$(eval jsonfilename := $(PRJDIR)$(3)/$(1)/mbed_app)
|
||||||
|
@awk 'FNR==NR{ if (/}/) p=NR; next} 1; FNR==(p-1){ n=split("$(macrolist)",a," "); print(" ,\"macros\": [");for (i=1; i <= n; i++){ printf(" \"%s\"", a[i]); if(i<n){printf(",\n")}}printf("\n ]\n")}' \
|
||||||
|
$(jsonfilename).json $(jsonfilename).json > $(jsonfilename).tmp && mv $(jsonfilename).tmp $(jsonfilename).json
|
||||||
|
endif
|
||||||
|
|
||||||
list_$(3)_$(1)_files:
|
list_$(3)_$(1)_files:
|
||||||
@echo $(4) $(5)
|
@echo $(4) $(5)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user