Makefile 1.14 KB
Newer Older
1
2

CC=gcc
3
4
5
6
7
8
9
10
11
12
13
14

# Target board name. This should match the dram_<boardname>.c in
# u-boot/board/sunxi/
BOARD=cubieboard

# Path/prefix of your tool chain
CROSS_COMPILE=arm-linux-gnueabihf-

# U-boot main source path
UBOOT=$(HOME)/SRC/u-boot/

# U-boot object path (O=... when building u-boot).
15
UBOOTOBJ=$(UBOOT)build/$(BOARD)/
16

17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
CFLAGS=-g -O2 -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a -fno-common -ffixed-r8 -msoft-float -I$(UBOOTOBJ)include2 -I$(UBOOTOBJ)include -I$(UBOOT)include 

all: fel-boot-$(BOARD).bin

UBOOT_OBJS= \
	$(addprefix spl/arch/arm/cpu/armv7/sunxi/,clock.o pinmux.o dram.o board.o timer.o) \
	spl/arch/arm/cpu/armv7/syslib.o \
	spl/arch/arm/lib/eabi_compat.o \
	spl/drivers/power/axp209.o \
	spl/drivers/i2c/libi2c.o \
	spl/common/memsize.o \
	spl/board/sunxi/dram_$(BOARD).o

.c.o:
	$(CROSS_COMPILE)$(CC) -c $(CFLAGS) $< -o $@

33
fel-boot-$(BOARD).elf: main.o printf-stdarg.o early_print.o $(addprefix $(UBOOTOBJ),$(UBOOT_OBJS))
34
35
36
37
38
39
40
	$(CROSS_COMPILE)$(CC) -Tfel-boot.ld -static -nostartfiles $(CFLAGS) -Wl,-Map=$@.map $^ -o $@

fel-boot-$(BOARD).bin: fel-boot-$(BOARD).elf
	$(CROSS_COMPILE)objcopy -O binary $< $@

clean:
	rm -f *.o *.map *.elf