Root/usbboot/xburst_stage1/Makefile

1#
2# Authors: Xiangfu Liu <xiangfu@sharism.cc>
3#
4# This program is free software; you can redistribute it and/or
5# modify it under the terms of the GNU General Public License
6# as published by the Free Software Foundation; either version
7# 3 of the License, or (at your option) any later version.
8#
9
10INFLASH_SRC_PATH = ../src
11XBURST_INCLUDE_PATH = ../xburst_include
12
13ifeq ($(CROSS_COMPILE),)
14$(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-)
15endif
16
17CFLAGS := -O2 -fno-unit-at-a-time -fno-zero-initialized-in-bss -mips32 -fno-pic \
18       -mno-abicalls -I$(INFLASH_SRC_PATH) -I$(XBURST_INCLUDE_PATH)
19LDFLAGS := -nostdlib -EL -T target.ld
20
21OBJS = head.o main.o common.o board-jz4740.o board-jz4760.o debug.o
22
23all: xburst_stage1.bin
24
25xburst_stage1.bin: xburst_stage1.elf
26    $(CROSS_COMPILE)objcopy -O binary $< $@+
27    $(CROSS_COMPILE)objdump -D $< > xburst_stage1.dump
28    $(CROSS_COMPILE)objdump -h $< > xburst_stage1.map
29    $(CROSS_COMPILE)nm -n $< > System.map
30    chmod -x $@+
31    mv -f $@+ $@
32
33xburst_stage1.elf: $(OBJS)
34    $(CROSS_COMPILE)ld $(LDFLAGS) $(OBJS) -o $@
35.c.o:
36    $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
37.S.o:
38    $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
39clean:
40    rm -f xburst_stage1.bin xburst_stage1.elf xburst_stage1.dump xburst_stage1.map
41    rm -f $(OBJS)
42    rm -f System.map
43

Archive Download this file



interactive