blob: 05fbbd7bcc789dedf28971912b0881a7fe3b9281 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001# SPDX-License-Identifier: GPL-2.0+
Simon Glass3d750d72011-09-26 14:10:39 +00002# Copyright (c) 2011 The Chromium OS Authors.
Simon Glass3d750d72011-09-26 14:10:39 +00003
Masahiro Yamada4869aee2014-07-30 14:08:23 +09004PLATFORM_CPPFLAGS += -D__SANDBOX__ -U_FORTIFY_SOURCE
Masahiro Yamada57a11eb2015-03-19 19:42:52 +09005PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM
Andy Shevchenko5077f432018-09-03 12:08:10 +03006PLATFORM_CPPFLAGS += -fPIC
Matthias Weisser0d3dd142011-11-29 12:16:40 +01007PLATFORM_LIBS += -lrt
Simon Glass73585b92019-05-18 11:59:47 -06008SDL_CONFIG ?= sdl-config
Simon Glass62cf9122013-04-26 02:53:43 +00009
Simon Glassd8e22922015-02-10 18:52:35 -070010# Define this to avoid linking with SDL, which requires SDL libraries
11# This can solve 'sdl-config: Command not found' errors
12ifneq ($(NO_SDL),)
13PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL
14else
Simon Glass73585b92019-05-18 11:59:47 -060015PLATFORM_LIBS += $(shell $(SDL_CONFIG) --libs)
16PLATFORM_CPPFLAGS += $(shell $(SDL_CONFIG) --cflags)
Simon Glass0d10f292014-02-27 13:26:17 -070017endif
18
Simon Glass66cf8f72018-11-23 21:29:30 -070019cmd_u-boot__ = $(CC) -o $@ -Wl,-T u-boot.lds $(u-boot-init) \
Masahiro Yamada9f9a4e92014-02-24 11:12:18 +090020 -Wl,--start-group $(u-boot-main) -Wl,--end-group \
21 $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map
Simon Glass66c164b2014-02-26 15:59:14 -070022
Simon Glass1a3ba622016-07-04 11:57:46 -060023cmd_u-boot-spl = (cd $(obj) && $(CC) -o $(SPL_BIN) -Wl,-T u-boot-spl.lds \
Simon Glass66cf8f72018-11-23 21:29:30 -070024 $(patsubst $(obj)/%,%,$(u-boot-spl-init)) \
Simon Glass1a3ba622016-07-04 11:57:46 -060025 -Wl,--start-group $(patsubst $(obj)/%,%,$(u-boot-spl-main)) \
26 $(patsubst $(obj)/%,%,$(u-boot-spl-platdata)) -Wl,--end-group \
27 $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot-spl.map -Wl,--gc-sections)
28
Simon Glass66c164b2014-02-26 15:59:14 -070029CONFIG_ARCH_DEVICE_TREE := sandbox