top.mk 1.15 KB
Newer Older
1
2
3
4
# SPDX-License-Identifier: GPL-2.0+
#
# Copyright (C) Arm Limited, 2020

5
6
7
ifndef TARGET
  $(error TARGET is not set)
endif
8
9

# Set some defaults that can be overridden by the target  makefile include
10
11
12
13
export DT_PATH    := $(CURDIR)/devicetree-rebasing
export TFA_PATH   := $(CURDIR)/arm-trusted-firmware
export UBOOT_PATH := $(CURDIR)/u-boot
export UBOOT_OUTPUT := $(CURDIR)/u-boot/build-$(TARGET)
14

15
all: tfa-fip
16

17
18
19
20
21
22
clean:
	cd $(UBOOT_PATH) && make mrproper
	cd $(UBOOT_PATH) && make KBUILD_OUTPUT=$(UBOOT_OUTPUT) clean
	cd $(TFA_PATH) && git clean -fdx
	cd $(CURDIR)/mv-ddr && git clean -fdx

23
24
25
$(UBOOT_OUTPUT)/.config:
	mkdir -p $(UBOOT_OUTPUT)
	$(MAKE) -C $(UBOOT_PATH) KBUILD_OUTPUT=$(UBOOT_OUTPUT) $(TARGET)_defconfig
26
27
28
29
30
31
	echo CONFIG_CMD_BOOTEFI_HELLO=y >> $(UBOOT_OUTPUT)/.config
	echo CONFIG_CMD_BOOTEFI_SELFTEST=y >> $(UBOOT_OUTPUT)/.config
	echo CONFIG_CMD_NVEDIT_EFI=y >> $(UBOOT_OUTPUT)/.config
	echo CONFIG_CMD_EFIDEBUG=y >> $(UBOOT_OUTPUT)/.config
	echo CONFIG_CMD_GPT=y >> $(UBOOT_OUTPUT)/.config
	$(MAKE) -C $(UBOOT_PATH) KBUILD_OUTPUT=$(UBOOT_OUTPUT) olddefconfig
32

33
34
%: $(UBOOT_OUTPUT)/.config
	$(MAKE) -f scripts/main.mk TARGET=$(TARGET) $@
35
36

.PHONY: $(UBOOT_OUTPUT)/.config