This list was previously maintained as issue #242, until we realized that this needs proper version-control. (Duh!)
commit.h
must change whenever it disagrees with the current git commitcommit.h
must not change whenever it agrees with the current git commit- Must call
cd tgl && ./configure
with appropriate options whenevertgl/Makefile
is missing, or notices that./configure
was run. ("Too often" is acceptable as long asmake && make
isn't violated.) - Must call
make -C tgl
whenever this might have any effect. ("Too often" is acceptable as long asmake && make
isn't violated.) - Any changes due to
make -C tgl
must cause all necessary rebuilds in telegram-purple during the same invocation of make. ("Too often" is acceptable as long asmake && make
isn't violated.) - If
tgl/Makefile.in
is missing, explain that we need submodules, and stop. make -j12
must work fine- Must support out-of-CVS builds.
- Must not
-include tgl/Makefile
as it doesn't really support that, and I'm not going to try and convince @vysheng to do that. Also, it's too fragile. You know how he ticks. make && make
must not create any files in the second run (otherwise,sudo make install
would become hairy)- Compatibility with other makes
commit.h
is a regular file which depends on a .PHONY targetcommit
. Buildingcommit.h
only touchescommit.h
if necessary and possible. (=> 1, 2, half of 8)- Have a target
tgl/Makefile
which depends onMakefile
. (=> 3) - The central target
${PRPL_LIBNAME}
shall depend on the .PHONYsubmade
, which depends ontgl/Makefile
, and essentially executesmake -C tgl
. (=> 4, time constraint of 5) - All objects of telegram-purple depend on
tgl/libs/libtgl.a
. Rationale: iftgl/libs/libtgl.a
stays the same, then nothing in tgl changed. Iftgl/libs/libtgl.a
changes, then due to lots of black preprocessor magic within tgl, it can't be safely determined which, if any, objects of telegram-purple can be re-used. Also, if tgl got recompiled (~ 1 minute), then tgp can be recompiled, too (~ 5 seconds). (=> dependency constraint of 5) - Let
tgl/Makefile
depend ontgl/Makefile.in
, and put the warning into the rule for the latter. (=> 6) - The above already implies a dependency DAG that is completely known to make; except at one point: let
tgl/libs/libtgl.a
depend onsubmade
, without any own code. Now make ensure thread-safety on it's own. (=> 7) - Bundle commit.h into the origtar (=> other half of 8)
- Should be ultimately robust. Then again, that's what I thought about the last few attempts, and they didn't last long.
- This reduces the number of .PHONYs drastically, making it easier to read, and making it easier to prove that
make && make
doesn't change anything. - Even though
submade
should trigger once and only once, this can handle multiple invocations just fine, too. - All files dependent on
commit.h
need to be mentioned explicitly as dependents in the Makefile. This is ugly, but (as far as I can see) unavoidable. Thankfully, any errors here will get detected by automated testing. - We currently use only one GNU make specific extension. See majn#137 (comment)