-
Notifications
You must be signed in to change notification settings - Fork 1
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
RIOT: auto execute LFC on build #166
Conversation
Benchmark results after merging this PR: Benchmark resultsPerformance:PingPongUc: PingPongC: ReactionLatencyUc: ReactionLatencyC: Memory usage:PingPongUc: PingPongC: ReactionLatencyUc: ReactionLatencyC: |
Memory usage after merging this PR will be: Memory Reportaction_empty_test_c
action_microstep_test_c
action_overwrite_test_c
action_test_c
deadline_test_c
delayed_conn_test_c
event_payload_pool_test_c
event_queue_test_c
nanopb_test_c
port_test_c
reaction_queue_test_c
request_shutdown_test_c
startup_test_c
tcp_channel_test_c
timer_test_c
|
@erlingrj Ready for review again :) |
# Build lf example | ||
pushd hello_lf | ||
run/build.sh | ||
popd |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Integrating the LFC into the make file is really nice! Now we don't need to handle _LF examples different from c-code based examples anymore!
e12ba6a
to
a9bfafd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good. Just a few minor comments. I will let you merge it when you've seen them
LF_SRC_GEN_PATH = $(CURDIR)/src-gen/$(LF_MAIN) | ||
# Execute the LF compiler if build target is "all" | ||
ifeq ($(MAKECMDGOALS),all) | ||
_ := $(shell $(REACTOR_UC_PATH)/lfc/bin/lfc-dev src/$(LF_MAIN).lf) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just for my own understanding, what does this syntax here achieve? Will the command be invoked before any target is run?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a small hack, it copies the output of the shell script over to the variable in this case underscore. This way the evaluation of the makefile is blocked until the script is finished ;)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's very clever!
APPLICATION ?= $(LF_MAIN) | ||
|
||
# Path of generated lf c-code | ||
LF_SRC_GEN_PATH ?= $(CURDIR)/src-gen/$(LF_MAIN) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An unfortunate detail about lfc is that where the generated-code is put is a little complicated:
~/src/Hello.lf
->~/src-gen/Hello
~/Hello.lf
->~/src-gen/Hello
~/src/lib/Hello.lf
-> `~/src-gen/lib/Hello
I think we should ignore (2) where it is not in a src
directory, for our template we say that the LF files must reside under a src
directory. But for (3) to work, LF_MAIN must be set to lib/Hello
, which might actually be reasonable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aaahh that is good to know, I will think about a good solution
This adds the lfc command to
riot.mk
and also moves more configuration over from the lingo template.For more info see: lf-lang/lf-riot-uc-template#1