blob: 692cd82deb37537b4361429289ef9eed8c03d555 [file] [log] [blame]
Vishal Bhoj9a67d912016-06-09 10:02:07 +01001CROSS_COMPILE?=arm-linux-gnueabihf-
2CC=$(CROSS_COMPILE)gcc
3CFLAGS=-march=armv7-a
4LD=$(CROSS_COMPILE)ld
5OBJCOPY=$(CROSS_COMPILE)objcopy
6BL1=bl1.bin
Mark Salyzyn97ae2202017-05-26 14:56:52 -07007PTABLE_LST:=aosp-4g aosp-8g linux-4g linux-8g swap-8g
Vishal Bhoj9a67d912016-06-09 10:02:07 +01008
9all: l-loader.bin ptable.img
10
11%.o: %.S $(DEPS)
12 $(CC) $(CFLAGS) -c -o $@ $<
13
14l-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
20ptable.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
26clean:
27 rm -f *.o *.img l-loader.bin