-
Notifications
You must be signed in to change notification settings - Fork 24
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
Idea: Use order-only prerequisites for $(OBJPATH) #8
Comments
I like that! I'm going to "pull" that from you. With minor changes: I'm going to keep the clean target intact. This target is meant to clean all "objects" only. In case of using separate build directories for different build modes your rule will only delete one such subdirectory (e.g. obj/debug while keeping obj/release and obj/profile). Deletion of separate objdirs is meant as a job for dist_clean target. Thank you! I never liked the .fake_file solution and I know that I've read about order-only prerequisites but it seems that when I read about that my .fake_file dislike was buried somewhere else in my brain and it never clicked with "aha" moment. Best regards |
Uploaded now f3f07d8. Regards |
Hi Andrzej, Personally, I like the proposal. =P Realized seeing it that I forgot to go back to update ?R and ^R in mine. It took me a bit to understand the .SECONDARY target for Any idea why in one method $(OBJPATH) is treated as intermediate, and in the other it's not? Thanks, |
James Initially I removed the .SECONDARY for OBJPATH but then I ran that on my examples and it turned out that make considers those directories as intermediate products (as you've mentioned) and then tries to remove them at the end giving a bunch of error messages. I have not yet understood why they are considered intermediate targets, so for now I'm going to keep it like it is. Regards |
I made a change in nonrec-make to match what we'd done in another project that specifies different directories for build output, following the GNU Make manual: http://www.gnu.org/software/make/manual/make.html#Prerequisite-Types
All references to
$(OBJPATH)/.fake_file
were changed to just$(OBJPATH)
, and the rule to create the directory was changed to a simplemkdir -p
:Dependencies were changed to order-only:
...and in skel.mk's tgt_rule:
In footer.mk, the clean target removes
$(OBJPATH)
:The text was updated successfully, but these errors were encountered: