xref: /illumos-gate/usr/src/boot/sys/boot/Makefile.inc (revision ff5d4039)
19890ff83SToomas Soome#
29890ff83SToomas Soome# This file and its contents are supplied under the terms of the
39890ff83SToomas Soome# Common Development and Distribution License ("CDDL"), version 1.0.
49890ff83SToomas Soome# You may only use this file in accordance with the terms of version
59890ff83SToomas Soome# 1.0 of the CDDL.
69890ff83SToomas Soome#
79890ff83SToomas Soome# A full copy of the text of the CDDL should have accompanied this
89890ff83SToomas Soome# source.  A copy of the CDDL is also available via the Internet at
99890ff83SToomas Soome# http://www.illumos.org/license/CDDL.
109890ff83SToomas Soome#
11199767f8SToomas Soome
129890ff83SToomas Soome#
139890ff83SToomas Soome# Copyright 2017 Toomas Soome <tsoome@me.com>
14efe51d0cSJohn Levon# Copyright 2019 Joyent, Inc.
15f52943a9SAndy Fiddaman# Copyright 2019 OmniOS Community Edition (OmniOSce) Association.
169890ff83SToomas Soome#
17199767f8SToomas Soome
1886fec011SToomas Soome# loader.help build needs better awk
1986fec011SToomas SoomeAWK=		/usr/xpg4/bin/awk
2086fec011SToomas SoomeLD=		$(GNU_ROOT)/bin/gld
2186fec011SToomas SoomeOBJCOPY=	$(GNU_ROOT)/bin/gobjcopy
2286fec011SToomas SoomeOBJDUMP=	$(GNU_ROOT)/bin/gobjdump
2386fec011SToomas SoomeGSTRIP=		$(GNU_ROOT)/bin/gstrip
2486fec011SToomas Soome
25f52943a9SAndy FiddamanGLDTARGET=	-melf_i386_sol2
26f52943a9SAndy FiddamanLDFLAGS	+=	$(GLDTARGET)
27f52943a9SAndy Fiddaman
289890ff83SToomas Soome# Default Console font setup.
299890ff83SToomas Soome# We want it to be the same as kernel.
309890ff83SToomas Soome# We build compressed, stripped down version of the default font, so we have
319890ff83SToomas Soome# bare minimum for case we can not load font from the OS root.
329890ff83SToomas Soome
339890ff83SToomas SoomeFONT=		8x16
34e0721d5aSToomas SoomeFONT_SRC=	ter-u16b.bdf
359890ff83SToomas SoomeFONT_DIR=	$(SRC)/data/consfonts
369890ff83SToomas Soome
3786fec011SToomas SoomePNGLITE=	$(SRC)/common/pnglite
3886fec011SToomas Soome
3986fec011SToomas SoomeBOOTSRC=	$(SRC)/boot/sys/boot
4086fec011SToomas SoomeLIBSRC=		$(SRC)/boot/lib
4186fec011SToomas SoomeSASRC=		$(LIBSRC)/libstand
42411d06f4SToomas SoomeCRYPTOSRC=	$(SASRC)/crypto
4386fec011SToomas SoomeZFSSRC=		$(SASRC)/zfs
44172f4465SToomas SoomeZLIB=		$(SRC)/contrib/zlib
4510ae99eeSToomas SoomeLZ4=		$(SRC)/common/lz4
4686fec011SToomas Soome
4786fec011SToomas Soome# set standard values
4886fec011SToomas SoomeAS_CPPFLAGS=
4986fec011SToomas SoomeCPPFLAGS=	-D_STANDALONE -_gcc=-nostdinc
5086fec011SToomas SoomeCFLAGS64=	-_gcc=-mno-red-zone
5186fec011SToomas Soome
52*ff5d4039SToomas SoomeCFLAGS=		-_gcc=-Os -_gcc=-ffreestanding -_gcc=-fno-builtin
53e6b6ca04SToomas SoomeCFLAGS +=	-_gcc=-ffunction-sections -_gcc=-fdata-sections
5486fec011SToomas SoomeCFLAGS +=	-_gcc=-mno-mmx -_gcc=-mno-3dnow -_gcc=-mno-sse -_gcc=-mno-sse2
5586fec011SToomas SoomeCFLAGS +=	-_gcc=-mno-sse3 -_gcc=-msoft-float
5686fec011SToomas SoomeCFLAGS +=	-_gcc=-mno-avx -_gcc=-mno-aes
5786fec011SToomas SoomeCFLAGS +=	-_gcc=-Wall
5886fec011SToomas SoomeCFLAGS +=	$(CCNOAUTOINLINE) $(CCNOREORDER) $(CSTD_GNU99)
59*ff5d4039SToomas SoomeCCASFLAGS=	-Wa,--divide
6086fec011SToomas SoomeASFLAGS=	--divide
6186fec011SToomas Soome
62efe51d0cSJohn LevonSMATCH_ =
63efe51d0cSJohn LevonSMATCH_on =
64efe51d0cSJohn LevonSMATCH_off = -_smatch=off
65efe51d0cSJohn Levon
66916d72b8SToomas Soome# SMATCH_ARGS will bring in set of -Wno-* options.
67*ff5d4039SToomas SoomeSMATCH_ARGS =	--timeout=0
68*ff5d4039SToomas SoomeCFLAGS +=	$(SMATCH_ARGS:%=-_smatch=%)
69916d72b8SToomas SoomeCFLAGS +=	$(SMOFF:%=-_smatch=--disable=%)
70916d72b8SToomas SoomeCFLAGS +=	$(SMATCH_$(MACHINE))
71efe51d0cSJohn LevonCFLAGS +=	$(SMATCH_$(SMATCH))
72916d72b8SToomas Soome
73a08b1366SToomas SoomeCOMPILE.S=	$(CC) $(SMATCH_off) $(CCASFLAGS) $(CPPFLAGS) -c
7486fec011SToomas Soome
7586fec011SToomas SoomeROOT_BOOT=	$(ROOT)/boot
7686fec011SToomas SoomeROOTBOOTPROG=$(PROG:%=$(ROOT_BOOT)/%)
7786fec011SToomas Soome
7886fec011SToomas Soome$(ROOT_BOOT)/%: %
7986fec011SToomas Soome	$(INS.file)
8086fec011SToomas Soome
819890ff83SToomas Soome#.if ${MACHINE_CPUARCH} == "arm"
82199767f8SToomas Soome# Do not generate movt/movw, because the relocation fixup for them does not
83199767f8SToomas Soome# translate to the -Bsymbolic -pie format required by self_reloc() in loader(8).
84199767f8SToomas Soome# Also, the fpu is not available in a standalone environment.
859890ff83SToomas Soome#CFLAGS.clang+=  -mllvm -arm-use-movt=0
869890ff83SToomas Soome#CFLAGS.clang+=  -mfpu=none
879890ff83SToomas Soome#.endif
88