blob: 16c1d975e8841ba71c8435900e82759ddbf3930a [file] [log] [blame]
John Stultz09c0fb82017-08-10 17:30:17 -07001CROSS_COMPILE?=arm-linux-gnueabihf-
2CC=$(CROSS_COMPILE)gcc
3LD=$(CROSS_COMPILE)ld
4OBJCOPY=$(CROSS_COMPILE)objcopy
5CFLAGS=-march=armv7-a
6
7BL1=bl1.bin
8NS_BL1U=recovery-fastboot.bin
9PTABLE_LST?=aosp-8g aosp-4g
10
11.PHONY: all
12all: l-loader.bin prm_ptable.img
13
14%.o: %.S
15 $(CC) $(CFLAGS) -c -o $@ $<
16
17l-loader.bin: start.o $(BL1) $(NS_BL1U)
18 $(LD) -Bstatic -Tl-loader.lds -Ttext 0xf9800800 start.o -o loader
19 $(OBJCOPY) -O binary loader temp
20 python gen_loader_hikey.py -o $@ --img_loader=temp --img_bl1=$(BL1) --img_ns_bl1u=$(NS_BL1U)
21 rm -f loader temp
22
23prm_ptable.img:
24 for ptable in $(PTABLE_LST); do \
25 PTABLE=$${ptable} SECTOR_SIZE=512 bash -x generate_ptable.sh;\
26 cp prm_ptable.img ptable-$${ptable}.img;\
27 done
28
29.PHONY: clean
30clean:
31 rm -f *.o *.img l-loader.bin