]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/Makefile
xfs_io: configure tests for preadv/pwritev & sync_file_range
[thirdparty/xfsprogs-dev.git] / io / Makefile
1 #
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 file.c freeze.c fsync.c getrusage.c imap.c mmap.c \
13 open.c parent.c pread.c prealloc.c pwrite.c shutdown.c truncate.c
14
15 LLDLIBS = $(LIBXCMD) $(LIBHANDLE)
16 LTDEPENDENCIES = $(LIBXCMD) $(LIBHANDLE)
17 LLDFLAGS = -static
18
19 ifeq ($(HAVE_FADVISE),yes)
20 CFILES += fadvise.c
21 LCFLAGS += -DHAVE_FADVISE
22 else
23 LSRCFILES += fadvise.c
24 endif
25
26 ifeq ($(HAVE_MADVISE),yes)
27 CFILES += madvise.c
28 LCFLAGS += -DHAVE_MADVISE
29 else
30 LSRCFILES += madvise.c
31 endif
32
33 ifeq ($(HAVE_MINCORE),yes)
34 CFILES += mincore.c
35 LCFLAGS += -DHAVE_MINCORE
36 else
37 LSRCFILES += mincore.c
38 endif
39
40 ifeq ($(HAVE_SENDFILE),yes)
41 CFILES += sendfile.c
42 LCFLAGS += -DHAVE_SENDFILE
43 else
44 LSRCFILES += sendfile.c
45 endif
46
47 ifeq ($(HAVE_FIEMAP),yes)
48 CFILES += fiemap.c
49 LCFLAGS += -DHAVE_FIEMAP
50 else
51 LSRCFILES += fiemap.c
52 endif
53
54 ifeq ($(PKG_PLATFORM),irix)
55 LSRCFILES += inject.c resblks.c
56 else
57 CFILES += inject.c resblks.c
58 LCFLAGS += -DHAVE_INJECT -DHAVE_RESBLKS
59 endif
60
61 ifeq ($(HAVE_SYNC_FILE_RANGE),yes)
62 CFILES += sync_file_range.c
63 LCFLAGS += -DHAVE_SYNC_FILE_RANGE
64 endif
65
66 ifeq ($(ENABLE_READLINE),yes)
67 LLDLIBS += $(LIBREADLINE) $(LIBTERMCAP)
68 endif
69
70 ifeq ($(ENABLE_EDITLINE),yes)
71 LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
72 endif
73
74 ifeq ($(HAVE_FALLOCATE),yes)
75 LCFLAGS += -DHAVE_FALLOCATE
76 endif
77
78 # Also implies PWRITEV
79 ifeq ($(HAVE_PREADV),yes)
80 LCFLAGS += -DHAVE_PREADV -DHAVE_PWRITEV
81 endif
82
83 default: depend $(LTCOMMAND)
84
85 include $(BUILDRULES)
86
87 install: default
88 $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
89 $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_SBIN_DIR)
90 $(LTINSTALL) -m 755 xfs_bmap.sh $(PKG_SBIN_DIR)/xfs_bmap
91 $(LTINSTALL) -m 755 xfs_freeze.sh $(PKG_SBIN_DIR)/xfs_freeze
92 $(LTINSTALL) -m 755 xfs_mkfile.sh $(PKG_SBIN_DIR)/xfs_mkfile
93 install-dev:
94
95 -include .dep