openafs/tests/Makefile.in

68 lines
2.2 KiB
Makefile
Raw Permalink Normal View History

# Build rules for the OpenAFS test suite.
srcdir=@srcdir@/../src/external/c-tap-harness/tests
abs_top_srcdir=@abs_top_srcdir@
abs_top_builddir=@abs_top_builddir@
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
MODULE_CFLAGS = -DC_TAP_SOURCE='"$(abs_top_srcdir)/tests"' \
-DC_TAP_BUILD='"$(abs_top_builddir)/tests"'
SUBDIRS = tap common auth util cmd volser opr rx
all: runtests
@for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done
runtests: runtests.o
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
$(AFS_LDRULE) runtests.o
runtests.o: $(srcdir)/runtests.c
$(AFS_CCRULE) $(srcdir)/runtests.c
RUNTESTS_V0_DEFAULT=-l $(abs_top_srcdir)/tests/TESTS
RUNTESTS_V1_DEFAULT=-v -l $(abs_top_srcdir)/tests/TESTS
# If $(TESTS) is blank, RUNTESTS_ARGS will expand to RUNTESTS_DEFAULT_, so
# we'll run our default list of tests. If $(TESTS) is not blank,
# $(RUNTESTS_DEFAULT_$(TESTS)) will expand into nothing, so RUNTESTS_ARGS will
# just become effectively $(TESTS).
RUNTESTS_DEFAULT_=$(RUNTESTS_V$(V)_DEFAULT)
RUNTESTS_ARGS=$(RUNTESTS_DEFAULT_$(TESTS)) $(TESTS)
# To run specific tests, run e.g. 'make check TESTS="rx/foo opr/foo"'
check test tests: all runtests
MAKECHECK=1 $(abs_top_srcdir)/tests/libwrap @TOP_OBJDIR@/lib \
./runtests $(RUNTESTS_ARGS)
# To start an interactive subshell with the environment required to run
# the test programs, run 'make shell'. Run 'exit' to end the subshell.
#
# Example usage:
#
# $ make shell
# Starting a shell to run tests. Run 'exit' when done.
# $ PS1="(tests) $PS1" # Optionally set the PS1 in the subshell.
# (tests) $ rx/perf-t # Run tests directly or via a debugger.
# ...
# (tests) $ exit # Exit when done.
#
shell: all runtests
@if [ "x$$MAKECHECK" = "x1" ]; then \
echo "Already in the tests subshell."; \
else \
echo "Starting a shell to run tests. Run 'exit' when done."; \
MAKECHECK=1 \
C_TAP_SOURCE=@abs_top_srcdir@/tests \
C_TAP_BUILD=@abs_top_builddir@/tests \
SOURCE=@abs_top_srcdir@/tests \
BUILD=@abs_top_builddir@/tests \
@abs_top_srcdir@/tests/libwrap @TOP_OBJDIR@/lib $(SHELL); \
fi
install:
clean distclean:
@for A in $(SUBDIRS); do cd $$A && $(MAKE) $@ && cd .. || exit 1; done
$(RM) -f *.o core runtests