• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1CROSS_COMPILE?=arm-linux-gnueabihf-
2CC=$(CROSS_COMPILE)gcc
3CFLAGS=-march=armv7-a
4LD=$(CROSS_COMPILE)ld
5OBJCOPY=$(CROSS_COMPILE)objcopy
6BL1=bl1.bin
7PTABLE_LST:=aosp-4g aosp-8g linux-4g linux-8g
8
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
28