]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - io/Makefile
58ae2980381860e83169d2534f2aa9e8e985fcce
[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 cowextsize.c encrypt.c file.c freeze.c fsync.c \
13 getrusage.c imap.c link.c mmap.c open.c parent.c pread.c prealloc.c \
14 pwrite.c reflink.c scrub.c seek.c shutdown.c stat.c sync.c truncate.c \
15 utimes.c
16
17 LLDLIBS = $(LIBXCMD) $(LIBHANDLE) $(LIBPTHREAD)
18 LTDEPENDENCIES = $(LIBXCMD) $(LIBHANDLE)
19 LLDFLAGS = -static-libtool-libs
20
21 ifeq ($(HAVE_FADVISE),yes)
22 CFILES += fadvise.c
23 LCFLAGS += -DHAVE_FADVISE
24 else
25 LSRCFILES += fadvise.c
26 endif
27
28 ifeq ($(HAVE_MADVISE),yes)
29 CFILES += madvise.c
30 LCFLAGS += -DHAVE_MADVISE
31 else
32 LSRCFILES += madvise.c
33 endif
34
35 ifeq ($(HAVE_MINCORE),yes)
36 CFILES += mincore.c
37 LCFLAGS += -DHAVE_MINCORE
38 else
39 LSRCFILES += mincore.c
40 endif
41
42 ifeq ($(HAVE_SENDFILE),yes)
43 CFILES += sendfile.c
44 LCFLAGS += -DHAVE_SENDFILE
45 else
46 LSRCFILES += sendfile.c
47 endif
48
49 ifeq ($(HAVE_FIEMAP),yes)
50 CFILES += fiemap.c
51 LCFLAGS += -DHAVE_FIEMAP
52 else
53 LSRCFILES += fiemap.c
54 endif
55
56 ifeq ($(PKG_PLATFORM),irix)
57 LSRCFILES += inject.c resblks.c
58 else
59 CFILES += inject.c resblks.c
60 LCFLAGS += -DHAVE_INJECT -DHAVE_RESBLKS
61 endif
62
63 ifeq ($(HAVE_COPY_FILE_RANGE),yes)
64 CFILES += copy_file_range.c
65 LCFLAGS += -DHAVE_COPY_FILE_RANGE
66 endif
67
68 ifeq ($(HAVE_SYNC_FILE_RANGE),yes)
69 CFILES += sync_file_range.c
70 LCFLAGS += -DHAVE_SYNC_FILE_RANGE
71 endif
72
73 ifeq ($(HAVE_SYNCFS),yes)
74 LCFLAGS += -DHAVE_SYNCFS
75 endif
76
77 ifeq ($(ENABLE_READLINE),yes)
78 LLDLIBS += $(LIBREADLINE) $(LIBTERMCAP)
79 endif
80
81 ifeq ($(ENABLE_EDITLINE),yes)
82 LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
83 endif
84
85 ifeq ($(HAVE_FALLOCATE),yes)
86 LCFLAGS += -DHAVE_FALLOCATE
87 endif
88
89 # Also implies PWRITEV
90 ifeq ($(HAVE_PREADV),yes)
91 LCFLAGS += -DHAVE_PREADV -DHAVE_PWRITEV
92 endif
93
94 ifeq ($(HAVE_PWRITEV2),yes)
95 LCFLAGS += -DHAVE_PWRITEV2
96 endif
97
98 ifeq ($(HAVE_READDIR),yes)
99 CFILES += readdir.c
100 LCFLAGS += -DHAVE_READDIR
101 endif
102
103 ifeq ($(HAVE_MREMAP),yes)
104 LCFLAGS += -DHAVE_MREMAP
105 endif
106
107 # On linux we get fsmap from the system or define it ourselves
108 # so include this based on platform type. If this reverts to only
109 # the autoconf check w/o local definition, change to testing HAVE_GETFSMAP
110 ifeq ($(PKG_PLATFORM),linux)
111 CFILES += fsmap.c
112 endif
113
114 ifeq ($(HAVE_STATFS_FLAGS),yes)
115 LCFLAGS += -DHAVE_STATFS_FLAGS
116 endif
117
118 default: depend $(LTCOMMAND)
119
120 include $(BUILDRULES)
121
122 install: default
123 $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
124 $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_SBIN_DIR)
125 $(LTINSTALL) -m 755 xfs_bmap.sh $(PKG_SBIN_DIR)/xfs_bmap
126 $(LTINSTALL) -m 755 xfs_freeze.sh $(PKG_SBIN_DIR)/xfs_freeze
127 $(LTINSTALL) -m 755 xfs_mkfile.sh $(PKG_SBIN_DIR)/xfs_mkfile
128 install-dev:
129
130 -include .dep