Closed nthallen closed 1 year ago
I think there is an easier way, implemented in SCoPEx commit f61ac872e7. I think the key is to make the executable in the subdirectory a .PHONY target in the main directory with the explicit make rule. That way, when it is required, make will always be run in the subdirectory.
To distribute a driver from a module subdirectory, I have tried to add it to DISTRIB or TGT. This usually fails by causing make in the main TM directory to try to guess how to build the executable without reading the subdirectory's Makefile.
I think the proper approach is to define two additional variables:
Then
all-dist
can depend on$(XDIR)
and not$(XTGT)
.extdistribution
will copy$(XTGT)
along with$(DSTRB)
.And we will handle XDIR with:
One shortcoming here is that if make does not build the
$(XTGT)
, we won't detect it until we try to copy it mid-distribution. Traditionally, the dependencies have been setup so we don't start to copy unless all the files are ready to go, which prevents a partial installation. That of course should only happen if the$(XDIR)
make does not even try, and since we are talking about modules, they should meet that basic standard.