Alexandre Oliva wrote:
> On May 29, 2000, Marek Kowal <[EMAIL PROTECTED]> wrote:
>
> > I have an .x file and want to create, using rpcgen, stub files in
> > automake. Later on I want to compile and link part of them into server,
> > and the other part into client. Did anybody excercised this already?
>
> Add .x to SUFFIXES, the write rules to generate the .c files from .x.
> Since you want to generate at least 2 files from the same .x, you
> won't be able to use implicit rules (such as `.c.x:').
rpcgen usually has the command-line options for generating single individual
files -- rpcgen -[cmlh] <xdrfile.x>, but it generates them to stdout. I
usually use:
%_rpc.h: %_rpc.x
$(RPCGEN) -h $< > $@
%_rpc_xdr.c: %_rpc.x
$(RPCGEN) -c $< > $@
%_rpc_svc.c: %_rpc.x
$(RPCGEN) -m $< > $@
%_rpc_clnt.c: %_rpc.x
$(RPCGEN) -l $< | awk -f $(LIB)/rpcclnt.awk > $@
By convention, my XDR file or "interface" file is <something>_rpc.x.
(rpcclnt.awk is a filter to typecast the RPC calls, removing the compiler
warnings)
Allan