summaryrefslogtreecommitdiff
path: root/boot/at91dataflashboot/at91dataflashboot.mk
blob: d11f842d817c11dd593617e0f3e5355b2087a811 (plain)
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
#############################################################
#
# DataFlashBoot
#
#############################################################
DATAFLASHBOOT_VERSION:=1.05
DATAFLASHBOOT_NAME:=DataflashBoot-$(DATAFLASHBOOT_VERSION)
DATAFLASHBOOT_SITE:=ftp://www.at91.com/pub/buildroot/
DATAFLASHBOOT_SOURCE:=$(DATAFLASHBOOT_NAME).tar.bz2
DATAFLASHBOOT_DIR:=$(BUILD_DIR)/at91dataflashboot-$(DATAFLASHBOOT_VERSION)
DATAFLASHBOOT_BINARY:=$(DATAFLASHBOOT_NAME).bin

$(DL_DIR)/$(DATAFLASHBOOT_SOURCE):
	 $(call DOWNLOAD,$(DATAFLASHBOOT_SITE),$(DATAFLASHBOOT_SOURCE))

$(DATAFLASHBOOT_DIR)/.unpacked: $(DL_DIR)/$(DATAFLASHBOOT_SOURCE)
	mkdir -p $(@D)
	$(BZCAT) $(DL_DIR)/$(DATAFLASHBOOT_SOURCE) | tar $(TAR_STRIP_COMPONENTS)=1 -C $(@D) $(TAR_OPTIONS) -
	touch $(DATAFLASHBOOT_DIR)/.unpacked

$(DATAFLASHBOOT_DIR)/.patched: $(DATAFLASHBOOT_DIR)/.unpacked
	toolchain/patch-kernel.sh $(@D) boot/at91dataflashboot \
		at91dataflashboot-$(DATAFLASHBOOT_VERSION)-\*.patch

$(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY): $(DATAFLASHBOOT_DIR)/.patched
	ls $(DATAFLASHBOOT_DIR)/.unpacked
	make -C $(DATAFLASHBOOT_DIR) CROSS_COMPILE=$(TARGET_CROSS)

dataflashboot-clean:
	make -C $(DATAFLASHBOOT_DIR) clean

dataflashboot-dirclean:
	rm -rf $(DATAFLASHBOOT_DIR)

dataflash:	 $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY)
	cp $(DATAFLASHBOOT_DIR)/$(DATAFLASHBOOT_BINARY) $(BINARIES_DIR)

#############################################################
#
# Toplevel Makefile options
#
#############################################################
ifeq ($(BR2_TARGET_DATAFLASHBOOT),y)
TARGETS+=dataflash
endif