xref: /linux/lib/crc/Makefile (revision 89a51591405e09a862b9ca1ccfa880986c495c3c)
1*89a51591SEric Biggers# SPDX-License-Identifier: GPL-2.0-only
2*89a51591SEric Biggers
3*89a51591SEric Biggers# Makefile for the kernel's cyclic redundancy check (CRC) library code
4*89a51591SEric Biggers
5*89a51591SEric Biggersobj-$(CONFIG_CRC4) += crc4.o
6*89a51591SEric Biggersobj-$(CONFIG_CRC7) += crc7.o
7*89a51591SEric Biggersobj-$(CONFIG_CRC8) += crc8.o
8*89a51591SEric Biggersobj-$(CONFIG_CRC16) += crc16.o
9*89a51591SEric Biggersobj-$(CONFIG_CRC_CCITT) += crc-ccitt.o
10*89a51591SEric Biggersobj-$(CONFIG_CRC_ITU_T) += crc-itu-t.o
11*89a51591SEric Biggersobj-$(CONFIG_CRC_T10DIF) += crc-t10dif.o
12*89a51591SEric Biggersobj-$(CONFIG_CRC32) += crc32.o
13*89a51591SEric Biggersobj-$(CONFIG_CRC64) += crc64.o
14*89a51591SEric Biggersobj-y += tests/
15*89a51591SEric Biggers
16*89a51591SEric Biggershostprogs := gen_crc32table gen_crc64table
17*89a51591SEric Biggersclean-files := crc32table.h crc64table.h
18*89a51591SEric Biggers
19*89a51591SEric Biggers$(obj)/crc32.o: $(obj)/crc32table.h
20*89a51591SEric Biggers$(obj)/crc64.o: $(obj)/crc64table.h
21*89a51591SEric Biggers
22*89a51591SEric Biggersquiet_cmd_crc32 = GEN     $@
23*89a51591SEric Biggers      cmd_crc32 = $< > $@
24*89a51591SEric Biggers
25*89a51591SEric Biggersquiet_cmd_crc64 = GEN     $@
26*89a51591SEric Biggers      cmd_crc64 = $< > $@
27*89a51591SEric Biggers
28*89a51591SEric Biggers$(obj)/crc32table.h: $(obj)/gen_crc32table
29*89a51591SEric Biggers	$(call cmd,crc32)
30*89a51591SEric Biggers
31*89a51591SEric Biggers$(obj)/crc64table.h: $(obj)/gen_crc64table
32*89a51591SEric Biggers	$(call cmd,crc64)
33