xref: /illumos-gate/usr/src/boot/sys/boot/Makefile.inc (revision 411d06f4)
1#
2# This file and its contents are supplied under the terms of the
3# Common Development and Distribution License ("CDDL"), version 1.0.
4# You may only use this file in accordance with the terms of version
5# 1.0 of the CDDL.
6#
7# A full copy of the text of the CDDL should have accompanied this
8# source.  A copy of the CDDL is also available via the Internet at
9# http://www.illumos.org/license/CDDL.
10#
11
12#
13# Copyright 2017 Toomas Soome <tsoome@me.com>
14# Copyright 2019 Joyent, Inc.
15# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
16#
17
18# loader.help build needs better awk
19AWK=		/usr/xpg4/bin/awk
20LD=		$(GNU_ROOT)/bin/gld
21OBJCOPY=	$(GNU_ROOT)/bin/gobjcopy
22OBJDUMP=	$(GNU_ROOT)/bin/gobjdump
23GSTRIP=		$(GNU_ROOT)/bin/gstrip
24
25GLDTARGET=	-melf_i386_sol2
26LDFLAGS	+=	$(GLDTARGET)
27
28# Default Console font setup.
29# We want it to be the same as kernel.
30# We build compressed, stripped down version of the default font, so we have
31# bare minimum for case we can not load font from the OS root.
32
33FONT=		8x16
34FONT_SRC=	ter-u16b.bdf
35FONT_DIR=	$(SRC)/data/consfonts
36
37PNGLITE=	$(SRC)/common/pnglite
38
39BOOTSRC=	$(SRC)/boot/sys/boot
40LIBSRC=		$(SRC)/boot/lib
41SASRC=		$(LIBSRC)/libstand
42CRYPTOSRC=	$(SASRC)/crypto
43ZFSSRC=		$(SASRC)/zfs
44ZLIB=		$(SRC)/contrib/zlib
45LZ4=		$(SRC)/common/lz4
46
47# set standard values
48AS_CPPFLAGS=
49CPPFLAGS=	-D_STANDALONE -_gcc=-nostdinc
50CFLAGS64=	-_gcc=-mno-red-zone
51
52CFLAGS=		-_gcc=-Os -_gcc=-fPIC -_gcc=-ffreestanding -_gcc=-fno-builtin
53CFLAGS +=	-_gcc=-ffunction-sections -_gcc=-fdata-sections
54CFLAGS +=	-_gcc=-mno-mmx -_gcc=-mno-3dnow -_gcc=-mno-sse -_gcc=-mno-sse2
55CFLAGS +=	-_gcc=-mno-sse3 -_gcc=-msoft-float
56CFLAGS +=	-_gcc=-mno-avx -_gcc=-mno-aes
57CFLAGS +=	-_gcc=-Wall
58CFLAGS +=	$(CCNOAUTOINLINE) $(CCNOREORDER) $(CSTD_GNU99)
59CCASFLAGS=	-fPIC -Wa,--divide
60ASFLAGS=	--divide
61
62SMATCH_ =
63SMATCH_on =
64SMATCH_off = -_smatch=off
65
66# SMATCH_ARGS will bring in set of -Wno-* options.
67#CFLAGS +=	$(SMATCH_ARGS:%=-_smatch=%)
68CFLAGS +=	$(SMOFF:%=-_smatch=--disable=%)
69CFLAGS +=	$(SMATCH_$(MACHINE))
70CFLAGS +=	$(SMATCH_$(SMATCH))
71CFLAGS +=	-_smatch=--timeout=0
72
73COMPILE.S=	$(CC) $(SMATCH_off) $(CCASFLAGS) $(CPPFLAGS) -c
74
75ROOT_BOOT=	$(ROOT)/boot
76ROOTBOOTPROG=$(PROG:%=$(ROOT_BOOT)/%)
77
78$(ROOT_BOOT)/%: %
79	$(INS.file)
80
81#.if ${MACHINE_CPUARCH} == "arm"
82# Do not generate movt/movw, because the relocation fixup for them does not
83# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
84# Also, the fpu is not available in a standalone environment.
85#CFLAGS.clang+=  -mllvm -arm-use-movt=0
86#CFLAGS.clang+=  -mfpu=none
87#.endif
88