Files
OpenCellular/Makefile
Stefan Reinauer b7d2f1efca vboot_reference: clean up CFLAGS and enable unrolled loops
- loop unrolling has a positive effect on execution speed.
- This change also drops the -march=i386 and thus allows
  the compiler to use SSE instructions.
- A few duplicate options are dropped from CFLAGS.
- drop -fno-toplevel-reordering. This sneaked in from
  u-boot where it might be needed by some drivers.

With this change I just successfully booted my Stumpy in 833ms

BUG=chrome-os-partner:4675
TEST=boot tested on stumpy
Change-Id: I805cbcaec48b4f8d1d8fa7d7bed9241178f59a8e
Reviewed-on: https://gerrit.chromium.org/gerrit/11061
Tested-by: Stefan Reinauer <reinauer@chromium.org>
Reviewed-by: Randall Spangler <rspangler@chromium.org>
2011-11-02 13:00:14 -07:00

106 lines
2.5 KiB
Makefile

# Copyright (c) 2010 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
export FIRMWARE_ARCH
export MOCK_TPM
export CC ?= gcc
export CXX ?= g++
export CFLAGS = -Wall -Werror
ifeq (${DEBUG},)
CFLAGS += -O3
else
CFLAGS += -O0 -g
endif
#
# TODO(crosbug.com/16808) We hard-code u-boot's compiler flags here just
# temporarily. As we are still investigating which flags are necessary for
# maintaining a compatible ABI, etc. between u-boot and vboot_reference.
#
# Override CC and CFLAGS for firmware builds; if you have any -D flags, please
# add them after this point (e.g., -DVBOOT_DEBUG).
#
ifeq ($(FIRMWARE_ARCH), arm)
CC = armv7a-cros-linux-gnueabi-gcc
CFLAGS = -g -Os -fno-common -ffixed-r8 -msoft-float -fno-builtin \
-ffreestanding -nostdinc \
-pipe -marm -mabi=aapcs-linux -mno-thumb-interwork -march=armv5 \
-Werror -Wall -Wstrict-prototypes -fno-stack-protector
endif
ifeq ($(FIRMWARE_ARCH), i386)
CC = i686-pc-linux-gnu-gcc
CFLAGS = -g -Os -ffunction-sections -fvisibility=hidden -fno-builtin \
-ffreestanding -nostdinc -pipe -Wstrict-prototypes -mregparm=3 \
-fomit-frame-pointer -fno-stack-protector \
-mpreferred-stack-boundary=2 -fno-dwarf2-cfi-asm -Werror -Wall
endif
# Fix compiling directly on host (outside of emake)
ifeq ($(ARCH),)
export ARCH=amd64
endif
ifeq ($(FIRMWARE_ARCH),)
CFLAGS += -DCHROMEOS_ENVIRONMENT
endif
ifneq (${DEBUG},)
CFLAGS += -DVBOOT_DEBUG
endif
ifeq (${DISABLE_NDEBUG},)
CFLAGS += -DNDEBUG
endif
export TOP = $(shell pwd)
export FWDIR=$(TOP)/firmware
export HOSTDIR=$(TOP)/host
ifeq ($(FIRMWARE_ARCH),)
export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/stub/include
else
export INCLUDES = -I$(FWDIR)/include -I$(FWDIR)/arch/$(FIRMWARE_ARCH)/include
endif
export BUILD = ${TOP}/build
export FWLIB = ${BUILD}/vboot_fw.a
export HOSTLIB = ${BUILD}/vboot_host.a
ifeq ($(FIRMWARE_ARCH),)
SUBDIRS = firmware host utility cgpt tests tests/tpm_lite
else
SUBDIRS = firmware
endif
all:
set -e; \
for d in $(shell find ${SUBDIRS} -name '*.c' -exec dirname {} \; |\
sort -u); do \
newdir=${BUILD}/$$d; \
if [ ! -d $$newdir ]; then \
mkdir -p $$newdir; \
fi; \
done; \
[ -z "$(FIRMWARE_ARCH)" ] && make -C utility update_tlcl_structures; \
for i in $(SUBDIRS); do \
make -C $$i; \
done
clean:
/bin/rm -rf ${BUILD}
install:
$(MAKE) -C utility install
$(MAKE) -C cgpt install
runtests:
$(MAKE) -C tests runtests
rbtest:
$(MAKE) -C tests rbtest
runbmptests:
$(MAKE) -C tests runbmptests