Makefile 1.35 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
CFLAGS=-g -O2 -marm -mno-thumb-interwork -mabi=aapcs-linux -march=armv7-a -fno-common -fno-builtin -ffreestanding -ffixed-r8 -msoft-float -D__KERNEL__ -I$(UBOOTOBJ)include2 -I$(UBOOTOBJ)include -I$(UBOOT)include 
18
19
20
21

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

UBOOT_OBJS= \
22
	spl/arch/arm/cpu/armv7/sunxi/libsunxi.o \
23
24
	spl/arch/arm/cpu/armv7/libarmv7.o \
	spl/arch/arm/lib/libarm.o \
25
	spl/arch/arm/lib/eabi_compat.o \
26
	spl/drivers/power/libpower.o \
27
	spl/drivers/i2c/libi2c.o \
28
29
30
	spl/common/libcommon.o \
	spl/common/spl/libspl.o \
	spl/lib/libgeneric.o \
31
	spl/drivers/serial/libserial.o \
32
	spl/board/sunxi/libsunxi.o
33
34
35
36

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

37
38
39
OBJS += main.o

fel-boot-$(BOARD).elf: $(OBJS) $(addprefix $(UBOOTOBJ),$(UBOOT_OBJS))
40
	$(CROSS_COMPILE)$(CC) -Tfel-boot.ld -static -Wl,--gc-sections -nostartfiles -nostdlib $(CFLAGS) -Wl,-Map=$@.map -o $@ $(OBJS) -Wl,--start-group $(addprefix $(UBOOTOBJ),$(UBOOT_OBJS)) -lgcc -Wl,--end-group
41
42
43
44
45
46

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

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