d86d50a2b2984bbc8510c90203b614db7e2e6f9b
[xfstests-dev.git] / src / Makefile
1 #
2 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
3 #
4
5 TOPDIR = ..
6 include $(TOPDIR)/include/builddefs
7
8 TARGETS = dirstress fill fill2 getpagesize holes lstat64 \
9         nametest permname randholes runas truncfile usemem \
10         mmapcat append_reader append_writer dirperf metaperf \
11         devzero feature alloc fault fstest t_access_root \
12         godown resvtest writemod makeextents itrash rename \
13         multi_open_unlink dmiperf unwritten_sync genhashnames
14
15 LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
16         preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
17         locktest unwritten_mmap bulkstat_unlink_test t_stripealign \
18         bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable
19
20 SUBDIRS =
21
22 LLDLIBS = $(LIBATTR) $(LIBHANDLE) $(LIBACL)
23
24 ifeq ($(HAVE_XLOG_ASSIGN_LSN), true)
25 LINUX_TARGETS += loggen
26 endif
27
28 IRIX_TARGETS = open_unlink
29
30 ifeq ($(PKG_PLATFORM),linux)
31 TARGETS += $(LINUX_TARGETS)
32 endif
33
34 ifeq ($(PKG_PLATFORM),irix)
35 TARGETS += $(IRIX_TARGETS)
36 LLDLIBS += -lgen
37 endif
38
39 ifeq ($(HAVE_DB), true)
40 TARGETS += dbtest
41 LLDLIBS += $(LIBGDBM)
42 endif
43
44 ifeq ($(HAVE_AIO), true)
45 SUBDIRS += aio-dio-regress
46 endif
47
48 CFILES = $(TARGETS:=.c)
49 LDIRT = $(TARGETS)
50
51
52 default: depend $(TARGETS) $(SUBDIRS)
53
54 include $(BUILDRULES)
55
56 $(TARGETS): $(LIBTEST)
57         @echo "    [CC]    $@"
58         $(Q)$(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(LIBTEST)
59
60 LINKTEST = $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS)
61
62 install: default $(addsuffix -install,$(SUBDIRS))
63         $(INSTALL) -m 755 -d $(PKG_LIB_DIR)/src
64         $(INSTALL) -m 755 $(TARGETS) $(PKG_LIB_DIR)/src
65         $(INSTALL) -m 755 fill2attr fill2fs fill2fs_check scaleread.sh $(PKG_LIB_DIR)/src
66         $(INSTALL) -m 644 dumpfile $(PKG_LIB_DIR)/src
67
68 %-install:
69         $(MAKE) -C $* install
70
71 -include .dep