Thursday, March 18, 2004

Ports makefile

I've talked before about makefiles and ports (see here), but I just found out about Yet Another Makefile used by the port system: /usr/ports/Mk/bsd.port.mk. This one lists an amazing number of options that can and will be used by building stuff in the ports folders. It is of especial interest to port maintainers, but has some options that can also be useful for us mere mortals.



One of the more interesting options are the BATCH and INTERACTIVE ones. They are only docuemented (in 4.9, anyway) indirectly, under the IS_INTERACTIVE comment in /usr/ports/Mk/bsd.port.mk, which I find more than a little odd for something so useful. If you set the BATCH environment variable (or, I assume, define it on the make command line thusly:


$ make -dBATCH

), it will not try to make any port that asks for interactive input. This is especially useful if you are doing a massive portupgrade and want to go away for a bit. Define BATCH in your environment (BATCH=1; export BATCH in bash) and it won't try to build interactive ones, like PHP, which has tripped me up a few times.



INTERACTIVE is the opposite of BATCH. Define this, and only ports marked as INTERACTIVE will build. So you can do the BATCH portupgrade first, then come back and do the INTERACTIVE ones while you are there coaxing it along.




No comments:

Post a Comment