openafs/tests/tap/Makefile.in
Andrew Deason 405001be72 tests: Introduce libafstest_common
Currently, a few tests use the code in tests/common/ by linking
individual object files in there in addition to the test code (e.g.
linking ../common/config.o along with superuser-t.o).

This convention makes it very obnoxious to move code around in
tests/common/, since any users need to update their link lines. It
also makes it difficult for code in tests/common/ to make use of
functions in other tests/common/ files.

To fix this, just build all of the objects in tests/common/ into a
convenience library, called libafstest_common, and link the relevant
tests against that. Link a few requisite libraries (roken, rfc3961) in
libafstest_common, so each individual test doesn't need to link
against them.

Also link the TAP library itself in libafstest_common, so tests don't
have to explicitly link against it separately. To do this, convert it
into a libtool library, libafstest_tap.la.

Change-Id: I9c031c164efee20201336edcbfaff429e1d231b7
Reviewed-on: https://gerrit.openafs.org/14318
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
2021-08-07 20:38:05 -04:00

33 lines
902 B
Makefile

# Build rules for the OpenAFS test suite.
srcdir=@srcdir@
tapdir=$(srcdir)/../../src/external/c-tap-harness/tests/tap
include @TOP_OBJDIR@/src/config/Makefile.config
include @TOP_OBJDIR@/src/config/Makefile.pthread
LT_objs = basic.lo
all check test tests: libafstest_tap.la basic.h macros.h libtap.sh
CFLAGS_basic.lo = @CFLAGS_NOERROR@ -I$(tapdir)/../..
basic.lo: $(tapdir)/basic.c $(tapdir)/basic.h
$(LT_CCRULE) $(tapdir)/basic.c
basic.h: $(tapdir)/basic.h
cp $(tapdir)/basic.h basic.h
macros.h: $(tapdir)/macros.h
cp $(tapdir)/macros.h macros.h
libtap.sh: $(tapdir)/libtap.sh
cp $(tapdir)/libtap.sh libtap.sh
# Use LT_LDLIB_shlib_internal, since this is an internal-only library (just
# used for the tests), so we don't need a symbol export list.
libafstest_tap.la: $(LT_objs)
$(LT_LDLIB_shlib_internal) $(LT_objs)
clean distclean:
$(LT_CLEAN)
$(RM) -f *.o basic.h macros.h libtap.sh