1 # SPDX-License-Identifier: GPL-2.0-only 2 3 define allow-override 4 $(if $(or $(findstring environment,$(origin 5 $(findstring command line,$(origin 6 $(eval $(1) = $(2))) 7 endef 8 9 # Allow setting CC and AR, or setting CROSS_CO 10 $(call allow-override,CC,$(CROSS_COMPILE)gcc) 11 $(call allow-override,AR,$(CROSS_COMPILE)ar) 12 $(call allow-override,STRIP,$(CROSS_COMPILE)st 13 $(call allow-override,PKG_CONFIG,pkg-config) 14 $(call allow-override,LD_SO_CONF_PATH,/etc/ld. 15 $(call allow-override,LDCONFIG,ldconfig) 16 export CC AR STRIP PKG_CONFIG LD_SO_CONF_PATH 17 18 FOPTS :=-flto=auto -ffat-lto-objects 19 -fasynchronous-unwind-tables - 20 WOPTS := -O -Wall -Werror=forma 21 -Wp,-D_GLIBCXX_ASSERTIONS -Wno 22 23 ifeq ($(CC),clang) 24 FOPTS := $(filter-out -flto=auto -ff 25 WOPTS := $(filter-out -Wno-maybe-uni 26 endif 27 28 INCLUDE := -Iinclude/ 29 CFLAGS := -g -DVERSION=\"$(VERSION)\" 30 LDFLAGS := -ggdb $(EXTRA_LDFLAGS) 31 32 INSTALL := install 33 MKDIR := mkdir 34 STRIP := strip 35 BINDIR := /usr/bin 36 37 .PHONY: install 38 install: doc_install 39 $(Q)$(MKDIR) -p $(DESTDIR)$(BINDIR) 40 $(call QUIET_INSTALL,rv)$(INSTALL) $(O 41 $(Q)@$(STRIP) $(DESTDIR)$(BINDIR)/rv 42 43 .PHONY: doc doc_clean doc_install 44 doc: 45 $(MAKE) -C $(DOCSRC) 46 47 doc_clean: 48 $(MAKE) -C $(DOCSRC) clean 49 50 doc_install: 51 $(MAKE) -C $(DOCSRC) install
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.