Skip to content

Commit 82e1cbd

Browse files
petewardentensorflower-gardener
authored andcommitted
Fix bug in files generated for Arduino projects, and add descriptive name
PiperOrigin-RevId: 254324071
1 parent 40b8579 commit 82e1cbd

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

tensorflow/lite/experimental/micro/tools/make/helper_functions.inc

+10-5
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,6 @@ endef
107107
# can invoke to create the standalone project.
108108
define generate_arduino_project
109109

110-
ARDUINO_SRCS := $(patsubst tensorflow/lite/experimental/micro/tools/make/downloads/%,third_party/%,$(patsubst %.cc,%.cpp,$(3)))
111-
ARDUINO_HDRS := $(patsubst tensorflow/lite/experimental/micro/tools/make/downloads/,third_party/,$(4))
112-
113110
$(PRJDIR)$(2)/arduino/src/%.cpp: %.cc
114111
@mkdir -p $$(dir $$@)
115112
python tensorflow/lite/experimental/micro/tools/make/transform_arduino_source.py \
@@ -140,7 +137,7 @@ $(PRJDIR)$(2)/arduino/src/third_party/kissfft/kiss_fft.h: tensorflow/lite/experi
140137
$(PRJDIR)$(2)/arduino/%: tensorflow/lite/experimental/micro/tools/make/templates/%
141138
@mkdir -p $$(dir $$@)
142139
sed -E 's#\%\{SRCS\}\%#$(3)#g' $$< | \
143-
sed -E 's#\%\{EXECUTABLE\}\%#$(1)#g' | \
140+
sed -E 's#\%\{EXECUTABLE\}\%#$(2)#g' | \
144141
sed -E 's#\%\{LINKER_FLAGS\}\%#$(5)#g' | \
145142
sed -E 's#\%\{CXX_FLAGS\}\%#$(6)#g' | \
146143
sed -E 's#\%\{CC_FLAGS\}\%#$(7)#g' > $$@
@@ -153,7 +150,15 @@ $(PRJDIR)$(2)/arduino/src/TensorFlowLite.h: tensorflow/lite/experimental/micro/t
153150
@mkdir -p $$(dir $$@)
154151
cp $$< $$@
155152

156-
generate_$(2)_arduino_project: $(addprefix $(PRJDIR)$(2)/arduino/src/,$(ARDUINO_SRCS) $(ARDUINO_HDRS)) $(addprefix $(PRJDIR)$(2)/arduino/,$(1)) $(PRJDIR)$(2)/arduino/examples/$(2)/$(2).ino $(PRJDIR)$(2)/arduino/src/TensorFlowLite.h
153+
# This would be cleaner if we broke up the list of dependencies into variables,
154+
# but these get hard to define with the evaluation approach used to define make
155+
# functions.
156+
generate_$(2)_arduino_project: $(addprefix $(PRJDIR)$(2)/arduino/src/,\
157+
$(patsubst tensorflow/lite/experimental/micro/tools/make/downloads/%,third_party/%,$(patsubst %.cc,%.cpp,$(3))) \
158+
$(patsubst tensorflow/lite/experimental/micro/tools/make/downloads/,third_party/,$(4))) \
159+
$(addprefix $(PRJDIR)$(2)/arduino/,$(1)) \
160+
$(PRJDIR)$(2)/arduino/examples/$(2)/$(2).ino \
161+
$(PRJDIR)$(2)/arduino/src/TensorFlowLite.h
157162

158163
generate_$(2)_arduino_library_zip: generate_$(2)_arduino_project
159164
cd $(PRJDIR)$(2) && cp -r arduino $(2) && zip -r $(2).zip $(2)

tensorflow/lite/experimental/micro/tools/make/templates/library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name=TensorFlowLite
1+
name=TensorFlowLite:%{EXECUTABLE}%
22
version=1.13
33
author=TensorFlow Authors
44
maintainer=Pete Warden <[email protected]>

0 commit comments

Comments
 (0)