This one hurts
By joe
- 2 minutes read - 224 wordsWorking on simplifying and refactoring some Makefiles for DragonFly. Yeah, will mention what it is eventually. In the makefile, I build a bunch of perl modules. The previous version of this system had a pre-pulled set of CPAN modules, and all the bits had file system names like DBIx-SimplePerl-1.8.tar.gz Which is nice and easy to deal with. In order to make sure we can use this for updating as well, I thought it would be nice to exploit CPAN and the module name without the version. This lets us seamlessly pull down the modules from a CPAN mirror. To bad it doesn’t work.
As I have discovered, the reason it doesn’t work is the implementation of “make”. The CPAN parts work great. Really well. The makefile, as long as your targets do not have double colons in them ("::") work really well. For reasons known only to the builders of Make, they have decided that only their internal rules can have “::” in them. Targets cannot. So …
<code>
DBIx-SimplePerl: DBIx::SimplePerl
$(PERL) ...
</code>
will not work, but
<code>
DBIx-SimplePerl: DBIx-SimplePerl-1.8
$(PERL) ...
</code>
will. Grrrrrrrr. Now I am going to have to write logic, outside of Make, just to deal with implementation deficiencies of Make. Without beating up on the makers of GNU Make, I have to say I am disappointed in this.