generic: add OFD lock tests
[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 writev_on_pagefault makeextents itrash rename \
13         multi_open_unlink dmiperf unwritten_sync genhashnames t_holes \
14         t_mmap_writev t_truncate_cmtime dirhash_collide t_rename_overwrite \
15         holetest t_truncate_self t_mmap_dio af_unix t_mmap_stale_pmd \
16         t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro \
17         t_ext4_dax_journal_corruption t_ext4_dax_inline_corruption \
18         t_ofd_locks
19
20 LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
21         preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
22         locktest unwritten_mmap bulkstat_unlink_test t_stripealign \
23         bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \
24         stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \
25         seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec cloner \
26         renameat2 t_getcwd e4compact test-nextquota punch-alternating \
27         attr-list-by-handle-cursor-test listxattr dio-interleaved t_dir_type \
28         dio-invalidate-cache stat_test t_encrypted_d_revalidate
29
30 SUBDIRS = log-writes perf
31
32 LLDLIBS = $(LIBATTR) $(LIBHANDLE) $(LIBACL) -lpthread
33
34 ifeq ($(HAVE_XLOG_ASSIGN_LSN), true)
35 LINUX_TARGETS += loggen
36 endif
37
38 ifeq ($(HAVE_FIEMAP), true)
39 LINUX_TARGETS += fiemap-tester
40 endif
41
42 ifeq ($(HAVE_OPEN_BY_HANDLE_AT), true)
43 LINUX_TARGETS += open_by_handle
44 endif
45
46 ifeq ($(HAVE_FALLOCATE), true)
47 LCFLAGS += -DHAVE_FALLOCATE
48 endif
49
50 ifeq ($(PKG_PLATFORM),linux)
51 TARGETS += $(LINUX_TARGETS)
52 endif
53
54 ifeq ($(HAVE_DB), true)
55 TARGETS += dbtest
56 LLDLIBS += $(LIBGDBM)
57 endif
58
59 ifeq ($(HAVE_AIO), true)
60 SUBDIRS += aio-dio-regress
61 LLDLIBS += -laio
62 endif
63
64 CFILES = $(TARGETS:=.c)
65 LDIRT = $(TARGETS) fssum
66
67
68 default: depend $(LDIRT) $(SUBDIRS)
69
70 depend: .dep
71
72 include $(BUILDRULES)
73
74 fssum: fssum.c md5.c
75         @echo "    [CC]    $@"
76         $(Q)$(LTLINK) fssum.c md5.c -o $@ $(CFLAGS) $(LDFLAGS) $(LDLIBS)
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 $(LDIRT) $(PKG_LIB_DIR)/src
87         $(LTINSTALL) -m 755 dmerror 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