File: Makefile.rv

package info (click to toggle)
linux 6.17.9-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,734,892 kB
  • sloc: ansic: 26,684,085; asm: 271,195; sh: 147,401; python: 75,980; makefile: 57,306; perl: 36,943; xml: 19,562; cpp: 5,899; yacc: 4,909; lex: 2,943; awk: 1,556; sed: 29; ruby: 25
file content (51 lines) | stat: -rw-r--r-- 1,584 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# SPDX-License-Identifier: GPL-2.0-only

define allow-override
  $(if $(or $(findstring environment,$(origin $(1))),\
            $(findstring command line,$(origin $(1)))),,\
    $(eval $(1) = $(2)))
endef

# Allow setting CC and AR, or setting CROSS_COMPILE as a prefix.
$(call allow-override,CC,$(CROSS_COMPILE)gcc)
$(call allow-override,AR,$(CROSS_COMPILE)ar)
$(call allow-override,STRIP,$(CROSS_COMPILE)strip)
$(call allow-override,PKG_CONFIG,pkg-config)
$(call allow-override,LD_SO_CONF_PATH,/etc/ld.so.conf.d/)
$(call allow-override,LDCONFIG,ldconfig)
export CC AR STRIP PKG_CONFIG LD_SO_CONF_PATH LDCONFIG

FOPTS		:=-flto=auto -ffat-lto-objects -fexceptions -fstack-protector-strong	\
		-fasynchronous-unwind-tables -fstack-clash-protection
WOPTS		:=	-O -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2	\
		-Wp,-D_GLIBCXX_ASSERTIONS -Wno-maybe-uninitialized

ifeq ($(CC),clang)
  FOPTS		:= $(filter-out -flto=auto -ffat-lto-objects, $(FOPTS))
  WOPTS		:= $(filter-out -Wno-maybe-uninitialized, $(WOPTS))
endif

INCLUDE		:= -Iinclude/
CFLAGS		:= -g -DVERSION=\"$(VERSION)\" $(FOPTS) $(WOPTS) $(EXTRA_CFLAGS) $(INCLUDE)
LDFLAGS		:= -ggdb $(LDFLAGS) $(EXTRA_LDFLAGS)

INSTALL		:= install
MKDIR		:= mkdir
STRIP		:= strip
BINDIR		:= /usr/bin

.PHONY: install
install: doc_install
	$(Q)$(MKDIR) -p $(DESTDIR)$(BINDIR)
	$(call QUIET_INSTALL,rv)$(INSTALL) $(OUTPUT)rv -m 755 $(DESTDIR)$(BINDIR)
	$(Q)@$(STRIP) $(DESTDIR)$(BINDIR)/rv

.PHONY: doc doc_clean doc_install
doc:
	$(MAKE) -C $(DOCSRC)

doc_clean:
	$(MAKE) -C $(DOCSRC) clean

doc_install:
	$(MAKE) -C $(DOCSRC) install