File: Make.defaults

package info (click to toggle)
pesign 0.112-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 928 kB
  • sloc: ansic: 11,693; sh: 606; makefile: 209
file content (78 lines) | stat: -rw-r--r-- 2,251 bytes parent folder | download | duplicates (3)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
prefix	?= /usr/
prefix	:= $(abspath $(prefix))/
libdir	?= $(prefix)lib64/
libdatadir ?= $(prefix)lib/
libexecdir ?= $(prefix)libexec/
datadir	?= $(prefix)share/
mandir	?= $(datadir)man/
includedir ?= $(prefix)include/
bindir	?= $(prefix)bin/
pcdir	?= $(libdir)pkgconfig/
docdir	?= $(prefix)share/doc/
DESTDIR	?=
INSTALLROOT = $(DESTDIR)

INSTALL	?= install
CROSS_COMPILE	?= $(bindir)

PKG_CONFIG = $(CROSS_COMPILE)pkg-config
CC	:= $(if $(filter default,$(origin CC)),$(CROSS_COMPILE)gcc,$(CC))
CCLD	:= $(if $(filter undefined,$(origin CCLD)),$(CC),$(CCLD))
CFLAGS	?= -O0 -g3 -fvar-tracking -fvar-tracking-assignments \
	   -Wall -Werror -Wextra
AS	:= $(CROSS_COMPILE)as
AR	:= $(CROSS_COMPILE)gcc-ar
RANLIB	:= $(CROSS_COMPILE)gcc-ranlib
OBJCOPY	:= $(CROSS_COMPILE)objcopy
LD	:= $(CROSS_COMPILE)ld
INSTALL	:= $(CROSS_COMPILE)install

PKGS	=

HOSTARCH   = $(shell uname -m | sed s,i[3456789]86,ia32,)
ARCH	   := $(shell uname -m | sed s,i[3456789]86,ia32,)

SOFLAGS	= -shared
clang_cflags =
gcc_cflags = -Wmaybe-uninitialized
cflags	= $(CFLAGS) $(ARCH3264) \
	-Wall -Werror -Wno-cpp  -Wsign-compare -Wno-unused-result \
	-Wno-unused-function\
	-std=gnu11 -fshort-wchar -fPIC -flto -fno-strict-aliasing \
	-fno-merge-constants -fkeep-inline-functions \
	-D_GNU_SOURCE -DCONFIG_$(ARCH) -I${TOPDIR}/include \
	$(if $(filter $(CC),clang),$(clang_cflags), ) \
	$(if $(filter $(CC),gcc),$(gcc_cflags), ) \
	$(call pkg-config-cflags) -Werror
clang_ccldflags =
gcc_ccldflags = -fno-merge-constants \
	-Wl,--fatal-warnings,--no-allow-shlib-undefined,--default-symver \
	-Wl,-O2 -Wl,--no-undefined-version -Wl,-z,relro,-z,now \
	--Wl,--no-add-needed,--no-copy-dt-needed-entries,--as-needed
ccldflags = $(cflags) $(CCLDFLAGS) $(LDFLAGS) \
	$(if $(filter $(CCLD),clang),$(clang_ccldflags),) \
	$(if $(filter $(CCLD),gcc),$(gcc_ccldflags),) \
	$(call pkg-config-ccldflags)
efi_cflags = $(cflags)
ASFLAGS	= $(ARCH3264)
CPPFLAGS ?=

LDLIBS	= $(foreach lib,$(LIBS),-l$(lib)) $(call pkg-config-ldlibs)

ifeq ($(ARCH),ia64)
  efi_cflags += -mfixed-range=f32-f127
endif

ifeq ($(ARCH), ia32)
  ifeq ($(HOSTARCH), x86_64)
    ARCH3264 := -m32
  endif
endif

ifeq ($(ARCH), x86_64)
  efi_cflags += -mno-red-zone
  ifeq ($(HOSTARCH), ia32)
    ARCH3264 := -m64
  endif
endif