blob: 5e7077bfe75da80ecc3f0ee901a8e963c7843789 [file] [log] [blame]
Tom Rini83d290c2018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Simon Glass4b0730d2011-09-26 14:10:39 +00002# Copyright (c) 2011 The Chromium OS Authors.
Simon Glass4b0730d2011-09-26 14:10:39 +00003
Masahiro Yamada90f984e2014-07-30 14:08:23 +09004PLATFORM_CPPFLAGS += -D__SANDBOX__ -U_FORTIFY_SOURCE
Masahiro Yamada0a9e7ee2015-03-19 19:42:52 +09005PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM
Matthias Weisserd99a6872011-11-29 12:16:40 +01006PLATFORM_LIBS += -lrt
Simon Glassa733b062013-04-26 02:53:43 +00007
Alexander Graf7e21fbc2018-06-12 07:48:37 +02008LDFLAGS_FINAL += --gc-sections
9PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
10
Simon Glasse50ab222015-02-10 18:52:35 -070011# Define this to avoid linking with SDL, which requires SDL libraries
12# This can solve 'sdl-config: Command not found' errors
13ifneq ($(NO_SDL),)
14PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL
15else
Simon Glassbbc09bf2014-02-27 13:26:17 -070016ifdef CONFIG_SANDBOX_SDL
17PLATFORM_LIBS += $(shell sdl-config --libs)
18PLATFORM_CPPFLAGS += $(shell sdl-config --cflags)
19endif
Simon Glasse50ab222015-02-10 18:52:35 -070020endif
Simon Glassbbc09bf2014-02-27 13:26:17 -070021
Tom Rini699946a2016-03-05 14:07:44 -050022cmd_u-boot__ = $(CC) -o $@ -Wl,-T u-boot.lds \
Masahiro Yamadaad0fed42014-02-24 11:12:18 +090023 -Wl,--start-group $(u-boot-main) -Wl,--end-group \
24 $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map
Simon Glass714a5622014-02-26 15:59:14 -070025
Simon Glass4cfc4162016-07-04 11:57:46 -060026cmd_u-boot-spl = (cd $(obj) && $(CC) -o $(SPL_BIN) -Wl,-T u-boot-spl.lds \
27 -Wl,--start-group $(patsubst $(obj)/%,%,$(u-boot-spl-main)) \
28 $(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) -Wl,--end-group \
29 $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot-spl.map -Wl,--gc-sections)
30
Simon Glass714a5622014-02-26 15:59:14 -070031CONFIG_ARCH_DEVICE_TREE := sandbox