-
Notifications
You must be signed in to change notification settings - Fork 2k
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
make: Place most configuration macros in a separate file instead of on the command line #5097
Conversation
Just wondering - instead of parsing the variable, can't you just call the preprocessor (gcc -nostdi c -E)? |
@kaspar030 that was a good idea, though it defines all builtins as well, not just command line:
|
With gcc I got it down to two extra defines:
|
"clang" is similar:
|
@kaspar030 I don't see the point when the result of using gcc gives additional cruft and when the current script works well enough and only uses |
@gebart Makes sense. I'll test as soon as I find time, unfortunately not today anymore. |
Awesome! That will probably also remove the need for |
0789a86
to
466d15f
Compare
0454366
to
a7c7994
Compare
I don't understand what Murdock is doing here, it seems like a race condition between clean and genconfigheader |
OK, managed to reproduce the error locally now |
71cf6ad
to
bea87fd
Compare
|
Yes, please squash! |
bea87fd
to
5ba5b30
Compare
rebased, squashed |
Yes, please squash! |
10daa46
to
cb5dfda
Compare
Squashed, waiting for Murdock |
cb5dfda
to
a2d9ffe
Compare
Murdock is green. @kaspar030 do you mind doing a review and ACK? |
@@ -50,6 +50,8 @@ include $(RIOTBASE)/Makefile.docker | |||
# Static code analysis tools provided by LLVM | |||
include $(RIOTBASE)/Makefile.scan-build | |||
|
|||
export RIOTBUILD_CONFIG_HEADER_C = $(BINDIR)/riotbuild/riotbuild.h |
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.
$(BINDIR)/riotbuild/riotbuild.h
^
I guess this slash can be removed
really nice 👍, the generated header gives a clean and handy overview of the set defines. |
ED += $(patsubst %,-DFEATURE_%,$(subst -,_,$(filter $(FEATURES_PROVIDED), $(FEATURES_REQUIRED)))) | ||
EXTDEFINES = $(shell echo $(sort $(ED))|tr 'a-z' 'A-Z') | ||
ED = $(addprefix FEATURE_,$(sort $(filter $(FEATURES_PROVIDED), $(FEATURES_REQUIRED)))) | ||
ED += $(addprefix MODULE_,$(sort $(USEMODULE) $(USEPKG))) |
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.
Is there a specific reason for switching these lines? I'm just curious.
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.
I don't remember, I think I just deleted them and rewrote them, and when I
did, I put them in alphabetical order.
Den 28 jun 2016 07:38 skrev "BytesGalore" notifications@github.com:
In Makefile.modules
#5097 (comment):@@ -6,9 +6,9 @@ USEMODULE :=
$(filter-out $ (filter-out$(FEATURES_PROVIDED), $ (FEATURES_OPTIONAL
INCLUDES += -I$(RIOTBASE)/core/include -I$(RIOTBASE)/drivers/include -I$(RIOTBASE)/sys/include
INCLUDES += -I$(RIOTCPU)/$(CPU)/include
INCLUDES += -I$(RIOTBOARD)/$(BOARD)/include
-ED =$(patsubst %,-DMODULE_%,$ (subst -,,$(USEMODULE) $(USEPKG)))
-ED += $(patsubst %,-DFEATURE%,$(subst -,,$(filter $(FEATURES_PROVIDED), $(FEATURES_REQUIRED))))
-EXTDEFINES = $(shell echo $(sort $(ED))|tr 'a-z' 'A-Z')
+ED = $(addprefix FEATURE,$(sort$(filter $ (FEATURES_PROVIDED), $(FEATURES_REQUIRED))))
+ED +=$(addprefix MODULE_,$ (sort$(USEMODULE) $ (USEPKG)))Is there a specific reason for switching these lines? I'm just curious.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/RIOT-OS/RIOT/pull/5097/files/a2d9ffeba8d582a741f4da3a7b3e1585606a94b8#r68699946,
or mute the thread
https://github.com/notifications/unsubscribe/AATYQmr0RMmiUgvmnymDHGi24ynq0Oh8ks5qQLNRgaJpZM4Hy4H3
.
The script works as intended, I tested it for |
a2d9ffe
to
8d31b62
Compare
@BytesGalore addressed comments |
Looks good and works as intended 👍. |
I added a check for |
…n the command line
553c34e
to
77a15e7
Compare
squashed |
Could you please test if the |
Changes to CFLAGS #defines are now picked up by the configuration header (genconfigheader) when building, so the FORCE target is no longer necessary when building different test suites.
@Kijewski I tried removing the |
ACK holds? |
yup ACK holds. |
& go! |
Fixes #5092
Additionally fixes the known issue that a change to USEMODULE in the Makefile requires a manual
make clean
to build correctly (I couldn't find a Github issue for this though). Whenever USEMODULE (or CFLAGS) is modified in the Makefile, then all object files will be rebuilt.The implementation checks the old file against the new file and only replaces the old file if the new file is different, this allows make to handle dependencies as usual by looking at the file timestamps.