]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libfrog/Makefile
libfrog: move crc32c selftest buffer into a separate file
[thirdparty/xfsprogs-dev.git] / libfrog / Makefile
1 # SPDX-License-Identifier: GPL-2.0
2 # Copyright (c) 2017 Oracle. All Rights Reserved.
3 #
4
5 TOPDIR = ..
6 include $(TOPDIR)/include/builddefs
7
8 LTLIBRARY = libfrog.la
9 LT_CURRENT = 0
10 LT_REVISION = 0
11 LT_AGE = 0
12 # we need a static build even if --disable-static is specified
13 LTLDFLAGS += -static
14
15 CFILES = \
16 avl64.c \
17 bitmap.c \
18 bulkstat.c \
19 convert.c \
20 crc32.c \
21 fsgeom.c \
22 list_sort.c \
23 linux.c \
24 logging.c \
25 paths.c \
26 projects.c \
27 ptvar.c \
28 radix-tree.c \
29 randbytes.c \
30 scrub.c \
31 util.c \
32 workqueue.c
33
34 HFILES = \
35 avl64.h \
36 bulkstat.h \
37 bitmap.h \
38 convert.h \
39 crc32c.h \
40 crc32cselftest.h \
41 crc32defs.h \
42 crc32table.h \
43 fsgeom.h \
44 logging.h \
45 paths.h \
46 projects.h \
47 ptvar.h \
48 radix-tree.h \
49 randbytes.h \
50 scrub.h \
51 workqueue.h
52
53 LSRCFILES += gen_crc32table.c
54
55 ifeq ($(HAVE_GETMNTENT),yes)
56 LCFLAGS += -DHAVE_GETMNTENT
57 endif
58
59 LDIRT = gen_crc32table crc32table.h crc32selftest
60
61 default: crc32selftest ltdepend $(LTLIBRARY)
62
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
68
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
73 # disk.
74 crc32selftest: gen_crc32table.c crc32table.h crc32.c crc32defs.h randbytes.c
75 @echo " [TEST] CRC32"
76 $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 randbytes.c crc32.c -o $@
77 $(Q) ./$@
78
79 include $(BUILDRULES)
80
81 install install-dev: default
82
83 -include .ltdep