Tom Rini | 83d290c | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0+ |
Simon Glass | 4b0730d | 2011-09-26 14:10:39 +0000 | [diff] [blame] | 2 | # Copyright (c) 2011 The Chromium OS Authors. |
Simon Glass | 4b0730d | 2011-09-26 14:10:39 +0000 | [diff] [blame] | 3 | |
Masahiro Yamada | 90f984e | 2014-07-30 14:08:23 +0900 | [diff] [blame] | 4 | PLATFORM_CPPFLAGS += -D__SANDBOX__ -U_FORTIFY_SOURCE |
Masahiro Yamada | 0a9e7ee | 2015-03-19 19:42:52 +0900 | [diff] [blame] | 5 | PLATFORM_CPPFLAGS += -DCONFIG_ARCH_MAP_SYSMEM |
Matthias Weisser | d99a687 | 2011-11-29 12:16:40 +0100 | [diff] [blame] | 6 | PLATFORM_LIBS += -lrt |
Simon Glass | a733b06 | 2013-04-26 02:53:43 +0000 | [diff] [blame] | 7 | |
Alexander Graf | 7e21fbc | 2018-06-12 07:48:37 +0200 | [diff] [blame] | 8 | LDFLAGS_FINAL += --gc-sections |
| 9 | PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections |
| 10 | |
Simon Glass | e50ab22 | 2015-02-10 18:52:35 -0700 | [diff] [blame] | 11 | # Define this to avoid linking with SDL, which requires SDL libraries |
| 12 | # This can solve 'sdl-config: Command not found' errors |
| 13 | ifneq ($(NO_SDL),) |
| 14 | PLATFORM_CPPFLAGS += -DSANDBOX_NO_SDL |
| 15 | else |
Simon Glass | bbc09bf | 2014-02-27 13:26:17 -0700 | [diff] [blame] | 16 | ifdef CONFIG_SANDBOX_SDL |
| 17 | PLATFORM_LIBS += $(shell sdl-config --libs) |
| 18 | PLATFORM_CPPFLAGS += $(shell sdl-config --cflags) |
| 19 | endif |
Simon Glass | e50ab22 | 2015-02-10 18:52:35 -0700 | [diff] [blame] | 20 | endif |
Simon Glass | bbc09bf | 2014-02-27 13:26:17 -0700 | [diff] [blame] | 21 | |
Tom Rini | 699946a | 2016-03-05 14:07:44 -0500 | [diff] [blame] | 22 | cmd_u-boot__ = $(CC) -o $@ -Wl,-T u-boot.lds \ |
Masahiro Yamada | ad0fed4 | 2014-02-24 11:12:18 +0900 | [diff] [blame] | 23 | -Wl,--start-group $(u-boot-main) -Wl,--end-group \ |
| 24 | $(PLATFORM_LIBS) -Wl,-Map -Wl,u-boot.map |
Simon Glass | 714a562 | 2014-02-26 15:59:14 -0700 | [diff] [blame] | 25 | |
Simon Glass | 4cfc416 | 2016-07-04 11:57:46 -0600 | [diff] [blame] | 26 | cmd_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 Glass | 714a562 | 2014-02-26 15:59:14 -0700 | [diff] [blame] | 31 | CONFIG_ARCH_DEVICE_TREE := sandbox |