]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - io/Makefile
libfrog: always use the kernel GETFSMAP definitions
[thirdparty/xfsprogs-dev.git] / io / Makefile
index dd637fff357c3c3ad40b0fa706e717b904275a2f..498174cfc43e32006c751a84883059a319c9706b 100644 (file)
-#
-# Copyright (c) 2000-2004 Silicon Graphics, Inc.  All Rights Reserved.
-#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms of version 2 of the GNU General Public License as
-# published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it would be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-#
-# Further, this software is distributed without any warranty that it is
-# free of the rightful claim of any third person regarding infringement
-# or the like.  Any license provided herein, whether implied or
-# otherwise, applies only to this software file.  Patent licenses, if
-# any, provided herein do not apply to combinations of this program with
-# other software, or any other product whatsoever.
-#
-# You should have received a copy of the GNU General Public License along
-# with this program; if not, write the Free Software Foundation, Inc., 59
-# Temple Place - Suite 330, Boston MA 02111-1307, USA.
-#
-# Contact information: Silicon Graphics, Inc., 1600 Amphitheatre Pkwy,
-# Mountain View, CA  94043, or:
-#
-# http://www.sgi.com
-#
-# For further information regarding this notice, see:
-#
-# http://oss.sgi.com/projects/GenInfo/SGIGPLNoticeExplan/
+# SPDX-License-Identifier: GPL-2.0
+# Copyright (c) 2000-2005 Silicon Graphics, Inc.  All Rights Reserved.
 #
 
 TOPDIR = ..
 include $(TOPDIR)/include/builddefs
 
 LTCOMMAND = xfs_io
-LSRCFILES = xfs_bmap.sh xfs_freeze.sh
-HFILES = command.h input.h init.h io.h
-CFILES = command.c input.c init.c \
-       bmap.c file.c freeze.c fsync.c help.c inject.c \
-       mmap.c open.c pread.c prealloc.c pwrite.c quit.c \
-       resblks.c shutdown.c truncate.c
-
-ifeq ($(PKG_PLATFORM),linux)
+LSRCFILES = xfs_bmap.sh xfs_freeze.sh xfs_mkfile.sh
+HFILES = init.h io.h
+CFILES = init.c \
+       attr.c bmap.c bulkstat.c crc32cselftest.c cowextsize.c encrypt.c \
+       file.c freeze.c fsync.c getrusage.c imap.c inject.c label.c link.c \
+       mmap.c open.c parent.c pread.c prealloc.c pwrite.c reflink.c \
+       resblks.c scrub.c seek.c shutdown.c stat.c swapext.c sync.c \
+       truncate.c utimes.c
+
+LLDLIBS = $(LIBXCMD) $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD)
+LTDEPENDENCIES = $(LIBXCMD) $(LIBHANDLE) $(LIBFROG)
+LLDFLAGS = -static-libtool-libs
+
+ifeq ($(HAVE_FADVISE),yes)
 CFILES += fadvise.c
 LCFLAGS += -DHAVE_FADVISE
 else
 LSRCFILES += fadvise.c
 endif
 
-ifeq ($(ENABLE_READLINE),yes)
-LLDLIBS += $(LIBREADLINE)
-CFLAGS += -DENABLE_READLINE
+ifeq ($(HAVE_MADVISE),yes)
+CFILES += madvise.c
+LCFLAGS += -DHAVE_MADVISE
+else
+LSRCFILES += madvise.c
+endif
+
+ifeq ($(HAVE_MINCORE),yes)
+CFILES += mincore.c
+LCFLAGS += -DHAVE_MINCORE
+else
+LSRCFILES += mincore.c
+endif
+
+ifeq ($(HAVE_SENDFILE),yes)
+CFILES += sendfile.c
+LCFLAGS += -DHAVE_SENDFILE
+else
+LSRCFILES += sendfile.c
+endif
+
+ifeq ($(HAVE_FIEMAP),yes)
+CFILES += fiemap.c
+LCFLAGS += -DHAVE_FIEMAP
+else
+LSRCFILES += fiemap.c
+endif
+
+ifeq ($(HAVE_COPY_FILE_RANGE),yes)
+CFILES += copy_file_range.c
+LCFLAGS += -DHAVE_COPY_FILE_RANGE
+endif
+
+ifeq ($(HAVE_SYNC_FILE_RANGE),yes)
+CFILES += sync_file_range.c
+LCFLAGS += -DHAVE_SYNC_FILE_RANGE
+endif
+
+ifeq ($(HAVE_SYNCFS),yes)
+LCFLAGS += -DHAVE_SYNCFS
 endif
 
 ifeq ($(ENABLE_EDITLINE),yes)
-LLDLIBS += $(LIBEDITLINE)
-CFLAGS += -DENABLE_EDITLINE
+LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
+endif
+
+ifeq ($(HAVE_FALLOCATE),yes)
+LCFLAGS += -DHAVE_FALLOCATE
 endif
 
-default: $(LTCOMMAND)
+# Also implies PWRITEV
+ifeq ($(HAVE_PREADV),yes)
+LCFLAGS += -DHAVE_PREADV -DHAVE_PWRITEV
+endif
+
+ifeq ($(HAVE_PWRITEV2),yes)
+LCFLAGS += -DHAVE_PWRITEV2
+endif
+
+ifeq ($(HAVE_READDIR),yes)
+CFILES += readdir.c
+LCFLAGS += -DHAVE_READDIR
+endif
+
+ifeq ($(HAVE_MREMAP),yes)
+LCFLAGS += -DHAVE_MREMAP
+endif
+
+ifeq ($(HAVE_MAP_SYNC),yes)
+LCFLAGS += -DHAVE_MAP_SYNC
+endif
+
+ifeq ($(HAVE_DEVMAPPER),yes)
+CFILES += log_writes.c
+LLDLIBS += $(LIBDEVMAPPER)
+LCFLAGS += -DHAVE_DEVMAPPER
+endif
+
+ifeq ($(HAVE_GETFSMAP),yes)
+CFILES += fsmap.c
+endif
+
+ifeq ($(HAVE_STATFS_FLAGS),yes)
+LCFLAGS += -DHAVE_STATFS_FLAGS
+endif
+
+default: depend $(LTCOMMAND)
 
 include $(BUILDRULES)
 
 install: default
-       $(INSTALL) -m 755 -d $(PKG_BIN_DIR)
-       $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
-       $(LTINSTALL) -m 755 xfs_bmap.sh $(PKG_BIN_DIR)/xfs_bmap
-       $(LTINSTALL) -m 755 xfs_freeze.sh $(PKG_BIN_DIR)/xfs_freeze
+       $(INSTALL) -m 755 -d $(PKG_SBIN_DIR)
+       $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_SBIN_DIR)
+       $(LTINSTALL) -m 755 xfs_bmap.sh $(PKG_SBIN_DIR)/xfs_bmap
+       $(LTINSTALL) -m 755 xfs_freeze.sh $(PKG_SBIN_DIR)/xfs_freeze
+       $(LTINSTALL) -m 755 xfs_mkfile.sh $(PKG_SBIN_DIR)/xfs_mkfile
 install-dev:
+
+-include .dep