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

fobos local variables #20

Closed
szaghi opened this issue Nov 20, 2014 · 7 comments
Closed

fobos local variables #20

szaghi opened this issue Nov 20, 2014 · 7 comments

Comments

@szaghi
Copy link
Owner

szaghi commented Nov 20, 2014

Add feature: allow definition of local variables inside fobos file that can be shared between different modes/options

@szaghi szaghi added the ready label Nov 20, 2014
@Tobychev
Copy link
Contributor

Tobychev commented Feb 3, 2015

Hello Stefano!
This feature does not seem to be documented, so I'm unsure of exactly what it means :(

@szaghi
Copy link
Owner Author

szaghi commented Feb 3, 2015

Hi Tomas,

happy to read you again.

You are right, this is not documented yet! Indeed, I have planned to refactor FoBiS and its documentation, but I have not yet found the time. However, the meaning of this feature (that is implemented!) is very simple: you can define variables and use them into different "modes" and or "options". For a practical example see this

https://github.com/szaghi/BeFoR64/blob/master/fobos

The [common-variables] is not actually a building mode rather a container that can be used for sharing options that are common into different modes. In the linked examples the options:

$CFLAGS_SHARED = -cpp -c -assume realloc_lhs -fpic
$CFLAGS_STATIC = -cpp -c -assume realloc_lhs
$LFLAGS_SHARED = -shared
$DEBUG         = -O0 -debug all -check all -warn all -traceback -std03
$OPTIMIZE      = -O2

are local variables that can be used elsewhere inside the fobos file. For example see the template-like modes of the same fobos file... oh yes the template is another new feature...

A variable can be used into the option definitions as you aspect, for example:

cflags    = $CFLAGS_SHARED $OPTIMIZE

The local (global?) variable are defined and used by the $ prefix.

Until I will have the time to refactor the code, I hope this can help you.

@Tobychev
Copy link
Contributor

Tobychev commented Feb 3, 2015

Thank you! I'm sure this will be useful for me :)

@szaghi
Copy link
Owner Author

szaghi commented Feb 4, 2015

@Myself: remember to document this feature!

@szaghi szaghi closed this as completed Feb 6, 2015
@szaghi szaghi removed the ready label Feb 6, 2015
@Tobychev
Copy link
Contributor

Hello Stefano,
today I realised I could use this feature! So now I'm here to remind you to document it in the wiki ;)

@szaghi
Copy link
Owner Author

szaghi commented Feb 10, 2015

:-) Good job!

I am doing it now...

@szaghi
Copy link
Owner Author

szaghi commented Feb 10, 2015

Dear Tomas,

these are for you:

I am sorry for my bad English... I hope they are clear enough.

Let me know how you will use them... :-)

See you soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants