Skip to content

Commit

Permalink
Merge pull request #20841 from maribu/tests/pkg/emlearn
Browse files Browse the repository at this point in the history
tests/pkg/emlearn: add model.h to repo
  • Loading branch information
maribu authored Sep 29, 2024
2 parents 9bdb697 + 2c89b7a commit 3c5c78a
Show file tree
Hide file tree
Showing 3 changed files with 7,814 additions and 3 deletions.
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

0 comments on commit 3c5c78a

Please sign in to comment.