Is there an include statement in buildroot ?
Hello everyone
My package .mk file is getting quite large now and I would like to break it to more easily
sizeable and logical chunks.
Is there a way to include other .mk files in main .mk file ?
Like something like this:
package/newpackage/A.mkpackage/newpackage/C.mkpackage/newpackage/D.mk
etc....package/newpackage/newpackage.mk
And newpackage.mk would have:
include "A.mk"
include "B.mk"
include "C.mk"
etc....
Stefan
Hi Stefan,
2012/9/3 Stefan Fr?berg <[email protected]>:
Quoted 7 lines
Hello everyone
My package .mk file is getting quite large now and I would like to break it to more easily
sizeable and logical chunks.Is there a way to include other .mk files in main .mk file ?
Actually, you don't need to explicitly include .mk files, this is automatically handled in the Makefile at the root of BR. To convince yourself ;-) :
grep -nE 'include .*?mk' Makefile
Quoted 8 lines
Like something like this:
package/newpackage/A.mkpackage/newpackage/C.mkpackage/newpackage/D.mk
etc....package/newpackage/newpackage.mk
However, if you there is a specific order for the inclusion, you can do:
package/newpackage/A.mk.in
package/newpackage/B.mk.in
...
Quoted 9 lines
And newpackage.mk would have:
include "A.mk"
include "B.mk"
include "C.mk"etc....
Then, in the newpackage.mk:
include A.mk.in
include B.mk.in
...
Or just:
include ./*.mk.in
Cheers,
Signature · 1 line
Sam
Hi Samuel
4.9.2012 0:50, Samuel Martin kirjoitti:
Quoted 40 lines
Hi Stefan,
2012/9/3 Stefan Fr?berg <[email protected]>:
Quoted 7 lines
Hello everyone
My package .mk file is getting quite large now and I would like to break it to more easily
sizeable and logical chunks.Is there a way to include other .mk files in main .mk file ?
Actually, you don't need to explicitly include .mk files, this is automatically handled in the
Makefileat the root of BR. To convince yourself ;-) :
grep -nE 'include .*?mk'MakefileQuoted 7 lines
Like something like this:
package/newpackage/A.mkpackage/newpackage/C.mkpackage/newpackage/D.mk
etc....package/newpackage/newpackage.mkHowever, if you there is a specific order for the inclusion, you can do:
package/newpackage/A.mk.in
package/newpackage/B.mk.in
...Quoted 8 lines
And newpackage.mk would have:
include "A.mk"
include "B.mk"
include "C.mk"etc....
Then, in the newpackage.mk:
include A.mk.in
include B.mk.in
...
Quoted 6 lines
Or just:
include ./*.mk.inCheers,
I put the following in newpackage.mk :
include package/newpackage/A.mk.in
include package/newpackage/B.mk.in
etc...
And Oh My God, it worked!
All the variables and other stuff from those files were now visible in main newpackage.mk!
Thanks Samuel ! :)
Stefan