mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-28 02:35:28 +00:00
This allows it to compile without switching to a private libgcc.
BUG=chromium-os:30807
TEST=While making sure u-boot, vboot_reference and
vboot_reference-firmware were cros_workoned and grabbing
the associated U-Boot change (I3cdc86ee2846814a6522c7874e5b438be94164ab),
I did:
1. emerge-daisy chromeos-u-boot vboot_reference vboot_reference-firmware
2. cros_bundle_firmware --add-config-int load_env 1 \
-d exynos5250-daisy -b daisy -o /tmp/uboot.bin
3. sudo dd if=/tmp/uboot.bin of=${SDCARD} bs=512 seek=1
...and then booted that.
Change-Id: I49d567e51d95c77f0e0fef8ec0f678e51b5ab77f
Reviewed-on: https://gerrit.chromium.org/gerrit/22479
Tested-by: Doug Anderson <dianders@chromium.org>
Reviewed-by: Terry Lambert <tlambert@chromium.org>
Tested-by: Terry Lambert <tlambert@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Commit-Ready: Doug Anderson <dianders@chromium.org>
138 lines
3.4 KiB
Makefile
138 lines
3.4 KiB
Makefile
# Copyright (c) 2012 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
|
|
|
|
# This Makefile normally builds in a 'build' subdir, but use
|
|
#
|
|
# make BUILD=<dir>
|
|
#
|
|
# to put the output somewhere else
|
|
|
|
#
|
|
# Provide default CC and CFLAGS for firmware builds; if you have any -D flags,
|
|
# please add them after this point (e.g., -DVBOOT_DEBUG).
|
|
#
|
|
# 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.
|
|
#
|
|
# As a first step, this makes the setting of CC and CFLAGS here optional, to
|
|
# permit a calling script or Makefile to set these.
|
|
#
|
|
# Flag ordering: arch, then -f, then -m, then -W
|
|
DEBUG_FLAGS := $(if ${DEBUG},-g -O0,-Os)
|
|
COMMON_FLAGS := -nostdinc -pipe \
|
|
-ffreestanding -fno-builtin -fno-stack-protector \
|
|
-Werror -Wall -Wstrict-prototypes $(DEBUG_FLAGS)
|
|
|
|
ifeq ($(FIRMWARE_ARCH), arm)
|
|
CC ?= armv7a-cros-linux-gnueabi-gcc
|
|
CFLAGS ?= -march=armv5 \
|
|
-fno-common -ffixed-r8 \
|
|
-mfloat-abi=hard -marm -mabi=aapcs-linux -mno-thumb-interwork \
|
|
$(COMMON_FLAGS)
|
|
endif
|
|
ifeq ($(FIRMWARE_ARCH), i386)
|
|
CC ?= i686-pc-linux-gnu-gcc
|
|
# Drop -march=i386 to permit use of SSE instructions
|
|
CFLAGS ?= \
|
|
-ffunction-sections -fvisibility=hidden -fno-strict-aliasing \
|
|
-fomit-frame-pointer -fno-toplevel-reorder -fno-dwarf2-cfi-asm \
|
|
-mpreferred-stack-boundary=2 -mregparm=3 \
|
|
$(COMMON_FLAGS)
|
|
endif
|
|
ifeq ($(FIRMWARE_ARCH), x86_64)
|
|
CFLAGS ?= $(COMMON_FLAGS) \
|
|
-fvisibility=hidden -fno-strict-aliasing -fomit-frame-pointer
|
|
endif
|
|
|
|
CC ?= gcc
|
|
CXX ?= g++
|
|
|
|
# Fix compiling directly on host (outside of emake)
|
|
ifeq ($(ARCH),)
|
|
export ARCH=amd64
|
|
endif
|
|
|
|
ifeq ($(FIRMWARE_ARCH),)
|
|
CFLAGS += -DCHROMEOS_ENVIRONMENT -Wall -Werror
|
|
endif
|
|
|
|
ifneq (${DEBUG},)
|
|
CFLAGS += -DVBOOT_DEBUG
|
|
endif
|
|
|
|
ifeq (${DISABLE_NDEBUG},)
|
|
CFLAGS += -DNDEBUG
|
|
endif
|
|
|
|
export CC CXX CFLAGS
|
|
|
|
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
|
|
export DUMPKERNELCONFIGLIB = ${BUILD}/libdump_kernel_config.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
|
|
|
|
libcgpt_cc:
|
|
mkdir -p ${BUILD}/cgpt ${BUILD}/firmware/lib/cgptlib ${BUILD}/firmware/stub
|
|
$(MAKE) -C cgpt libcgpt_cc
|
|
|
|
cgptmanager_tests: libcgpt_cc
|
|
mkdir -p ${BUILD}/tests
|
|
$(MAKE) -C tests cgptmanager_tests
|
|
|
|
libdump_kernel_config:
|
|
mkdir -p ${BUILD}/utility
|
|
$(MAKE) -C utility $(DUMPKERNELCONFIGLIB)
|
|
|
|
clean:
|
|
/bin/rm -rf ${BUILD}
|
|
|
|
install:
|
|
$(MAKE) -C utility install
|
|
$(MAKE) -C cgpt install
|
|
|
|
runtests:
|
|
$(MAKE) -C tests runtests
|
|
|
|
runcgptmanagertests:
|
|
$(MAKE) -C tests runcgptmanagertests
|
|
|
|
rbtest:
|
|
$(MAKE) -C tests rbtest
|
|
|
|
runbmptests:
|
|
$(MAKE) -C tests runbmptests
|