aboutsummaryrefslogtreecommitdiff
path: root/ubi-utils/scripts/Makefile
blob: 6d014ea8cda6afbe09f484a73ee4a6e845c87544 (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
46
47
48
49
50
51
52
53
54
55
56
57
#
# Makefile
#
# Testcase for UBI pfi update.
#
# Author:	Frank Haverkamp <haverkam@de.ibm.com>
#

card		= test
mkpfi_cfg	= test.cfg

#
# Some default values you might want to overwrite. Try it if you need
# it and add more if needed. Note that no real sanity checking is done
# on those values. If you do it wrong your card has no valid PDD data.
#

PATH := $(PATH):/opt/ppc/usr/bin

dd		= dd
sed		= sed
bin2nand	= bin2nand
ubigen		= ubigen
mkpfi		= mkpfi
pfi2bin		= pfi2bin

vmlinux_bin	?= test_vmlinux.bin
rootfs_bin	?= test_rootfs.bin
spl_bin		?= test_u-boot.bin

compl		?= $(card)_complete
compl_pfi	?= $(compl).pfi

all: $(compl_pfi)

$(compl_pfi): $(vmlinux_bin) $(rootfs_bin) $(spl_bin)
	$(mkpfi) -c $(mkpfi_cfg)

#
# Default data
#
# If the binary data is not available in the current working directory
# we try to create symlinks to our test data.
#
$(vmlinux_bin) $(rootfs_bin) $(spl_bin):
	@echo
	@echo "No $@ found, will use defaults !"
	@echo
	@echo "OR press CTRL-C to provide your own $@" && 	\
	sleep 1 &&						\
	$(dd) if=/dev/urandom of=$@ bs=1M count=1

clean:
	$(RM) *.pfi *~

distclean: clean
	$(RM) *.bin