Root/usbboot/xburst_stage2/Makefile

Source at commit 5d0a80f6a6f8374702f4c467f6bf88227c3c5d59 created 14 years 7 months ago.
By Xiangfu Liu, many users got error message then use that option Signed-off-by: Xiangfu Liu <xiangfu.z@gmail.com>
1#
2# Authors: Lucifer at Ingenic Semiconductor Inc.
3# Xiangfu Liu <xiangfu@qi-hardware.com>
4#
5# This program is free software; you can redistribute it and/or
6# modify it under the terms of the GNU General Public License
7# as published by the Free Software Foundation; either version
8# 2 of the License, or (at your option) any later version.
9#
10
11INFLASH_SRC_PATH = ../src
12XBURST_INCLUDE_PATH = ../xburst_include
13
14ifeq ($(CROSS_COMPILE),)
15$(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-)
16endif
17
18CC = $(CROSS_COMPILE)gcc
19AR = $(CROSS_COMPILE)ar rcsv
20LD = $(CROSS_COMPILE)ld
21OBJCOPY = $(CROSS_COMPILE)objcopy
22NM = $(CROSS_COMPILE)nm
23OBJDUMP = $(CROSS_COMPILE)objdump
24
25DEBUG_CFLAGS = -g -Wa,-a=$(basename $@).lst
26# Wolfgang saw data corruptions in stage2 when dealing with ECC data on random writes
27# to NAND. Disabling the unit-at-a-time optimization reproducibly fixed the bug.
28# The compiler may be optimizing in a way that conflicts with how the hardware ECC
29# registers work. Since other register accesses might be affected too it seems the best
30# is to disable this optimization right now.
31CFLAGS = -mips32 -O2 -fno-exceptions -fno-zero-initialized-in-bss \
32    -ffunction-sections -fomit-frame-pointer -msoft-float -G 0 $(DEBUG_CFLAGS) \
33    -I$(XBURST_INCLUDE_PATH) -I$(INFLASH_SRC_PATH)
34LDFLAGS = -nostdlib -T target.ld $(CFLAGS)
35LIBS = -lstdc++ -lc -lm -lgcc
36
37OBJS = main.o udc.o cache.o serial.o boothandler.o nandflash_4740.o nandflash_4750.o
38
39all: xburst_stage2.elf
40    $(OBJCOPY) -O binary xburst_stage2.elf xburst_stage2.bin
41    $(OBJDUMP) -D xburst_stage2.elf > xburst_stage2.dump
42    $(NM) xburst_stage2.elf | sort > xburst_stage2.sym
43    $(OBJDUMP) -h xburst_stage2.elf > xburst_stage2.map
44
45xburst_stage2.elf: head.o $(OBJS)
46    $(CC) $(LDFLAGS) $^ -o $@
47
48.c.o:
49    $(CC) $(CFLAGS) -o $@ -c $<
50.cpp.o:
51    $(CC) $(CFLAGS) -fno-rtti -fvtable-gc -o $@ -c $<
52.S.o:
53    $(CC) $(CFLAGS) -o $@ -c $<
54
55clean:
56    rm -f $(addprefix xburst_stage2., bin dump elf map sym)
57    rm -f head.o $(OBJS) $(OBJS:.o=.lst)
58

Archive Download this file



interactive