Whamcloud - gitweb
b=15277
[fs/lustre-release.git] / lustre / liblustre / tests / Makefile.am
index a99a4bb..08bd86b 100644 (file)
@@ -1,45 +1,58 @@
 ## Liblustre excecutables & libraries Makefile
-DEFS=
 
-CFLAGS := -g -Wall -I$(top_srcdir)/utils -I$(top_srcdir)/portals/include \
-          -I$(top_srcdir)/portals/unals -I$(SYSIO)/include \
-          -I/opt/lam/include -L/opt/lam/lib
+AM_CPPFLAGS = -I$(SYSIO)/include -I/opt/lam/include $(LLCPPFLAGS) -I$(top_srcdir)/lnet/ulnds
+AM_CFLAGS = $(LLCFLAGS)
+AM_LIBS = $(LIBEFENCE) $(LIBREADLINE)
 
-KFLAGS:=
-CPPFLAGS = $(HAVE_EFENCE) -D_LARGEFILE64_SOURCE=1
-LIBS = $(LIBEFENCE)
+LLIB_EXEC = $(top_builddir)/lustre/utils/liblustreapi.a $(top_builddir)/lustre/liblustre/liblustre.a $(CAP_LIBS) $(PTHREAD_LIBS) $(ZLIB)
 
+if LIBLUSTRE
+noinst_LIBRARIES = libtestcommon.a
 
-LLIB_EXEC= ../liblustre.a -lpthread
+if LIBLUSTRE_TESTS
+noinst_PROGRAMS = sanity
 
-noinst_LIBRARIES = libtestcommon.a
-libtestcommon_a_SOURCES = test_common.c
+if !CRAY_XT3
+noinst_PROGRAMS += recovery_small replay_single replay_ost_single
+endif # !CRAY_XT3
+
+if MPITESTS
+noinst_PROGRAMS += test_lock_cancel
+endif # MPITESTS
+
+liblustre_testdir=$(libdir)/lustre/liblustre/tests
+liblustre_test_PROGRAMS = $(noinst_PROGRAMS)
+liblustre_test_LIBRARIES = $(noinst_LIBRARIES)
 
-bin_PROGRAMS = echo_test sanity recovery_small replay_single test_lock_cancel \
-    replay_ost_single
+endif # LIBLUSTRE_TESTS
+endif # LIBLUSTRE
 
-echo_test_SOURCES = echo_test.c  ../../utils/parser.c ../../utils/obd.c ../../utils/lustre_cfg.c
-echo_test_LDADD = ../liblsupport.a $(LIBREADLINE) -lpthread 
-echo_test_DEPENDENCIES=$(top_srcdir)/liblustre/liblsupport.a
+libtestcommon_a_SOURCES = test_common.c test_common.h
 
 sanity_SOURCES = sanity.c
-sanity_LDADD := ./libtestcommon.a $(LLIB_EXEC)
-sanity_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a ./libtestcommon.a
+sanity_CFLAGS = $(LL_CFLAGS)
+sanity_LDADD := libtestcommon.a $(LLIB_EXEC)
+sanity_DEPENDENCIES = $(top_builddir)/lustre/liblustre/liblustre.a libtestcommon.a
 
 recovery_small_SOURCES = recovery_small.c
-recovery_small_LDADD := ./libtestcommon.a $(LLIB_EXEC) 
-recovery_small_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a
+recovery_small_CFLAGS = $(LL_CFLAGS)
+recovery_small_LDADD := libtestcommon.a $(LLIB_EXEC) 
+recovery_small_DEPENDENCIES = $(top_builddir)/lustre/liblustre/liblustre.a libtestcommon.a
 
 replay_single_SOURCES = replay_single.c
-replay_single_LDADD := ./libtestcommon.a $(LLIB_EXEC)
-replay_single_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a
-
-test_lock_cancel_SOURCES = test_lock_cancel.c
-test_lock_cancel_LDADD :=  $(LLIB_EXEC) -lmpi -llam
+replay_single_CFLAGS = $(LL_CFLAGS)
+replay_single_LDADD := libtestcommon.a $(LLIB_EXEC)
+replay_single_DEPENDENCIES = $(top_builddir)/lustre/liblustre/liblustre.a libtestcommon.a
 
 replay_ost_single_SOURCES = replay_ost_single.c
-replay_ost_single_LDADD := ./libtestcommon.a $(LLIB_EXEC)
-replay_ost_single_DEPENDENCIES = $(top_srcdir)/liblustre/liblustre.a
+replay_ost_single_CFLAGS = $(LL_CFLAGS)
+replay_ost_single_LDADD := libtestcommon.a $(LLIB_EXEC)
+replay_ost_single_DEPENDENCIES = $(top_builddir)/lustre/liblustre/liblustre.a libtestcommon.a
+
+if MPITESTS
+test_lock_cancel_SOURCES = test_lock_cancel.c
+test_lock_cancel_CFLAGS = $(LL_CFLAGS) -I/opt/lam/include
+test_lock_cancel_LDADD :=  $(LLIB_EXEC)  -L/opt/lam/lib -lmpi -llam
+endif
 
-include $(top_srcdir)/Rules