blob: e3d717c7bfa1f6f5a0d4c0725aef0b8749a55dcd [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001# SPDX-License-Identifier: GPL-2.0
2#
3# Makefile for some libs needed by zImage.
4#
5
6zlib := inffast.c inflate.c inftrees.c
7
8lib-y += $(zlib:.c=.o) zmem.o
9
David Brazdil0f672f62019-12-10 10:32:29 +000010ccflags-y := -I $(srctree)/lib/zlib_inflate
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000011ifdef CONFIG_FUNCTION_TRACER
12CFLAGS_REMOVE_inflate.o = -pg
13CFLAGS_REMOVE_zmem.o = -pg
14CFLAGS_REMOVE_inftrees.o = -pg
15CFLAGS_REMOVE_inffast.o = -pg
16endif
17
18KASAN_SANITIZE := n
19
20CFLAGS_REMOVE_inflate.o += -fstack-protector -fstack-protector-strong
21CFLAGS_REMOVE_zmem.o += -fstack-protector -fstack-protector-strong
22CFLAGS_REMOVE_inftrees.o += -fstack-protector -fstack-protector-strong
23CFLAGS_REMOVE_inffast.o += -fstack-protector -fstack-protector-strong
24
25quiet_cmd_copy_zlib = COPY $@
26 cmd_copy_zlib = cat $< > $@
27
28$(addprefix $(obj)/,$(zlib)): $(obj)/%: $(srctree)/lib/zlib_inflate/%
29 $(call cmd,copy_zlib)
30
31clean-files := $(zlib)