]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/Makefile
xfs_scrub_all: simplify cleanup of run_killable
[thirdparty/xfsprogs-dev.git] / io / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2000-2005 Silicon Graphics, Inc. All Rights Reserved.
3 #
4
5 TOPDIR = ..
6 include $(TOPDIR)/include/builddefs
7
8 LTCOMMAND = xfs_io
9 LSRCFILES = xfs_bmap.sh xfs_freeze.sh xfs_mkfile.sh
10 HFILES = init.h io.h
11 CFILES = init.c \
12 attr.c bmap.c bulkstat.c crc32cselftest.c cowextsize.c encrypt.c \
13 file.c freeze.c fsuuid.c fsync.c getrusage.c imap.c inject.c label.c \
14 link.c mmap.c open.c parent.c pread.c prealloc.c pwrite.c reflink.c \
15 resblks.c scrub.c seek.c shutdown.c stat.c swapext.c sync.c \
16 truncate.c utimes.c
17
18 LLDLIBS = $(LIBXCMD) $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBUUID)
19 LTDEPENDENCIES = $(LIBXCMD) $(LIBHANDLE) $(LIBFROG)
20 LLDFLAGS = -static-libtool-libs
21
22 ifeq ($(HAVE_FADVISE),yes)
23 CFILES += fadvise.c
24 LCFLAGS += -DHAVE_FADVISE
25 else
26 LSRCFILES += fadvise.c
27 endif
28
29 ifeq ($(HAVE_MADVISE),yes)
30 CFILES += madvise.c
31 LCFLAGS += -DHAVE_MADVISE
32 else
33 LSRCFILES += madvise.c
34 endif
35
36 ifeq ($(HAVE_MINCORE),yes)
37 CFILES += mincore.c
38 LCFLAGS += -DHAVE_MINCORE
39 else
40 LSRCFILES += mincore.c
41 endif
42
43 ifeq ($(HAVE_SENDFILE),yes)
44 CFILES += sendfile.c
45 LCFLAGS += -DHAVE_SENDFILE
46 else
47 LSRCFILES += sendfile.c
48 endif
49
50 ifeq ($(HAVE_FIEMAP),yes)
51 CFILES += fiemap.c
52 LCFLAGS += -DHAVE_FIEMAP
53 else
54 LSRCFILES += fiemap.c
55 endif
56
57 ifeq ($(HAVE_COPY_FILE_RANGE),yes)
58 CFILES += copy_file_range.c
59 LCFLAGS += -DHAVE_COPY_FILE_RANGE
60 endif
61
62 ifeq ($(HAVE_SYNC_FILE_RANGE),yes)
63 CFILES += sync_file_range.c
64 LCFLAGS += -DHAVE_SYNC_FILE_RANGE
65 endif
66
67 ifeq ($(HAVE_SYNCFS),yes)
68 LCFLAGS += -DHAVE_SYNCFS
69 endif
70
71 ifeq ($(ENABLE_EDITLINE),yes)
72 LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
73 endif
74
75 ifeq ($(HAVE_FALLOCATE),yes)
76 LCFLAGS += -DHAVE_FALLOCATE
77 endif
78
79 # Also implies PWRITEV
80 ifeq ($(HAVE_PREADV),yes)
81 LCFLAGS += -DHAVE_PREADV -DHAVE_PWRITEV
82 endif
83
84 ifeq ($(HAVE_PWRITEV2),yes)
85 LCFLAGS += -DHAVE_PWRITEV2
86 endif
87
88 ifeq ($(HAVE_READDIR),yes)
89 CFILES += readdir.c
90 LCFLAGS += -DHAVE_READDIR
91 endif
92
93 ifeq ($(HAVE_MREMAP),yes)
94 LCFLAGS += -DHAVE_MREMAP
95 endif
96
97 ifeq ($(HAVE_MAP_SYNC),yes)
98 LCFLAGS += -DHAVE_MAP_SYNC
99 endif
100
101 ifeq ($(HAVE_DEVMAPPER),yes)
102 CFILES += log_writes.c
103 LLDLIBS += $(LIBDEVMAPPER)
104 LCFLAGS += -DHAVE_DEVMAPPER
105 endif
106
107 ifeq ($(HAVE_GETFSMAP),yes)
108 CFILES += fsmap.c
109 endif
110
111 ifeq ($(HAVE_STATFS_FLAGS),yes)
112 LCFLAGS += -DHAVE_STATFS_FLAGS
113 endif
114
115 default: depend $(LTCOMMAND)
116
117 include $(BUILDRULES)
118
119 install: default
120 $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
121 $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_SBIN_DIR)
122 $(LTINSTALL) -m 755 xfs_bmap.sh $(PKG_SBIN_DIR)/xfs_bmap
123 $(LTINSTALL) -m 755 xfs_freeze.sh $(PKG_SBIN_DIR)/xfs_freeze
124 $(LTINSTALL) -m 755 xfs_mkfile.sh $(PKG_SBIN_DIR)/xfs_mkfile
125 install-dev:
126
127 -include .dep