blob: 7b3d89d6cdb0c1f5be2403463c89913e324be1a8 [file] [log] [blame]
# -*- Makefile -*-
#
# $Id$
#
##############################################################################
#
# Usage:
#
# $ make
#
# To make all tests uder $(TOPDIR)/tests. Will generate a .d file
# an place in the directory $(DEPENDDIR) for every source file.
#
##############################################################################
# Generated when make is run in TOPDIR
include ../makefile.in
# The place where the sources are looked for;
# used in the variables setup in makefile.common
TESTDIR = $(TOPDIR)/tests
SRCDIRS = $(TESTDIR)/src
# include common variables setting for all makefiles
ONE_REPOSITORY = 1
include ../makefile.common
# Reset LIBSUFFIX to .a until we decide to build a dynamic library
LIBSUFFIX = .a
# Target library to be built
RWTESTLIB = librwtest$(BUILDTYPE)$(LIBSUFFIX)
# Additional include directories:
INCLUDES += -I$(TESTDIR)/include
# VPATH to look for sources in (appended dir for test.cpp)
VPATH += $(TESTDIR)/src
# For xlC 5.0.2.0
ifneq ($(DEFAULT_SHROBJ),)
SOBJS = $(DEFAULT_SHROBJ)
else
SOBJS = $(OBJS)
endif
# CXXPRELINK - command for compilers that use template
# instantiation models that require a prelink stage
ifneq ($(PRELINKFLAGS),)
CXXPRELINK = $(CXX) $(CPPFLAGS) $(PRELINKFLAGS) $(OBJS) $(LDFLAGS) $(LDLIBS)
endif # ($(PRELINKFLAGS),)
ifneq ($(RPATH),)
LDFLAGS += $(RPATH)$(LIBDIR)
endif
##############################################################################
# TARGETS
##############################################################################
all: $(RWTESTLIB)
# do any directory specific cleanup using the realclean target
realclean: clean dependclean
rm -f $(RWTESTLIB)
# For the time being the rules are identical until we
# decide to build a shared library for rw test lib.
ifeq ($(findstring shared,$(BUILDMODE)),shared)
$(RWTESTLIB): $(OBJS)
@echo "$(CXXPRELINK)" >> $(LOGFILE)
$(CXXPRELINK) $(TEEOPTS)
@echo "$(AR) $(ARFLAGS) $(RWTESTLIB) $(SOBJS)" >> $(LOGFILE)
$(AR) $(ARFLAGS) $(RWTESTLIB) $(SOBJS)
else
$(RWTESTLIB): $(OBJS)
@echo "$(CXXPRELINK)" >> $(LOGFILE)
$(CXXPRELINK) $(TEEOPTS)
@echo "$(AR) $(ARFLAGS) $(RWTESTLIB) $(SOBJS)" >> $(LOGFILE)
$(AR) $(ARFLAGS) $(RWTESTLIB) $(SOBJS)
endif # ($(findstring shared,$(BUILDMODE)),shared)
# Common rules for all Makefile_s
include ../makefile.rules