| 1 | # |
| 2 | # Authors: Xiangfu Liu <xiangfu@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 | |
| 10 | INFLASH_SRC_PATH = ../src |
| 11 | XBURST_INCLUDE_PATH = ../xburst_include |
| 12 | |
| 13 | ifeq ($(CROSS_COMPILE),) |
| 14 | $(error CROSS_COMPILE variable not set, should point to .../mipsel-openwrt-linux-) |
| 15 | endif |
| 16 | |
| 17 | CFLAGS := -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) |
| 19 | LDFLAGS := -nostdlib -EL -T target.ld |
| 20 | |
| 21 | OBJS = head.o main.o common.o board_4740.o board_4750.o debug.o |
| 22 | |
| 23 | all: xburst_stage1.bin |
| 24 | |
| 25 | xburst_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 | |
| 31 | xburst_stage1.elf: $(OBJS) |
| 32 | $(CROSS_COMPILE)ld $(LDFLAGS) $(OBJS) -o $@ |
| 33 | .c.o: |
| 34 | $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@ |
| 35 | .S.o: |
| 36 | $(CROSS_COMPILE)gcc $(CFLAGS) -c $< -o $@ |
| 37 | clean: |
| 38 | rm -f xburst_stage1.bin xburst_stage1.elf xburst_stage1.dump xburst_stage1.map |
| 39 | rm -f $(OBJS) |
| 40 | rm -f System.map |
| 41 | |