]> rtime.felk.cvut.cz Git - fpga/zynq/canbench-sw.git/blob - petalinux/Makefile
uboot images migrated to FIT, bootscript loads only 1 image (faster)
[fpga/zynq/canbench-sw.git] / petalinux / Makefile
1 .PHONY: config build all
2
3 all: build
4
5 config: .configured
6
7 .configured:
8         petalinux-config --get-hw-description ../system --oldconfig
9         $(MAKE) subsystems/linux/configs/u-boot/platform-auto.h
10         #touch .configured
11
12 build: .configured subsystems/linux/configs/u-boot/platform-auto.h
13         petalinux-build
14         $(MAKE) bootscript images/linux/BOOT.BIN
15
16 images/linux/BOOT.BIN: FORCE
17         cd images/linux && petalinux-package --boot --fsbl zynq_fsbl.elf --u-boot u-boot.elf --force
18
19 bootscript: bootscript.txt bootscript.its
20         #mkimage -A arm -O u-boot -T script -C none -a 0 -e 0 -n "t-Boot Script" -d $< $@
21         mkimage -f bootscript.its $@
22
23 subsystems/linux/configs/u-boot/platform-auto.h: FORCE | build/linux/u-boot/Makefile
24         $(MAKE) UBOOT_AUTO_CONFIG=y -C build/linux/u-boot autogen-config
25         sed -r -i '/PSSERIAL0 \\/r uboot-extra-env.h' $@
26         # HACK: force enable legacy image format; it is needed for everything (script, kernel, device tree)
27         #       but something sometimes will go crazy and disable it, sometimes it does not
28         #       With this hack it works OK.
29         sed -r -i '/CONFIG_BOOTCOMMAND/a #define CONFIG_IMAGE_FORMAT_LEGACY' $@
30         sed -r -i '/CONFIG_BOOTCOMMAND/a #undef CONFIG_BOOTP_SERVERIP' $@
31
32 build/linux/u-boot/Makefile:
33         petalinux-build -c u-boot
34
35 images/linux/system.bit.gz: ../system/system.bit
36         gzip -9 <$< >$@
37
38 images/linux/image.ub: FORCE images/linux/system.bit.gz
39         mkimage -f uboot-image.its $@
40
41 FORCE: