I'm trying to pass a variable from my bitbake (.bb) recipe to a Makefile that I have it calling.
In my recipe I have:
export FOO="bar"
When it runs the do_compile()
method I have it calling a Makefile I generated. In the Makefile I tested the variable was set correctly via:
ifeq ($(FOO), "bar")
echo $(FOO) >> ./test.txt
else
echo "Didn't work" >> ./test.txt
endif
When I bake the recipe I just see "Didn't work" in the log. I thought this was very strange because if I had FOO="bar"
in my Makefile and just ran make
, then I would see "bar" printed in the test file. So why didn't it "pass" correctly?
I ran one more test to verify, in my Makefile I only put this line:
echo $(FOO) >> ./always_print.txt
And then after baking the recipe I see bar
printed in my "always_print.txt" file yet I see "Didn't work" printed in test.txt...
Does anyone have a clue what I'm doing wrong here?
Before defining your do_compile method, you have to define the variable EXTRA_OEMAKE which this content:
EXTRA_OEMAKE = "FOO=bar"
After that, in your do_compile method you must call 'oe_runmake'. That call invokes the command 'make', and all contents defined in EXTRA_OEMAKE variable are passed as argument to the 'make' command. Hope this helps!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With