#
# Makefile
#
CROSS_COMPILER = /usr/local/arm/3.3/bin/arm-linux-
CC := $(CROSS_COMPILER)gcc
LD := $(CROSS_COMPILER)ld
NM := ${CROSS_COMPILE}nm
OBJCOPY := $(CROSS_COMPILER)objcopy
OBJDUMP := $(CROSS_COMPILER)objdump
CFLAGS := -fno-builtin -Wall -Wstrict-prototypes -fno-common -nostdinc -static -fPIC
CFLAGS += -marm -mno-thumb-interwork -march=armv5
LDFLAGS := -Bstatic -T utest.lds -v
# output map file
LDFLAGS += -Map utest.map
all:
$(CC) ${CFLAGS} -c utest.c -o utest.o
$(LD) ${LDFLAGS} utest.o -o utest.elf
$(NM) -n utest.elf > utest.map
$(OBJCOPY) -S -O binary utest.elf utest.bin
cp utest.bin /tftpboot/
clean:
rm -f utest.o utest.elf utest.bin utest.map
阅读(1695) | 评论(0) | 转发(0) |