aboutsummaryrefslogtreecommitdiffstats
blob: 1ef4e5339af9bf243c91131aa773c896833da39d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84

# TOPDIR should be defined by the BUILD engine

# define the targets we can do - before including the Master template
LOCAL_TARGETS=all clean distclean install source save-config restore-config \
	baseline
.PHONY: $(LOCAL_TARGETS)

# get the master definitions 
include $(TOPDIR)/BUILD/Master.mk

# remove cmd line set variables from interfering with the sub make
MAKEOVERRIDES=

ifdef CONFIG_BUILD_UBOOT
all install:: u-boot_build
else
all install:: 
endif

CONFIG_NAME=$(shell echo $(CONFIG_UBOOT_DEFCONFIG))

u-boot_build: $(IMAGEDIR)/u-boot-$(PRODUCTID).bin \
	$(HOSTDIR)/bin/mkimage

.PHONY: force_build
force_build: u-boot_make u-boot_build

include/config.mk:
ifdef CONFIG_NAME
	$(MAKE) $(CONFIG_NAME)
else
	$(error U-Boot doesn't support this build configuration)
endif

$(IMAGEDIR)/u-boot-$(PRODUCTID).bin: u-boot.bin
	@$(call MarkStartOfAction,"Installing U-Boot")
	@echo "*************************************"
	@echo "* Installing U-Boot"
	@echo "*************************************"
	$(INSTALL) $< $@
	@$(call MarkEndOfAction,"Installing U-Boot")

$(HOSTDIR)/bin/mkimage: tools/mkimage
	$(INSTALL) $< $@

u-boot_make u-boot.bin tools/mkimage: include/config.mk
	@$(call MarkStartOfAction,"Building U-Boot")
	@echo "*************************************"
	@echo "* Building U-Boot"
	@echo "*************************************"
	$(MAKE) CROSS_COMPILE=$(CROSS)
	@$(call MarkEndOfAction,"Building U-Boot")

# catch published sub-targets and call ourself with the force_ removed
$(LOCAL_TARGETS:%=force_%):
	@$(call MarkStartOfAction,"Building U-Boot %")
	@$(MAKE) -f .bld-adapter.mk TOPDIR=$(TOPDIR) $(@:force_%=%)

# call all direct targets and just pass blindly - after removing force_
force_%:
	@$(call MarkStartOfAction,"Building $(@:force_%=%)")
	$(MAKE) CROSS_COMPILE=$(CROSS) $(@:force_%=%)
	@$(call MarkEndOfAction,"Building $(@:force_%=%)")

# create a rule for the local targets.  Nothing to do, just pass them
# on to the master Makefile.
clean distclean::
	$(MAKE) $@

############################################################
# Release
############################################################

save-config::

restore-config::

source: $(RELEASEDIR) $(CONFSAVEDIR)
	$(call ReleaseCCFileList,.,U-Boot)
	$(call ReleasePkgCCsrc,.,U-Boot)

baseline:
	@$(call make_baseline,$(shell pwd))