John Stultz | 09c0fb8 | 2017-08-10 17:30:17 -0700 | [diff] [blame] | 1 | CROSS_COMPILE?=arm-linux-gnueabihf- |
| 2 | CC=$(CROSS_COMPILE)gcc |
| 3 | LD=$(CROSS_COMPILE)ld |
| 4 | OBJCOPY=$(CROSS_COMPILE)objcopy |
| 5 | CFLAGS=-march=armv7-a |
| 6 | |
| 7 | BL1=bl1.bin |
| 8 | NS_BL1U=recovery-fastboot.bin |
| 9 | PTABLE_LST?=aosp-8g aosp-4g |
| 10 | |
| 11 | .PHONY: all |
| 12 | all: l-loader.bin prm_ptable.img |
| 13 | |
| 14 | %.o: %.S |
| 15 | $(CC) $(CFLAGS) -c -o $@ $< |
| 16 | |
| 17 | l-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 | |
| 23 | prm_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 |
| 30 | clean: |
| 31 | rm -f *.o *.img l-loader.bin |