-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Remove internal phony target #3720
Conversation
GNU Makefile's manual says: > A phony target should not be a prerequisite of a real target file
The problem is that macros can change the resulting executable. This is specially true with the compiler, where the date changes each time you compile. I think this was the reason we wanted to have phony targets. I actually don't know what "phony target" means, but in short when we do |
No, I don't think it. Because this behavior comes from $(O)/crystal: deps $(SOURCES) and Building the compiler is heavy process, and also building the spec is more heavy now. I want to skip it if possible, and Makefile has the ability to do it. When we want to re-build with no file change, we can use traditional |
To be honest, I don't know much about Makefiles... 😊 So if others that do know about it (for example @waj, @jhass and @ysbaddaden) think this change is fine, than 👍 from me too. |
@asterite Can I just say that I really respect your humility. 👌 Its actually a somewhat inspiring, thank you! |
@asterite please... |
Unfortunately I don't have experience with Makefiles so someone else should take care of this. Sorry 😊 |
Hello, I've a bit of experience with Makefiles and can confirm @makenowjust statements. A phony dependency is good for tasks that produce no artifacts, but using that task as dependency of another that does produce them results in constant re-execution of it. Even if the compiler can perform some incremental checks, the main semantics steps consumes a lot of time when processing the compiler. Moving With this change, the compiler or the spec files will only be re-compiled when there is actually a change in the code, either the source files or the LLVM extension object or the produced lib file. Cheers. |
@asterite @luislavena Thanks!! |
Great! Thank you @makenowjust
😄 |
Now I can't use the compiler anymore :-( $ make clean
Using /usr/local/bin/llvm-config [version=3.9.1]
rm -rf .build
rm -rf ./doc
rm -rf src/llvm/ext/llvm_ext.o
rm -rf src/ext/sigfault.o src/ext/libcrystal.a
$ make deps
Using /usr/local/bin/llvm-config [version=3.9.1]
make: *** No rule to make target `deps'. Stop.
$ bin/crystal spec spec/std/int_spec.cr
clang: error: no such file or directory: '/Users/asterite-manas/Projects/crystal/src/ext/libcrystal.a'
Error: execution of command failed with code: 1: `cc -o "/Users/asterite-manas/.cache/crystal/crystal-run-spec.tmp" "${@}" -rdynamic -lgmp -lxml2 -lpcre -lgc -lpthread /Users/asterite-manas/Projects/crystal/src/ext/libcrystal.a -levent -liconv -ldl -L/usr/lib -L/usr/local/lib` Maybe something is missing in the Makefile for the |
Hmm... why was My workflow is, for example: make clean deps
bin/crystal spec spec/std/int_spec.cr I don't always go through Makefile to do everything. Most of the time I test individual files, not the whole compiler... Do you think it would be hard to get the |
Hmm... I think I'll just revert this. I still can't understand the point of why would one run |
@asterite Please wait 5 mins! I fix |
@makenowjust No problem at all, take your time :-) |
@asterite definitely wasn't aware that |
GNU Makefile's manual says:
For instance it causes some problem:
This pull request fixes it also.