automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to build src/server and src/client separately?


From: Marc Alff
Subject: Re: How to build src/server and src/client separately?
Date: Thu, 15 Jun 2006 17:30:58 -0700
User-agent: Thunderbird 1.5.0.4 (X11/20060608)

Hi Andreas


Andreas Ntaflos wrote:
> Hello list, 
>
> I think this shouldn't be too difficult, but I couldn't find it in the 
> automake manual (possibly because I don't know exactly what to look 
> for).
>
> My project consists of $(topdir)/src/server and $(topdir)/src/client. 
> Issuing `./configure && make' in $(topdir) correctly builds server and 
> client, two otherwise unrelated programs. 
>
> I would like to be able to issue `make' to build both (current 
> behaviour) as well as `make server' and `make client' to build them 
> separately if I want to do so.
>
> I'd appreciate it if anyone could point me to the right section in TFM 
> or give me clues how to configure my project for the desired behaviour.
>
> Thanks in advance!
>
> Andreas
>   

A suggestion is to add convenience targets in your Makefile.am :

client :
  $(MAKE) -C src/client all

server :
  $(MAKE) -C src/server all

both : client server
(not really needed, since make all will do that anyway)

If the client and server *really* have a separate code base,
you can also have two projects instead of one,
so that distributing a tarball with fixes on only one side
can be done independently of the other, but see below.

A reason to have client and server code in the same
project is when a common library is used by both,
for example to implement the protocol between the two
(common header file + code or an XML schema for the messages or
*something*),
so that this code is not duplicated.
In that case, the client and server code base are not so independent,
they both depends on the common protocol, so likely there are 3 major
subdirectories in the code base (client, server, protocol).

client : protocol
  $(MAKE) -C src/client all

server : protocol
  $(MAKE) -C src/server all

protocol :
  $(MAKE) -C src/protocol all

Hope this helps,
Marc Alff.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]