2010-05-28 17:35:28 +01:00
|
|
|
# Build rules for the OpenAFS test suite.
|
|
|
|
|
|
|
|
srcdir=@srcdir@
|
2012-05-07 21:52:16 +01:00
|
|
|
tapdir=$(srcdir)/../../src/external/c-tap-harness/tests/tap
|
2010-05-28 17:35:28 +01:00
|
|
|
include @TOP_OBJDIR@/src/config/Makefile.config
|
Unix: Rework build system
Rework the unix build system so that we support taking CFLAGS and
LDFLAGS from the command line, and don't replace them with our own
settings. Also, take the opportunity to bring some sanity and
consistency into our Makefiles.
The standard Makefile.config now defines rules for LWP, pthreaded
and shared library builds. The CFLAGS settings for these are
called LWP_CFLAGS, PTH_CFLAGS and SHD_CFLAGS, respectively.
Similarly named variables are provided for LDFLAGS.
A module may select to use a particular build type for its suffix
rule by including either Makefile.lwp, Makefile.pthread or
Makefile.shared from src/config. This creates an appropriate .c.o
suffix rule, defines AFS_CFLAGS and AFS_LDFLAGS as appropriate, and
creates two rules AFS_CCRULE and AFS_LDRULE, which can be used to
build, and link objects. For example:
foo.o: foo.c
$(AFS_CCRULE) foo.c
foo: foo.o
$(AFS_LDRULE) foo.o
If a you wish to override the CFLAGS or LDFLAGS for an object build
using these rules (or through the .c.o suffix rule) you can do so,
by defining CFLAGS_<object> or LDFLAGS_<object>. For example:
CFLAGS_foo.o= -DDEBUG
LDFLAGS_foo = -ldebugging
A module may also alter the behaviour of the compile and link steps
module wide by defining MODULE_CFLAGS or MODULE_LDFLAGS.
This functionality is now used throughout the tree:
*) Suffix rules are used wherever possible, removing a number of
unecessary build rules.
*) All link steps are replaced with AFS_LDRULE
*) All standard compile steps are replaced with AFS_CCRULE
*) Unusal compile steps are defined, as far as possible, int
terms of the LWP_ PTH_ and SHD_ variables.
*) The use of $? has been removed entirely, as it makes it
impossible to provide build rules with dependency information
Change-Id: If76207e45da402a0ed9d7c1bdbe83c58c911a4f2
Reviewed-on: http://gerrit.openafs.org/2896
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Tested-by: Derrick Brashear <shadow@dementia.org>
Reviewed-by: Derrick Brashear <shadow@dementia.org>
2010-10-04 13:49:16 +01:00
|
|
|
include @TOP_OBJDIR@/src/config/Makefile.pthread
|
2010-05-28 17:35:28 +01:00
|
|
|
|
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>
2020-07-02 04:42:37 +01:00
|
|
|
LT_objs = basic.lo
|
2010-05-28 17:35:28 +01:00
|
|
|
|
2021-06-07 22:44:38 +01:00
|
|
|
all: libafstest_tap.la basic.h macros.h libtap.sh
|
2010-05-28 17:35:28 +01:00
|
|
|
|
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>
2020-07-02 04:42:37 +01:00
|
|
|
CFLAGS_basic.lo = @CFLAGS_NOERROR@ -I$(tapdir)/../..
|
|
|
|
basic.lo: $(tapdir)/basic.c $(tapdir)/basic.h
|
|
|
|
$(LT_CCRULE) $(tapdir)/basic.c
|
2012-05-07 21:52:16 +01:00
|
|
|
|
|
|
|
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
|
2010-05-28 17:35:28 +01:00
|
|
|
|
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>
2020-07-02 04:42:37 +01:00
|
|
|
# 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)
|
2010-05-28 17:35:28 +01:00
|
|
|
|
|
|
|
clean distclean:
|
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>
2020-07-02 04:42:37 +01:00
|
|
|
$(LT_CLEAN)
|
|
|
|
$(RM) -f *.o basic.h macros.h libtap.sh
|