d7540484bdccdf8ceb9fddab0e07ea58775657d1
[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 t_holes \
14         t_mmap_writev t_truncate_cmtime dirhash_collide
15
16 LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
17         preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
18         locktest unwritten_mmap bulkstat_unlink_test t_stripealign \
19         bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \
20         stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \
21         seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec cloner \
22         renameat2
23
24 SUBDIRS =
25
26 LLDLIBS = $(LIBATTR) $(LIBHANDLE) $(LIBACL)
27
28 ifeq ($(HAVE_XLOG_ASSIGN_LSN), true)
29 LINUX_TARGETS += loggen
30 endif
31
32 ifeq ($(HAVE_FIEMAP), true)
33 LINUX_TARGETS += fiemap-tester
34 endif
35
36 ifeq ($(HAVE_FALLOCATE), true)
37 LCFLAGS += -DHAVE_FALLOCATE
38 endif
39
40 IRIX_TARGETS = open_unlink
41
42 ifeq ($(PKG_PLATFORM),linux)
43 TARGETS += $(LINUX_TARGETS)
44 endif
45
46 ifeq ($(PKG_PLATFORM),irix)
47 TARGETS += $(IRIX_TARGETS)
48 LLDLIBS += -lgen
49 endif
50
51 ifeq ($(HAVE_DB), true)
52 TARGETS += dbtest
53 LLDLIBS += $(LIBGDBM)
54 endif
55
56 ifeq ($(HAVE_AIO), true)
57 SUBDIRS += aio-dio-regress
58 endif
59
60 ifeq ($(HAVE_SSL), true)
61 TARGETS += fssum
62 LLDLIBS += -lssl -lcrypto
63 ifeq ($(PKG_PLATFORM),linux)
64 CFLAGS += -D__LINUX__
65 endif
66 endif
67
68 CFILES = $(TARGETS:=.c)
69 LDIRT = $(TARGETS)
70
71
72 default: depend $(TARGETS) $(SUBDIRS)
73
74 depend: .dep
75
76 include $(BUILDRULES)
77
78 $(TARGETS): $(LIBTEST)
79         @echo "    [CC]    $@"
80         $(Q)$(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(LIBTEST)
81
82 LINKTEST = $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS)
83
84 install: default $(addsuffix -install,$(SUBDIRS))
85         $(INSTALL) -m 755 -d $(PKG_LIB_DIR)/src
86         $(LTINSTALL) -m 755 $(TARGETS) $(PKG_LIB_DIR)/src
87         $(LTINSTALL) -m 755 fill2attr fill2fs fill2fs_check scaleread.sh $(PKG_LIB_DIR)/src
88         $(LTINSTALL) -m 644 dumpfile $(PKG_LIB_DIR)/src
89
90 %-install:
91         $(MAKE) -C $* install
92
93 -include .dep