Page MenuHomeFreeBSD

Mk: Support multiple directories in {BUILD,CONFIGURE,INSTALL,TEST}_WRKSRC

Authored by rakuco on Dec 25 2016, 5:03 PM.


Group Reviewers

Make the do-build, do-configure, do-install and do-test targets in iterate through all values in their respective WRKSRC variables, and adjust most .mk files in Mk and Mk/Uses accordingly. A few have been left out (e.g., Uses/, because it is not clear if it makes sense for them to support multiple directories at all.

This change allows us to remove or reduce the size of several post-* targets in ports which only needed to build and/or install additional directories, as can be seen from the non-Mk bits of this CL.

The only limitation so far is that ALL_TARGET and INSTALL_TARGET are passed to all BUILD_WRKSRC and INSTALL_WRKSRC directories respectively, as I could not think of a syntax that made sense that associated directories and target names. This means some post-build targets were not modified, as they do things such as make docs which need a different target name than all or whatever ALL_TARGET is set to.

Test Plan
  • Get review from portmgr and others.
  • Ask for an exp-run (I've tested the ports changed in this diff, but I need to check all ports for possible regressions).

Diff Detail

rP FreeBSD ports repository
Lint Skipped
Unit Tests Skipped

Event Timeline

rakuco updated this revision to Diff 23254.Dec 25 2016, 5:03 PM
rakuco retitled this revision from to Mk: Support multiple directories in {BUILD,CONFIGURE,INSTALL,TEST}_WRKSRC.
rakuco updated this object.
rakuco edited the test plan for this revision. (Show Details)
rakuco added reviewers: tijl, kde, adridg, portmgr.
rakuco set the repository for this revision to rP FreeBSD ports repository.
adridg edited edge metadata.Dec 27 2016, 2:46 PM

I don't feel qualified to comment on the general purpose of this patch, nor on its effect on ports in general.

The port is a little strange, since you're now adding contortions to the build process there to get it to fit the multiple-WRKSRC model. That's one I might suggest leaving alone.

The indentation of dot-directives for Make (e.g. .for) is inconsistent between and the rest (but maybe it's already inconsistent and you're staying consistent within the file).

tcberner accepted this revision.Dec 31 2016, 6:03 PM
tcberner edited edge metadata.

Looks reasonable.

mat added a comment.Jan 2 2017, 1:59 PM

This is interesting, I wonder what will break.

This is interesting, I wonder what will break.

I've finally filed an exp-run request:

From the exp-run PR:

Antoine Brodin 2017-01-17 07:08:14 UTC
Exp-run fails to start (lots of make errors, probably from

Does it make any sense to pursue this further?

tcberner resigned from this revision.May 30 2018, 6:01 AM

I think this can be closed ^^

rakuco abandoned this revision.Jun 17 2018, 2:34 PM

Yeah. It's something good to have, but I don't have time to pursue this one.