1 # SPDX-License-Identifier: GPL-2.0-only
4 $(if $(or $(findstring environment,$(origin $(1))),\
5 $(findstring command line,$(origin $(1)))),,\
9 # Allow setting CC and AR, or setting CROSS_COMPILE as a prefix.
10 $(call allow-override,CC,$(CROSS_COMPILE)gcc)
11 $(call allow-override,AR,$(CROSS_COMPILE)ar)
12 $(call allow-override,STRIP,$(CROSS_COMPILE)strip)
13 $(call allow-override,PKG_CONFIG,pkg-config)
14 $(call allow-override,LD_SO_CONF_PATH,/etc/ld.so.conf.d/)
15 $(call allow-override,LDCONFIG,ldconfig)
16 export CC AR STRIP PKG_CONFIG LD_SO_CONF_PATH LDCONFIG
18 FOPTS :=-flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong \
19 -fasynchronous-unwind-tables -fstack-clash-protection
20 WOPTS := -O -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 \
21 -Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized
24 FOPTS := $(filter-out -flto=auto -ffat-lto-objects, $(FOPTS))
25 WOPTS := $(filter-out -Wno-maybe-uninitialized, $(WOPTS))
29 CFLAGS := -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(WOPTS) $(EXTRA_CFLAGS) $(INCLUDE)
30 LDFLAGS := -ggdb $(EXTRA_LDFLAGS)
39 $(Q)$(MKDIR) -p $(DESTDIR)$(BINDIR)
40 $(call QUIET_INSTALL,rv)$(INSTALL) $(OUTPUT)rv -m 755 $(DESTDIR)$(BINDIR)
41 $(Q)@$(STRIP) $(DESTDIR)$(BINDIR)/rv
43 .PHONY: doc doc_clean doc_install
48 $(MAKE) -C $(DOCSRC) clean
51 $(MAKE) -C $(DOCSRC) install