source: tt-loader/2nd/Makefile @ 11

Last change on this file since 11 was 11, checked in by guillaume, 17 years ago

Publication tt-loader v0.1

File size: 1019 bytes
RevLine 
[11]1CROSS = armv5tel-redhat-linux-gnueabi
2CC = $(CROSS)-gcc
3INCLUDES =
4CFLAGS = -g -Wall -fverbose-asm -march=armv5t -mtune=arm926ej-s \
5        -msoft-float $(INCLUDES)
6LIBS =
7LDFILE = arm.ld
8LDFLAGS = $(LIBS) -T $(LDFILE)
9APP_NAME = 2nd
10OBJ_ADDR ?= 0x10000000
11
12S_SRCS = start.S
13C_SRCS = main.c usb.c
14SRCS = $(S_SRCS) $(C_SRCS)
15
16OBJS = $(S_SRCS:.S=.o) $(C_SRCS:.c=.o)
17ALL = $(APP_NAME).bin $(APP_NAME).asm
18
19all:
20        $(MAKE) $(ALL) DEPEND=.depend
21
22clean:
23        rm -f *.o *.elf *.bin *.map *.asm *.dis .depend *~
24
25$(APP_NAME).elf: $(LDFILE) $(OBJS)
26        $(CROSS)-ld $(LDFLAGS) -Map $(APP_NAME).map -o $@ $(OBJS)
27
28$(APP_NAME).asm: $(APP_NAME).elf
29        $(CROSS)-objdump -d -S $(APP_NAME).elf >$(APP_NAME).asm
30
31%.dis: %.mtd
32        $(CROSS)-objcopy -I binary -O elf32-littlearm -B arm $< $(@F).elf
33        $(CROSS)-objdump -D --adjust-vma=$(OBJ_ADDR) $(@F).elf > $@
34
35%.bin: %.elf
36        $(CROSS)-objcopy -O binary $< $@
37
38dep: .depend
39
40.depend: $(SRCS)
41        $(CC) -M -MG $(INCLUDES) $^ > .depend
42
43ifdef DEPEND
44include $(DEPEND)
45endif
46
47.depend: $(SRCS)
48
49.PHONY: dep all clean
Note: See TracBrowser for help on using the repository browser.