[Toybox] Moving generated/ is hard.

Rob Landley rob at landley.net
Wed Oct 5 05:02:33 PDT 2016


There was a suggestion that the generated/ directory should be movable,
set by a variable. I've poked at making this work, and there's a couple
problems.

1) configure stores default values for environment variables in shell
script format, not in makefile format. The makefile has a lot of
instances of generated/ that have to be replaced by a makefile variable,
so it more or less has to be defined in two places.

2) we #include generated/blah so we'd need a -D #define passed into the
gcc command line arguments.

3) Config.in sources generated/Config.in, and I have no idea how to
substitute that with a variable.

It's really #3 that's hard to fix, the others are messy but that one's
REALLY messy. (Have the build run it through sed to create a temporary
copy?)

I reopened this can of worms because "make ps; make toybox" is producing
a toybox binary that acts like ps because the dependencies are funky,
specifically generated/config.h was built from .singleconfig and it's
newer than .config so doesn't get rebuilt. A quick hack would be "touch
-c .config" at the end of scripts/single.sh but if you ctrl-c out of the
single build you're still in the broken state with the wrong set of
headers and the dependencies not knowing to rebuild them.

(Sigh, put the config file name into the .h file and have the builder
check for it? Grumble grumble...)

Rob


More information about the Toybox mailing list