-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add --version
flag
#61
Conversation
Info is printed when `--version` is passed
Closes #45 |
$(BUILD_DIR)/arm64-apple-macos11/$(VERSION_INFO).o: $(VERSION_INFO).c $(O_FILES) $(BUILD_DIR)/arm64-apple-macos11/$(LIBC_IMPL).o | ||
$(CC) -c $(CSTD) $(OPTFLAGS) $(CFLAGS) -D$(IDO_VERSION) $(WARNINGS) -target arm64-apple-macos11 -o $@ $< | ||
|
||
$(BUILD_DIR)/x86_64-apple-macos10.14/$(VERSION_INFO).o: $(VERSION_INFO).c $(O_FILES) $(BUILD_DIR)/x86_64-apple-macos10.14/$(LIBC_IMPL).o | ||
$(CC) -c $(CSTD) $(OPTFLAGS) $(CFLAGS) -D$(IDO_VERSION) $(WARNINGS) -target x86_64-apple-macos10.14 -o $@ $< |
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.
These shouldn't need to depend on other .o files
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 think Elliptic's intention here was to force a rebuild for the version_info.o
files if any other file was touched, so the version is always up to date.
Do you have a better way to handle this?
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.
Oh, right! Makes sense, worth a comment maybe
@@ -292,8 +303,19 @@ $(BUILD_DIR)/$(LIBC_IMPL).o: $(LIBC_IMPL).c | |||
|
|||
$(BUILD_DIR)/$(LIBC_IMPL)_53.o: $(LIBC_IMPL).c | |||
$(CC) -c $(CSTD) $(OPTFLAGS) $(CFLAGS) -DIDO53 $(WARNINGS) -o $@ $< | |||
|
|||
$(BUILD_DIR)/$(VERSION_INFO).o: $(VERSION_INFO).c $(O_FILES) $(BUILD_DIR)/$(LIBC_IMPL).o $(BUILD_DIR)/$(LIBC_IMPL)_53.o |
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.
similarly
cp $^ $@ | ||
|
||
$(BUILD_BASE)/7.1/x86_64-apple-macos10.14/NCC: $(BUILD_BASE)/7.1/x86_64-apple-macos10.14/cc | ||
cp $^ $@ |
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.
what happened to these?
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.
version_info.o
depends on every other .o file to be built first, but we weren't creating NCC.c/NCC.o
files because this file is just a renamed cc
binary. Because of this make couldn't build the version_info.o
file, so how NCC is handled, instead of copying and renaming a cc
program, it copies the cc.c
program and builds that instead
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.
Oh, ok. Seems a bit wasteful to compile cc.c multiple times, maybe the .o can be copied instead. Or NCC can be filtered out from O_FILES.
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.
Adding an empty rule for NCC.o
still complains because the other rule already set the dependency of NCC.o
on NCC.c
I'll try to filter it out from O_FILES
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
Co-authored-by: Simon Lindholm <simon.lindholm10@gmail.com>
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.
1 Small nit
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
1 mall snit |
Adds a
--version
flag to every recomped program.Passing this flag to a program makes it print version information and exit immediately . Example: