rx: Cleanup and build simple.example

Our simple.example is not built by default, and currenly does not build
for a couple of reasons:

There are undefined references to symbols in "lib/libafsrpc.a". For
example, there is an undefined reference to "hc_RAND_bytes" in
"rx_InitHost" in libafsrpc.a (rx.o). Modify the rules in
simple.example's Makefile.in to link the object files with hcrypto and
roken to fix this.

Running rxgen fails on objdir builds, because we weren't specifying a
srcdir path for sample.xg. Specify ${srcdir}/sample.xg instead.

Also change simple.example to be built by default to improve its
maintainability. Add it to the "rx_test" top-level make target, since it
depends on libafsrpc and libafsauthent.

[adeason@sinenomine.net: Use the existing rx_test target, slight commit
message edits.]

Change-Id: I9196ab170c594e9b5567e8f299625e4ff07f00eb
Reviewed-on: https://gerrit.openafs.org/15754
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
This commit is contained in:
Sahil Siddiq 2024-05-25 15:01:25 +05:30 committed by Michael Meffie
parent abb15d449c
commit 3961e416f6
3 changed files with 10 additions and 6 deletions

View File

@ -190,8 +190,9 @@ rxgen: $(DIR_roken) config
rx: config lwp rxgen rx_depinstall util rxgk_depinstall
+${COMPILE_PART1} rx ${COMPILE_PART2}
rx_test: rx libafsrpc
rx_test: rx libafsrpc libafsauthent
+${COMPILE_PART1} rx/test ${COMPILE_PART2}
+${COMPILE_PART1} rx/simple.example ${COMPILE_PART2}
rxstat: rx rxstat_depinstall
+${COMPILE_PART1} rxstat ${COMPILE_PART2}

View File

@ -183,6 +183,7 @@ dest: librx.a
#
clean:
cd test && $(MAKE) clean
cd simple.example && $(MAKE) clean
$(LT_CLEAN)
$(RM) -f *.o *.a core *_component_version_number.c

View File

@ -19,20 +19,22 @@ LIBS=$(TOP_LIBDIR)/libafsauthent.a $(TOP_LIBDIR)/libafsrpc.a \
all: sample_client sample_server
install dest:
sample_client: sample_client.o ${LIBS} sample.cs.o
$(AFS_LDRULE) sample_client.o sample.cs.o ${LIBS}
$(AFS_LDRULE) sample_client.o sample.cs.o ${LIBS} ${LIB_hcrypto} ${LIB_roken}
sample_server: sample_server.o sample.ss.o ${LIBS}
$(AFS_LDRULE) sample_server.o sample.ss.o ${LIBS}
$(AFS_LDRULE) sample_server.o sample.ss.o ${LIBS} ${LIB_hcrypto} ${LIB_roken}
sample_client.o: sample.h
sample_server.o: sample.h
sample.cs.c: sample.xg
$(RXGEN) -A -x -C -o $@ sample.xg
$(RXGEN) -A -x -C -o $@ ${srcdir}/sample.xg
sample.ss.c: sample.xg
$(RXGEN) -A -x -S -o $@ sample.xg
$(RXGEN) -A -x -S -o $@ ${srcdir}/sample.xg
sample.h: sample.xg
$(RXGEN) -A -x -h -o $@ sample.xg
$(RXGEN) -A -x -h -o $@ ${srcdir}/sample.xg
clean:
rm -f *.o sample.cs.c sample.ss.c sample_client sample_server