1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2017 Oracle. All Rights Reserved.
6 include $(TOPDIR
)/include/builddefs
12 # we need a static build even if --disable-static is specified
53 LSRCFILES
+= gen_crc32table.c
55 ifeq ($(HAVE_GETMNTENT
),yes
)
56 LCFLAGS
+= -DHAVE_GETMNTENT
59 LDIRT
= gen_crc32table crc32table.h crc32selftest
61 default
: crc32selftest ltdepend
$(LTLIBRARY
)
63 crc32table.h
: gen_crc32table.c crc32defs.h
64 @echo
" [CC] gen_crc32table"
65 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -o gen_crc32table
$<
66 @echo
" [GENERATE] $@"
67 $(Q
) .
/gen_crc32table
> crc32table.h
69 # The selftest binary will return an error if it fails. This is made a
70 # dependency of the build process so that we refuse to build the tools on broken
71 # systems/architectures. Hence we make sure that xfsprogs will never use a
72 # busted CRC calculation at build time and hence avoid putting bad CRCs down on
74 crc32selftest
: gen_crc32table.c crc32table.h crc32.c crc32defs.h randbytes.c
76 $(Q
) $(BUILD_CC
) $(BUILD_CFLAGS
) -D CRC32_SELFTEST
=1 randbytes.c crc32.c
-o
$@
81 install install-dev
: default