Vishal Bhoj | 9a67d91 | 2016-06-09 10:02:07 +0100 | [diff] [blame] | 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 |
Mark Salyzyn | 97ae220 | 2017-05-26 14:56:52 -0700 | [diff] [blame] | 7 | PTABLE_LST:=aosp-4g aosp-8g linux-4g linux-8g swap-8g |
Vishal Bhoj | 9a67d91 | 2016-06-09 10:02:07 +0100 | [diff] [blame] | 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 |