fscrypt-crypt-util: add utility for reproducing fscrypt encrypted data
[xfstests-dev.git] / src / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 #
3 # Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
4 #
5
6 TOPDIR = ..
7 include $(TOPDIR)/include/builddefs
8
9 TARGETS = dirstress fill fill2 getpagesize holes lstat64 \
10         nametest permname randholes runas truncfile usemem \
11         mmapcat append_reader append_writer dirperf metaperf \
12         devzero feature alloc fault fstest t_access_root \
13         godown resvtest writemod writev_on_pagefault makeextents itrash rename \
14         multi_open_unlink dmiperf unwritten_sync genhashnames t_holes \
15         t_mmap_writev t_truncate_cmtime dirhash_collide t_rename_overwrite \
16         holetest t_truncate_self t_mmap_dio af_unix t_mmap_stale_pmd \
17         t_mmap_cow_race t_mmap_fallocate fsync-err t_mmap_write_ro \
18         t_ext4_dax_journal_corruption t_ext4_dax_inline_corruption \
19         t_ofd_locks t_locks_execve t_mmap_collision
20
21 LINUX_TARGETS = xfsctl bstat t_mtab getdevicesize preallo_rw_pattern_reader \
22         preallo_rw_pattern_writer ftrunc trunc fs_perms testx looptest \
23         locktest unwritten_mmap bulkstat_unlink_test \
24         bulkstat_unlink_test_modified t_dir_offset t_futimens t_immutable \
25         stale_handle pwrite_mmap_blocked t_dir_offset2 seek_sanity_test \
26         seek_copy_test t_readdir_1 t_readdir_2 fsync-tester nsexec cloner \
27         renameat2 t_getcwd e4compact test-nextquota punch-alternating \
28         attr-list-by-handle-cursor-test listxattr dio-interleaved t_dir_type \
29         dio-invalidate-cache stat_test t_encrypted_d_revalidate \
30         attr_replace_test swapon mkswap t_attr_corruption t_open_tmpfiles \
31         fscrypt-crypt-util
32
33 SUBDIRS = log-writes perf
34
35 LLDLIBS = $(LIBATTR) $(LIBHANDLE) $(LIBACL) -lpthread -lrt
36
37 ifeq ($(HAVE_XLOG_ASSIGN_LSN), true)
38 LINUX_TARGETS += loggen
39 endif
40
41 ifeq ($(HAVE_FIEMAP), true)
42 LINUX_TARGETS += fiemap-tester t_stripealign
43 endif
44
45 ifeq ($(HAVE_OPEN_BY_HANDLE_AT), true)
46 LINUX_TARGETS += open_by_handle
47 endif
48
49 ifeq ($(HAVE_FALLOCATE), true)
50 LCFLAGS += -DHAVE_FALLOCATE
51 endif
52
53 ifeq ($(PKG_PLATFORM),linux)
54 TARGETS += $(LINUX_TARGETS)
55 endif
56
57 ifeq ($(HAVE_DB), true)
58 TARGETS += dbtest
59 LLDLIBS += $(LIBGDBM)
60 endif
61
62 ifeq ($(HAVE_AIO), true)
63 SUBDIRS += aio-dio-regress
64 LLDLIBS += -laio
65 endif
66
67 CFILES = $(TARGETS:=.c)
68 LDIRT = $(TARGETS) fssum
69
70
71 default: depend $(LDIRT) $(SUBDIRS)
72
73 depend: .dep
74
75 include $(BUILDRULES)
76
77 fssum: fssum.c md5.c
78         @echo "    [CC]    $@"
79         $(Q)$(LTLINK) fssum.c md5.c -o $@ $(CFLAGS) $(LDFLAGS) $(LDLIBS)
80
81 $(TARGETS): $(LIBTEST)
82         @echo "    [CC]    $@"
83         $(Q)$(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS) $(LDLIBS) $(LIBTEST)
84
85 LINKTEST = $(LTLINK) $@.c -o $@ $(CFLAGS) $(LDFLAGS)
86
87 install: default $(addsuffix -install,$(SUBDIRS))
88         $(INSTALL) -m 755 -d $(PKG_LIB_DIR)/src
89         $(LTINSTALL) -m 755 $(LDIRT) $(PKG_LIB_DIR)/src
90         $(LTINSTALL) -m 755 dmerror fill2attr fill2fs fill2fs_check scaleread.sh $(PKG_LIB_DIR)/src
91         $(LTINSTALL) -m 644 dumpfile $(PKG_LIB_DIR)/src
92
93 %-install:
94         $(MAKE) -C $* install
95
96 -include .dep