]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blob - libfrog/Makefile
libfrog: move crc32c code out of libxfs
[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
13 CFILES = \
14 avl64.c \
15 convert.c \
16 crc32.c \
17 fsgeom.c \
18 list_sort.c \
19 paths.c \
20 projects.c \
21 ptvar.c \
22 radix-tree.c \
23 topology.c \
24 util.c \
25 workqueue.c
26
27 HFILES = \
28 crc32defs.h \
29 crc32table.h
30
31 LSRCFILES += gen_crc32table.c
32
33 CFILES += $(PKG_PLATFORM).c
34 PCFILES = darwin.c freebsd.c irix.c linux.c
35 LSRCFILES = $(shell echo $(PCFILES) | sed -e "s/$(PKG_PLATFORM).c//g")
36
37 ifeq ($(HAVE_GETMNTENT),yes)
38 LCFLAGS += -DHAVE_GETMNTENT
39 endif
40
41 ifeq ($(HAVE_GETMNTINFO),yes)
42 LCFLAGS += -DHAVE_GETMNTINFO
43 endif
44
45 LDIRT = gen_crc32table crc32table.h crc32selftest
46
47 default: crc32selftest ltdepend $(LTLIBRARY)
48
49 crc32table.h: gen_crc32table.c crc32defs.h
50 @echo " [CC] gen_crc32table"
51 $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -o gen_crc32table $<
52 @echo " [GENERATE] $@"
53 $(Q) ./gen_crc32table > crc32table.h
54
55 # The selftest binary will return an error if it fails. This is made a
56 # dependency of the build process so that we refuse to build the tools on broken
57 # systems/architectures. Hence we make sure that xfsprogs will never use a
58 # busted CRC calculation at build time and hence avoid putting bad CRCs down on
59 # disk.
60 crc32selftest: gen_crc32table.c crc32table.h crc32.c crc32defs.h
61 @echo " [TEST] CRC32"
62 $(Q) $(BUILD_CC) $(BUILD_CFLAGS) -D CRC32_SELFTEST=1 crc32.c -o $@
63 $(Q) ./$@
64
65 include $(BUILDRULES)
66
67 install install-dev: default
68
69 -include .ltdep