Root/xbboot/target-stage1/Makefile

1#
2# Authors: Wolfgang Spraul <wolfgang@qi-hardware.com>
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
14CFLAGS = -O2 -fno-unit-at-a-time -fno-zero-initialized-in-bss -mips32 -fno-pic \
15      -mno-abicalls -I$(INFLASH_SRC_PATH) -I$(XBURST_INCLUDE_PATH)
16LDFLAGS = -nostdlib -EL -T target.ld
17VPATH = ../target-common
18
19OBJS = head.o stage1.o serial.o
20
21all: stage1.bin
22
23stage1.bin: stage1.elf
24    $(CROSS_COMPILE)objcopy -O binary $< $@
25    $(CROSS_COMPILE)objdump -D $< > stage1.dump
26    $(CROSS_COMPILE)objdump -h $< > stage1.map
27    $(CROSS_COMPILE)nm -n $< > System.map
28
29stage1.elf: $(OBJS)
30    $(CROSS_COMPILE)ld $(LDFLAGS) $(OBJS) -o $@
31.c.o:
32    $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
33.S.o:
34    $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
35clean:
36    rm -f stage1.bin stage1.elf stage1.dump stage1.map
37    rm -f $(OBJS)
38    rm -f System.map
39

Archive Download this file



interactive