Currently, if a port has USES_JAVA=yes, .include <bsd.port.pre.mk>, and overrides a make target (e.g. do-build:), then the following warnings are produced when invoking make on the port: make: "/usr/ports/c/p/Makefile" line XX: warning: duplicate script for target "do-build" ignored make: "/usr/ports/Mk/bsd.java.mk" line 400: warning: using previous script for "do-build" defined here See bug #224948 for corresponding fixed issue in Mk/Uses/go.mk.
I think it's more specific than this. From what I can see, you not only have to have USE_JAVA=yes, you also have to have USE_ANT=yes. In that case, if you define do-build that will cause problems. I guess you'd have to move things around in bsd.java.mk to fix this. In particular, you'd need to move the do-build section and associated .if into something which was only included after bsd.port.post.mk was. I tried something like the change to go.mk and it didn't work for me, so maybe there is more to move. Do you have a port that needs to build with ant for which the default do-build doesn't work?
(In reply to Greg Lewis from comment #1) Yes, I think you're right, it's really because of USE_ANT=yes. Check out the databases/cassandra4 Makefile for a future release: https://github.com/polo-language/cassandra4/blob/604340c7be44b7cc6686c7911fa1f506938c6f0e/Makefile The current release has the same problem, just 'less' of it: https://svnweb.freebsd.org/ports/head/databases/cassandra4/Makefile?revision=534966&view=markup I've started to wonder if I should drop USE_ANT and manage the tooling in the port script. But obviously a general fix would be even better.