Skip to content
This repository has been archived by the owner on Aug 22, 2023. It is now read-only.

Commit

Permalink
Fix bug in files generated for Arduino projects, and add descriptive …
Browse files Browse the repository at this point in the history
…name

PiperOrigin-RevId: 254324071
  • Loading branch information
petewarden authored and tensorflower-gardener committed Jun 21, 2019
1 parent 40b8579 commit 82e1cbd
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions tensorflow/lite/experimental/micro/tools/make/helper_functions.inc
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,6 @@ endef
# can invoke to create the standalone project.
define generate_arduino_project

ARDUINO_SRCS := $(patsubst tensorflow/lite/experimental/micro/tools/make/downloads/%,third_party/%,$(patsubst %.cc,%.cpp,$(3)))
ARDUINO_HDRS := $(patsubst tensorflow/lite/experimental/micro/tools/make/downloads/,third_party/,$(4))

$(PRJDIR)$(2)/arduino/src/%.cpp: %.cc
@mkdir -p $$(dir $$@)
python tensorflow/lite/experimental/micro/tools/make/transform_arduino_source.py \
Expand Down Expand Up @@ -140,7 +137,7 @@ $(PRJDIR)$(2)/arduino/src/third_party/kissfft/kiss_fft.h: tensorflow/lite/experi
$(PRJDIR)$(2)/arduino/%: tensorflow/lite/experimental/micro/tools/make/templates/%
@mkdir -p $$(dir $$@)
sed -E 's#\%\{SRCS\}\%#$(3)#g' $$< | \
sed -E 's#\%\{EXECUTABLE\}\%#$(1)#g' | \
sed -E 's#\%\{EXECUTABLE\}\%#$(2)#g' | \
sed -E 's#\%\{LINKER_FLAGS\}\%#$(5)#g' | \
sed -E 's#\%\{CXX_FLAGS\}\%#$(6)#g' | \
sed -E 's#\%\{CC_FLAGS\}\%#$(7)#g' > $$@
Expand All @@ -153,7 +150,15 @@ $(PRJDIR)$(2)/arduino/src/TensorFlowLite.h: tensorflow/lite/experimental/micro/t
@mkdir -p $$(dir $$@)
cp $$< $$@

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
# This would be cleaner if we broke up the list of dependencies into variables,
# but these get hard to define with the evaluation approach used to define make
# functions.
generate_$(2)_arduino_project: $(addprefix $(PRJDIR)$(2)/arduino/src/,\
$(patsubst tensorflow/lite/experimental/micro/tools/make/downloads/%,third_party/%,$(patsubst %.cc,%.cpp,$(3))) \
$(patsubst tensorflow/lite/experimental/micro/tools/make/downloads/,third_party/,$(4))) \
$(addprefix $(PRJDIR)$(2)/arduino/,$(1)) \
$(PRJDIR)$(2)/arduino/examples/$(2)/$(2).ino \
$(PRJDIR)$(2)/arduino/src/TensorFlowLite.h

generate_$(2)_arduino_library_zip: generate_$(2)_arduino_project
cd $(PRJDIR)$(2) && cp -r arduino $(2) && zip -r $(2).zip $(2)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name=TensorFlowLite
name=TensorFlowLite:%{EXECUTABLE}%
version=1.13
author=TensorFlow Authors
maintainer=Pete Warden <[email protected]>
Expand Down

0 comments on commit 82e1cbd

Please sign in to comment.