2018-05-06 21:58:06 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0+
|
2011-09-26 14:10:39 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) 2011 The Chromium OS Authors.
|
|
|
|
#
|
|
|
|
# (C) Copyright 2000-2003
|
|
|
|
# Wolfgang Denk, DENX Software Engineering, wd@denx.de.
|
|
|
|
|
2020-12-09 18:42:44 +00:00
|
|
|
obj-y := cache.o cpu.o state.o
|
2018-11-24 04:29:30 +00:00
|
|
|
extra-y := start.o os.o
|
|
|
|
extra-$(CONFIG_SANDBOX_SDL) += sdl.o
|
2016-07-04 17:57:51 +00:00
|
|
|
obj-$(CONFIG_SPL_BUILD) += spl.o
|
2015-03-22 22:09:21 +00:00
|
|
|
obj-$(CONFIG_ETH_SANDBOX_RAW) += eth-raw-os.o
|
2011-09-26 14:10:39 +00:00
|
|
|
|
2011-12-02 10:53:13 +00:00
|
|
|
# os.c is build in the system environment, so needs standard includes
|
kbuild: use Linux Kernel build scripts
Now we are ready to switch over to real Kbuild.
This commit disables temporary scripts:
scripts/{Makefile.build.tmp, Makefile.host.tmp}
and enables real Kbuild scripts:
scripts/{Makefile.build,Makefile.host,Makefile.lib}.
This switch is triggered by the line in scripts/Kbuild.include
-build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build.tmp obj
+build := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.build obj
We need to adjust some build scripts for U-Boot.
But smaller amount of modification is preferable.
Additionally, we need to fix compiler flags which are
locally added or removed.
In Kbuild, it is not allowed to change CFLAGS locally.
Instead, ccflags-y, asflags-y, cppflags-y,
CFLAGS_$(basetarget).o, CFLAGS_REMOVE_$(basetarget).o
are prepared for that purpose.
Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Tested-by: Gerhard Sittig <gsi@denx.de>
2014-02-04 08:24:28 +00:00
|
|
|
# CFLAGS_REMOVE_os.o cannot be used to drop header include path
|
|
|
|
quiet_cmd_cc_os.o = CC $(quiet_modtag) $@
|
|
|
|
cmd_cc_os.o = $(CC) $(filter-out -nostdinc, \
|
|
|
|
$(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
|
|
|
|
|
|
|
|
$(obj)/os.o: $(src)/os.c FORCE
|
|
|
|
$(call if_changed_dep,cc_os.o)
|
2014-02-27 20:26:17 +00:00
|
|
|
$(obj)/sdl.o: $(src)/sdl.c FORCE
|
|
|
|
$(call if_changed_dep,cc_os.o)
|
2015-03-22 22:09:21 +00:00
|
|
|
|
|
|
|
# eth-raw-os.c is built in the system env, so needs standard includes
|
|
|
|
# CFLAGS_REMOVE_eth-raw-os.o cannot be used to drop header include path
|
|
|
|
quiet_cmd_cc_eth-raw-os.o = CC $(quiet_modtag) $@
|
|
|
|
cmd_cc_eth-raw-os.o = $(CC) $(filter-out -nostdinc, \
|
|
|
|
$(patsubst -I%,-idirafter%,$(c_flags))) -c -o $@ $<
|
|
|
|
|
|
|
|
$(obj)/eth-raw-os.o: $(src)/eth-raw-os.c FORCE
|
|
|
|
$(call if_changed_dep,cc_eth-raw-os.o)
|