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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃И [makefile] pass CC_OPTS variable as define string #813

Merged
merged 2 commits into from
Feb 19, 2024
Merged

Conversation

stnolting
Copy link
Owner

@stnolting stnolting commented Feb 18, 2024

Pass the makefile's CC_OPTS variable, which contains all relevant GCC flags and switches, as "define" string to the application:

# Actual flags passed to the compiler
CC_FLAGS = $(CC_OPTS)

# Export compiler flags as define string
CC_FLAGS += -DCC_OPTS="\"$(CC_OPTS)\""

Application software can use this "define" to print the actual GCC configuration that was used to compile the code:

neorv32_uart0_printf("%s\n", CC_OPTS);

@stnolting stnolting added SW software-related experimental Experimental feature labels Feb 18, 2024
@stnolting stnolting self-assigned this Feb 18, 2024
@stnolting stnolting marked this pull request as ready for review February 18, 2024 18:34
@stnolting stnolting merged commit f306f6f into main Feb 19, 2024
8 checks passed
@stnolting stnolting deleted the pass_cc_opts branch February 19, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
experimental Experimental feature SW software-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant