summaryrefslogtreecommitdiffstats
path: root/usr.bin/rpcgen
diff options
context:
space:
mode:
authordfr <dfr@FreeBSD.org>2013-12-26 11:38:33 +0000
committerdfr <dfr@FreeBSD.org>2013-12-26 11:38:33 +0000
commit1bb9d2a8e040c7b63ca8de75cda909dd4fc967f2 (patch)
treecd0fb10abee7ed859ea2cb1572c8eb2cb29b03df /usr.bin/rpcgen
parentf6df8d57188889ef1a72008fb41db0248faf92eb (diff)
downloadFreeBSD-src-1bb9d2a8e040c7b63ca8de75cda909dd4fc967f2.zip
FreeBSD-src-1bb9d2a8e040c7b63ca8de75cda909dd4fc967f2.tar.gz
Generate client sample code which compiles without warnings.
For 'rpcgen -a', generate a makefile where 'make clean all' works.
Diffstat (limited to 'usr.bin/rpcgen')
-rw-r--r--usr.bin/rpcgen/rpc_main.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/rpcgen/rpc_main.c b/usr.bin/rpcgen/rpc_main.c
index 3755f4c..bf53a28 100644
--- a/usr.bin/rpcgen/rpc_main.c
+++ b/usr.bin/rpcgen/rpc_main.c
@@ -776,6 +776,8 @@ clnt_output(const char *infile, const char *define, int extend, const char *outf
free(include);
} else
f_print(fout, "#include <rpc/rpc.h>\n");
+ f_print(fout, "#include <stdio.h>\n");
+ f_print(fout, "#include <stdlib.h>\n");
tell = ftell(fout);
while ( (def = get_definition()) ) {
has_program += write_sample_clnt(def);
@@ -863,6 +865,10 @@ $(TARGETS_SVC.c:%%.c=%%.o) ");
f_print(fout, "all : $(CLIENT) $(SERVER)\n\n");
f_print(fout, "$(TARGETS) : $(SOURCES.x) \n");
f_print(fout, "\trpcgen $(RPCGENFLAGS) $(SOURCES.x)\n\n");
+ if (allfiles) {
+ f_print(fout, "\trpcgen -Sc $(RPCGENFLAGS) $(SOURCES.x) -o %s\n\n", clientname);
+ f_print(fout, "\trpcgen -Ss $(RPCGENFLAGS) $(SOURCES.x) -o %s\n\n", servername);
+ }
f_print(fout, "$(OBJECTS_CLNT) : $(SOURCES_CLNT.c) $(SOURCES_CLNT.h) \
$(TARGETS_CLNT.c) \n\n");
OpenPOWER on IntegriCloud