Root/xbboot/target-stage1/Makefile

1#
2# Authors: Wolfgang Spraul <wolfgang@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
10ifeq ($(CROSS_COMPILE),)
11$(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-)
12endif
13
14INCPATH = -I. -I../target-common/
15CFLAGS = -O2 -fno-unit-at-a-time -fno-zero-initialized-in-bss -mips32 -fno-pic \
16      -mno-abicalls $(INCPATH)
17LDFLAGS = -nostdlib -EL -T target.ld
18VPATH = ../target-common
19
20OBJS = head.o stage1.o serial.o board-jz4740.o board-jz4760.o
21
22all: stage1.bin
23
24stage1.bin: stage1.elf
25    $(CROSS_COMPILE)objcopy -O binary $< $@+
26    $(CROSS_COMPILE)objdump -D $< > stage1.dump
27    $(CROSS_COMPILE)objdump -h $< > stage1.map
28    $(CROSS_COMPILE)nm -n $< > System.map
29    chmod -x $@+
30    mv -f $@+ $@
31
32stage1.elf: $(OBJS)
33    $(CROSS_COMPILE)ld $(LDFLAGS) $(OBJS) -o $@
34.c.o:
35    $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
36.S.o:
37    $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
38clean:
39    rm -f stage1.bin stage1.elf stage1.dump stage1.map
40    rm -f $(OBJS)
41    rm -f System.map
42

Archive Download this file



interactive