diff --git a/documentation/content/en/books/porters-handbook/special/_index.adoc b/documentation/content/en/books/porters-handbook/special/_index.adoc --- a/documentation/content/en/books/porters-handbook/special/_index.adoc +++ b/documentation/content/en/books/porters-handbook/special/_index.adoc @@ -49,6 +49,39 @@ This section explains the most common things to consider when creating a port. +[[splitting-long-files]] +== Splitting long files + +Some times port's [.filename]#Makefiles# can be really long. +For instance, rust ports can have a very long `CARGO_CRATES` list. +In other cases, the [.filename]#Makefile# might have code that varies depending +on the architecture. +In cases like the described above, it is convenient to split the original +[.filename]#Makefile# into several files. +[.filename]#bsd.port.mk# automatically includes some types of +[.filename]#Makefiles# into the main port [.filename]#Makefile#. + +These are the files that the framework handles automatically in case they are +found: + +* [.filename]#Makefile.crates#. An example can be found in package:audio/ebur128[] +* [.filename]#Makefile.inc#. An example can be found in package:net/ntp[] +* [.filename]#Makefile.${ARCH}-${OPSYS}# +* [.filename]#Makefile.${OPSYS}#. An exapmle can be found in package:net/cvsup-static[] +* [.filename]#Makefile.${ARCH}# +* [.filename]#Makefile.local# + +It is also idiomatic to split the packaging list of the port in several files in +case the list varies a lot from one architecture to another or depends on the +selected flavor. +In this case, the [.filename]#pkg-plist# file for each architecture is named +following the pattern [.filename]#pkg-plist.${ARCH}# or +[.filename]#pkg-plist.${FLAVOR}#. +The framework does not create the packaging list automatically depending on +those files since the logic involved might be complex. +Examples on how to deal with this can be found in +package:audio/logitechmediaserver[] and package:deskutils/libportal[] + [[staging]] == Staging