Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests/pkg/emlearn: add model.h to repo #20841

Merged
merged 1 commit into from
Sep 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tests/pkg/emlearn: add model.h to repo
The Makefile rule to regenerate model.h has been left in place, but
just adding the header to the test allows to build the application
without heaving emlearn installed, which is convenient for the CI.

Actual users of emlearn will like still want to generate the header.
  • Loading branch information
maribu committed Sep 28, 2024
commit 2c89b7acd3b4938f8664b2bdf8664a652cfa1636
4 changes: 3 additions & 1 deletion tests/pkg/emlearn/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
model.h
tmp/
/model_head.h
/model_tail.h
/tmp.h
19 changes: 17 additions & 2 deletions tests/pkg/emlearn/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,21 @@ BUILDDEPS += model.h

include $(RIOTBASE)/Makefile.include

model.h: $(CURDIR)/model
model_head.h:
$(Q)echo "#ifndef MODEL_H" > model_head.h
$(Q)echo "#define MODEL_H" >> model_head.h
$(Q)echo "#ifdef __cplusplus" >> model_head.h
$(Q)echo "extern \"C\" {" >> model_head.h
$(Q)echo "#endif" >> model_head.h

model_tail.h:
$(Q)echo "#ifdef __cplusplus" > model_tail.h
$(Q)echo "}" >> model_tail.h
$(Q)echo "#endif" >> model_tail.h
$(Q)echo "#endif /* MODEL_H */" >> model_tail.h

model.h: $(CURDIR)/model model_head.h model_tail.h
$(Q)$(CURDIR)/generate_model.py
$(Q)echo "/* fix for no newline at eof */" >> model.h
$(Q)sed -i model.h -e 's/[\t ]*$$//g'
$(Q)cat model_head.h model.h model_tail.h > tmp.h
$(Q)mv tmp.h model.h
Loading
Loading