2009-08-21 09:04:09 +03:00
|
|
|
#
|
2010-04-28 13:29:53 +03:00
|
|
|
# Authors: Wolfgang Spraul <wolfgang@sharism.cc>
|
2009-08-21 09:04:09 +03:00
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version
|
|
|
|
# 3 of the License, or (at your option) any later version.
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(CROSS_COMPILE),)
|
|
|
|
$(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-)
|
|
|
|
endif
|
|
|
|
|
2010-06-04 17:31:19 +03:00
|
|
|
INCPATH = -I. -I../target-common/
|
2009-08-21 09:04:09 +03:00
|
|
|
CFLAGS = -O2 -fno-unit-at-a-time -fno-zero-initialized-in-bss -mips32 -fno-pic \
|
2010-06-04 17:31:19 +03:00
|
|
|
-mno-abicalls $(INCPATH)
|
2009-08-21 09:04:09 +03:00
|
|
|
LDFLAGS = -nostdlib -EL -T target.ld
|
2010-06-04 17:31:19 +03:00
|
|
|
VPATH = ../target-common
|
2009-08-21 09:04:09 +03:00
|
|
|
|
2010-06-04 17:31:19 +03:00
|
|
|
OBJS = head.o stage1.o serial.o board-jz4740.o
|
2009-08-21 09:04:09 +03:00
|
|
|
|
|
|
|
all: stage1.bin
|
|
|
|
|
|
|
|
stage1.bin: stage1.elf
|
2010-05-11 08:54:56 +03:00
|
|
|
$(CROSS_COMPILE)objcopy -O binary $< $@+
|
2009-08-21 09:04:09 +03:00
|
|
|
$(CROSS_COMPILE)objdump -D $< > stage1.dump
|
|
|
|
$(CROSS_COMPILE)objdump -h $< > stage1.map
|
|
|
|
$(CROSS_COMPILE)nm -n $< > System.map
|
2010-05-11 08:54:56 +03:00
|
|
|
chmod -x $@+
|
|
|
|
mv -f $@+ $@
|
2009-08-21 09:04:09 +03:00
|
|
|
|
|
|
|
stage1.elf: $(OBJS)
|
|
|
|
$(CROSS_COMPILE)ld $(LDFLAGS) $(OBJS) -o $@
|
|
|
|
.c.o:
|
|
|
|
$(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
|
|
|
|
.S.o:
|
|
|
|
$(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@
|
|
|
|
clean:
|
|
|
|
rm -f stage1.bin stage1.elf stage1.dump stage1.map
|
|
|
|
rm -f $(OBJS)
|
|
|
|
rm -f System.map
|