While writing a makefile for a program of my own, it's occurred to me
that I've always seen makefiles with just "phony" install targets
(even make's original manual from Bell Labs does it that way).
But I think I've never seen the actual destination files used as targets.
So I've tried to do that in my makefile:
-----
$(bindir)/prog: prog
install -D prog $@
$(mandir)/prog.1.gz: prog.1.gz
install -D prog.1.gz $@
install: $(bindir)/prog $(mandir)/prog.1.gz
-----
Aside from looking like a more truthful representation of what really happens, this has the advantage that make will say 'nothing to be done
for install' if you try to install files that are older or equal to what
you have already installed.
But are there any disadvantages I'm not considering?
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 339 |
Nodes: | 16 (2 / 14) |
Uptime: | 00:22:43 |
Calls: | 7,466 |
Calls today: | 2 |
Files: | 12,691 |
Messages: | 5,627,864 |