-
Notifications
You must be signed in to change notification settings - Fork 93
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
Dual-license XML files BSD-2-Clause and CC-BY-4.0 #968
Conversation
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.
@rtwfroody LGTM.
@borneoa does this work for you? |
Few issues in the generated header for the C files:
The first point should be a legal requirement, while the other two are highly welcome but can still be managed through a manual editing of the files before integration in another project like OpenOCD |
BSD-2-Clause is used so the C code generated from those files can be used in GPLv2 open source projects (specifically, OpenOCD) and the CC-BY-4.0 clause is the standard license for work produced by the RISC-V Foundation.
Also multiple identifiers must be on the same line together.
Fixed.
Fixed.
I've left this as-is. /* */ works in every C compiler. // does not (although you might have to go back a way to find a compiler that doesn't accept //). |
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.
//
comments were standardized in regular C in 1999, but using old-school comments is fine and will make C89 people happy.
I was going to advise against using Python f-strings for a similar reason since that requires Python 3.6. However, I see that registers.py already uses f-strings extensively (which nobody seems to be complaining about) and 3.6 is now seven years old. So that's fine. And f-strings are so much nicer than the old clunky ways.
If I remember correctly, the SPDX spec was requiring to use a "single line comment" so the decision was to use The result is now good for me. There is one new issue with |
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.
build issue in this commit
@@ -70,14 +70,9 @@ build-registers: $(REGISTERS_ADOC) | |||
../registers.py --adoc $@ --adoc-definitions $(patsubst %.adoc,%-def.adoc,$@) $< | |||
|
|||
debug_defines: debug_defines.h debug_defines.c $(patsubst %,../xml/%,$(REGISTERS_ADOC:.adoc=.xml)) ../registers.py | |||
../registers.py $@ --cgetters $(filter %.xml, $^) | |||
|
|||
debug_defines.%: |
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.
By removing this make's target debug_defines.%
the build make debug_defines
fails on clean build, e.g. after a clean git clone
You need to drop debug_defines.h
and debug_defines.c
at line 74
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.
Good point. Fixed.
build/Makefile
Outdated
@@ -70,14 +70,9 @@ build-registers: $(REGISTERS_ADOC) | |||
../registers.py --adoc $@ --adoc-definitions $(patsubst %.adoc,%-def.adoc,$@) $< | |||
|
|||
debug_defines: debug_defines.h debug_defines.c $(patsubst %,../xml/%,$(REGISTERS_ADOC:.adoc=.xml)) ../registers.py |
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.
Need to remove the dependencies debug_defines.h
and debug_defines.c
because the files are not added anymore after line 75 has been removed
The rule makes those targets from scratch now.
I'm fine with it. Thanks |
BSD-2-Clause is used so the C code generated from those files can be used in GPLv2 open source projects (specifically, OpenOCD) and the CC-BY-4.0 clause is the standard license for work produced by the RISC-V Foundation.