1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2000-2006 Silicon Graphics, Inc. All Rights Reserved.
6 include $(TOPDIR
)/include/builddefs
13 # headers to install in include/xfs
14 PKGHFILES
= xfs_fs.h \
41 xfs_refcount_btree.h \
93 xfs_refcount_btree.c \
98 xfs_symlink_remote.c \
102 LSRCFILES
+= gen_crc32table.c
106 # -DIO_DEBUG reads and writes of buffers
107 # -DMEM_DEBUG all zone memory use
108 # -DLI_DEBUG log item (ino/buf) manipulation
109 # -DXACT_DEBUG transaction state changes
115 LTLIBS
= $(LIBPTHREAD
) $(LIBRT
)
117 # don't try linking xfs_repair with a debug libxfs.
120 LDIRT
= gen_crc32table crc32table.h crc32selftest
122 default
: crc32selftest ltdepend
$(LTLIBRARY
)
124 crc32table.h
: gen_crc32table.c crc32defs.h
125 @echo
" [CC] gen_crc32table"
126 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -o gen_crc32table
$<
127 @echo
" [GENERATE] $@"
128 $(Q
) .
/gen_crc32table
> crc32table.h
130 # The selftest binary will return an error if it fails. This is made a
131 # dependency of the build process so that we refuse to build the tools on broken
132 # systems/architectures. Hence we make sure that xfsprogs will never use a
133 # busted CRC calculation at build time and hence avoid putting bad CRCs down on
135 crc32selftest
: gen_crc32table.c crc32table.h crc32.c crc32defs.h
136 @echo
" [TEST] CRC32"
137 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -D CRC32_SELFTEST
=1 crc32.c
-o
$@
140 # set up include/xfs header directory
141 include $(BUILDRULES
)
144 $(INSTALL
) -m
755 -d
$(PKG_INC_DIR
)
146 install-headers
: $(addsuffix -hdrs
, $(PKGHFILES
))
149 $(Q
)$(LN_S
) -f
$(CURDIR
)/$* $(TOPDIR
)/include/xfs
/$*
152 $(INSTALL
) -m
644 $(PKGHFILES
) $(PKG_INC_DIR
)
154 # We need to install the headers before building the dependencies. If we
155 # include the .ltdep file, the makefile decides that it needs to build the
156 # dependencies to remake the makefile before running the header install target,
157 # hence making it impossible to avoid errors being thrown by the dependency
158 # generation. Hence we play games so that we only include this file if we aren't
159 # running the install-headers target.