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 \
101 LSRCFILES
+= gen_crc32table.c
105 # -DIO_DEBUG reads and writes of buffers
106 # -DMEM_DEBUG all zone memory use
107 # -DLI_DEBUG log item (ino/buf) manipulation
108 # -DXACT_DEBUG transaction state changes
114 LTLIBS
= $(LIBPTHREAD
) $(LIBRT
)
116 # don't try linking xfs_repair with a debug libxfs.
119 LDIRT
= gen_crc32table crc32table.h crc32selftest
121 default
: crc32selftest ltdepend
$(LTLIBRARY
)
123 crc32table.h
: gen_crc32table.c crc32defs.h
124 @echo
" [CC] gen_crc32table"
125 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -o gen_crc32table
$<
126 @echo
" [GENERATE] $@"
127 $(Q
) .
/gen_crc32table
> crc32table.h
129 # The selftest binary will return an error if it fails. This is made a
130 # dependency of the build process so that we refuse to build the tools on broken
131 # systems/architectures. Hence we make sure that xfsprogs will never use a
132 # busted CRC calculation at build time and hence avoid putting bad CRCs down on
134 crc32selftest
: gen_crc32table.c crc32table.h crc32.c crc32defs.h
135 @echo
" [TEST] CRC32"
136 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -D CRC32_SELFTEST
=1 crc32.c
-o
$@
139 # set up include/xfs header directory
140 include $(BUILDRULES
)
143 $(INSTALL
) -m
755 -d
$(PKG_INC_DIR
)
145 install-headers
: $(addsuffix -hdrs
, $(PKGHFILES
))
148 $(Q
)$(LN_S
) -f
$(CURDIR
)/$* $(TOPDIR
)/include/xfs
/$*
151 $(INSTALL
) -m
644 $(PKGHFILES
) $(PKG_INC_DIR
)
153 # We need to install the headers before building the dependencies. If we
154 # include the .ltdep file, the makefile decides that it needs to build the
155 # dependencies to remake the makefile before running the header install target,
156 # hence making it impossible to avoid errors being thrown by the dependency
157 # generation. Hence we play games so that we only include this file if we aren't
158 # running the install-headers target.