1 CROSS_COMPILE?=arm-linux-gnueabihf- 2 CC=$(CROSS_COMPILE)gcc 3 CFLAGS=-march=armv7-a 4 LD=$(CROSS_COMPILE)ld 5 OBJCOPY=$(CROSS_COMPILE)objcopy 6 BL1=bl1.bin 7 PTABLE_LST:=aosp-4g aosp-8g linux-4g linux-8g 8 9 all: l-loader.bin ptable.img 10 11 %.o: %.S $(DEPS) 12 $(CC) $(CFLAGS) -c -o $@ $< 13 14 l-loader.bin: start.o $(BL1) 15 $(LD) -Bstatic -Tl-loader.lds -Ttext 0xf9800800 start.o -o loader 16 $(OBJCOPY) -O binary loader temp 17 python gen_loader.py -o $@ --img_loader=temp --img_bl1=$(BL1) 18 rm -f loader temp 19 20 ptable.img: 21 for ptable in $(PTABLE_LST); do \ 22 sudo PTABLE=$${ptable} bash -x generate_ptable.sh;\ 23 python gen_loader.py -o ptable-$${ptable}.img --img_prm_ptable=prm_ptable.img;\ 24 done 25 26 clean: 27 rm -f *.o *.img l-loader.bin 28