Client/Server-mode for makepp
Makepp takes quite a bit of time to start up, read all the makefiles and check what to build. When developing you will do this frequently, but most often nothing or very little has changed in the makefiles and the dependencies. So, if makepp were still running, it could remember what it found out and start compiling almost right away. Inspired by ant server, that is what this attempts to do.
The normal makepp will be running as a server (just slightly differently than usually). It will be waiting for commands issued by a small Shell script, makeppclient. Any output that comes from performing the commands will be forwarded to makeppclient, as will the return code. Thus, it will seem as though the client is performing the build.
Before you can use it, you must start makepp as a server. Every user starts his personal server for his build directory.
makeppclient server-start-option [makepp-options] [VAR=value] [targets]
There are three modes for doing this, each controlled by a different option:
In each case you can give any of the -options or VAR-assignments you would give to makepp. These will stay in effect for all builds you subsequently perform with this server. The server will keep the current directory of the time you started it. This is important if you didn't give the -F option.
Specifiying targets is only a hint, they will not get built because of this. This can help the server to preload the most often used makefiles.
You can repeatedly tell the server to perform builds. This is equivalent to calling makepp every time, but you save the startup time. The command is:
makeppclient [client-option] [makepp-options] [targets]
There is one client-option possible:
The following makepp-options are possible and are passed to the server. Unlike those passed at server startup time, these are effective only for one invocation:
Not specifying a target is equivalent to building the default target as with makepp.
A server started with the --start-server option should simply terminate when you interrupt it, log out or close the terminal window you started it from. Otherwise you can explicitly tell the server to exit with:
There are some environment variables which influence the way in which this works:
niceor append some options you will always want to pass it.
tee, a filter like
grep -vor even a pipeline of these.
Already loaded makefiles will not be reloaded if they or their includes have changed, or again need to be regenerated. This should not normally be a problem, as makefiles should rarely change, because makepp offers powerful pattern rules and inference techniques.
Makefiles will also not be reloaded, even if they depend on
$(MAKECMDGOALS). This may lead to wrong builds! If you depend on this,
you must either always use the same targets, including at server start, or not
use client/server mode...
A server started with the --batch-server option may not have started by the
time you issue client commands. In that case you will get a ``makeppclient:
server is not running.'' error message. This is not a bug -- just try again
later, as long as
at -l still list your batch job.