diff options
| author | Matthijs Kooijman <matthijs@stdin.nl> | 2013-05-30 19:44:39 +0200 |
|---|---|---|
| committer | Matthijs Kooijman <matthijs@stdin.nl> | 2013-05-30 21:22:52 +0200 |
| commit | b96e03dde1a47e6f6a61808724fd3abf0eb28c39 (patch) | |
| tree | 76f710ffa042e94eb7a120b40faaf989962af803 /examples | |
| parent | 4fdd1765e6db9049b5048dad568954e4c6b6fa21 (diff) | |
Fix creating of $(OBJDIR) in a proper way
This adds a dependency on $(OBJDIR) for every rule that creates a file
inside $(OBJDIR) but does not already depend on any file within
$(OBJDIR). All other dependencies on $(OBJDIR) are removed.
These dependencies are added after a | to tell make that this is a
"order-only prerequisite". This means that the file inside $(OBJDIR)
needs $(OBJDIR) to be present but if $(OBJDIR) changes (which happens
whenever a file _inside_ the directory is touched!), there is no need to
recompile the file within $(OBJDIR).
Implementing this using a generic implicit rule like:
$(OBJDIR)/%: | $(OBJDIR)
doesn't work, since make doesn't merge the prerequisites of multiple
implicit rules like it does for explicit rules. We could use
$(LOCAL_OBJS) and friends to create explicit rules to do something like
the above, but just adding the dependencies on all rules seems more
explicit and future-proof.
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions
