List all dependencies in Makefiles

make all-depends-list lists all build dependencies, run dependencies, lib dependencies, etc, and the dependencies of dependencies.

However, it does not include another type of dependency shown below.

Take the Makefile of dns/bind-tools as an example:

Code:
# $FreeBSD: head/dns/bind-tools/Makefile 397807 2015-09-25 10:05:48Z mat $

# Define PORTREVISION in ${MASTERDIR}
MASTERDIR=      ${.CURDIR}/../../dns/bind910
...
...

dns/bind910 is required to build dns/bind-tools.

How do I list or find out this type of dependency?

Thanks!
 
Take the Makefile of databases/postgresql94-server as another example:

Code:
# Created by: Marc G. Fournier <scrappy@FreeBSD.org>
# $FreeBSD: head/databases/postgresql94-server/Makefile 392696 2015-07-22 21:46:
27Z bapt $

DISTVERSION?= 9.4.4
...
...
.include "${.CURDIR}/../postgresql92-server/Makefile"

Both make -V DISTFILES and make fetch-urlall-list don't generate a list with databases/postgresql92-server. Neither does make all-depends-list.

What could I do about this?
 
What could I do about this?
Nothing (edit: besides grepping for those .include lines of course). Why would it include databases/postgresql92-server?

If you think about ports as classes (as in Java or any other OOP language) databases/postgresql94-server is a subclass of databases/postgresql92-server with some methods/variables overridden to build another version of PostgreSQL because the basic recipe and options to build both of them are the same.

In other words the ports have a is-a relationship with one another. The dependent ports of a port that you get with make all-depends-list form a has-a relationship with that port instead i.e they are used as part of the recipe and do not make the recipe.
 
Only idea I have is greping for the .include and MASTERDIR lines: grep -Er '\.include \"\$\{.CURDIR}/../(.*)/Makefile\"' /usr/ports and grep -Er 'MASTERDIR=.*\$\{.CURDIR\}/\.\./' /usr/ports
 
Are the following steps what I should do?

1. Download the source of the port (target)
2. Run make all-depends-list and download the source of the dependencies
3. Repeat step 2 until it resolves all dependencies
4. Run grep -Er '\.include \"\$\{.CURDIR}/../(.*)/Makefile\"' /usr/ports and grep -Er 'MASTERDIR=.*\$\{.CURDIR\}/\.\./' /usr/ports and download the source of the ports
5. Repeat step 4 until it resolves everything
6. Build the target port
 
Are the following steps what I should do?
What are you trying to do?

If all you want to do is build the target port you just run make in the port's directory. If you want download all sources beforehand you run make fetch-recusive.
 
It's not recommended to get only small parts of the ports tree. It is really meant to be fetched completely and updated completely to avoid situation where you have parts of the ports tree out of sync with the master copy at the SVN or portsnap(8) servers.
 
It seems that make fetch-recursive will not download the ports with Makefiles required for building the target port (see my examples above).

Should I always get the full ports tree even if I just need about 200 ports only?
 
It seems that make fetch-recursive will not download the ports with Makefiles required for building the target port (see my examples above).

Should I always get the full ports tree even if I just need about 200 ports only?

YES! Period. Full-stop.

The ports tree is designed to work as an integrated whole. Either install the whole thing, or don't install any of it. To do anything other than that will lead to all kinds of issues, and you'll spend longer trying to work around them than it would take to download the entire thing.
 
Back
Top