|
root / base / usr / src / boot / Makefile.inc
Makefile.inc PHP 81 lines 2.6 KB
 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
79
80
#
# This file and its contents are supplied under the terms of the
# Common Development and Distribution License ("CDDL"), version 1.0.
# You may only use this file in accordance with the terms of version
# 1.0 of the CDDL.
#
# A full copy of the text of the CDDL should have accompanied this
# source.  A copy of the CDDL is also available via the Internet at
# http://www.illumos.org/license/CDDL.
#

#
# Copyright 2017 Toomas Soome <tsoome@me.com>
# Copyright 2019 Joyent, Inc.
# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
#

# loader.help build needs better awk
AWK=		/usr/xpg4/bin/awk
# Hammerhead: auto-detect GNU binutils paths.
# OI has g-prefixed tools (gld, gobjcopy); Hammerhead has unprefixed (gnu-ld, objcopy).
GLD=		$(shell test -x $(GNU_ROOT)/bin/gld && echo $(GNU_ROOT)/bin/gld || echo /usr/bin/gnu-ld)
OBJCOPY=	$(shell test -x $(GNU_ROOT)/bin/gobjcopy && echo $(GNU_ROOT)/bin/gobjcopy || echo /usr/bin/objcopy)
OBJDUMP=	$(shell test -x $(GNU_ROOT)/bin/gobjdump && echo $(GNU_ROOT)/bin/gobjdump || echo /usr/bin/objdump)
GSTRIP=		$(shell test -x $(GNU_ROOT)/bin/gstrip && echo $(GNU_ROOT)/bin/gstrip || echo /usr/bin/strip)

# Default Console font setup.
# We want it to be the same as kernel.
# We build compressed, stripped down version of the default font, so we have
# bare minimum for case we can not load font from the OS root.

FONT=		8x16
FONT_SRC=	ter-u16b.bdf
FONT_DIR=	$(SRC)/data/consfonts

PNGLITE=	$(SRC)/common/pnglite

BOOTSRC=	$(SRC)/boot
SASRC=		$(BOOTSRC)/libsa
CRYPTOSRC=	$(SASRC)/crypto
ZFSSRC=		$(SASRC)/zfs
ZLIB=		$(SRC)/contrib/zlib
LZ4=		$(SRC)/common/lz4

# set standard values
AS_CPPFLAGS=
CPPFLAGS=	-D_STANDALONE -DFICL_WANT_FLOAT=0 -nostdinc
CFLAGS64=	-mno-red-zone

CFLAGS=		-Os -ffreestanding -fno-builtin
CFLAGS +=	-ffunction-sections -fdata-sections
CFLAGS +=	-mno-mmx -mno-3dnow -mno-sse -mno-sse2
CFLAGS +=	-mno-sse3 -msoft-float
CFLAGS +=	-mno-avx -mno-aes
CFLAGS +=	-Wall -Werror
CFLAGS +=	$(CCNOAUTOINLINE) $(CCNOREORDER) $(CSTD_GNU99)
CFLAGS +=	$(CSOURCEDEBUGFLAGS)
CCASFLAGS=	-Wa,--divide
ASFLAGS=	-Wa,--divide
ASFLAGS64=	-Wa,--divide

SMATCH_ =
SMATCH_on =
SMATCH_off =

COMPILE.S=	$(CC) $(SMATCH_off) $(CCASFLAGS) $(CPPFLAGS) -c

ROOT_BOOT=	$(ROOT)/boot
ROOTBOOTPROG=$(PROG:%=$(ROOT_BOOT)/%)

$(ROOT_BOOT)/%: %
	$(INS.file)

#.if ${MACHINE_CPUARCH} == "arm"
# Do not generate movt/movw, because the relocation fixup for them does not
# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
# Also, the fpu is not available in a standalone environment.
#CFLAGS.clang+=  -mllvm -arm-use-movt=0
#CFLAGS.clang+=  -mfpu=none
#.endif