# Makefile for simple C program, running from SDRAM on W90N740. # Hugo Vincent (hugo@bluewatersys.com), Bluewater Systems, 19 Nov 2004. # Relevant Files- add extra files here (keep boot.o, it is needed). OBJS = boot.o example.o ELF = example.elf BIN = example.bin DISASM = $(ELF).txt # Flags to tools (tells C compiler and assembler to generate big-endian # ARM7TDMI code, and tells the linker to make big-endian binaries, with # no start files (i.e. no standard library), and to use the memory map # defined in w90n740-ram.ld). CFLAGS = -Os -I. -mcpu=arm7tdmi -mbig-endian ASFLAGS = -mcpu=arm7tdmi -gstabs -mbig-endian LDFLAGS = -Tw90n740-ram.ld -nostartfiles -Lgcc -L. -EB # Rules- default is to make the ELF and BIN binaries, and the disassembly. all: $(ELF) $(BIN) $(DISASM) $(ELF): $(OBJS) arm-elf-ld $(LDFLAGS) -o $(ELF) $(OBJS) $(BIN): $(ELF) arm-elf-objcopy -S -O binary $(ELF) $(BIN) %.o:%.c arm-elf-gcc -c $(CFLAGS) $< -o $@ %.o:%.s arm-elf-as $(ASFLAGS) $< -o $@ clean: rm -f $(OBJS) $(ELF) $(BIN) $(DISASM) $(DISASM): $(ELF) arm-elf-objdump -d $(ELF) > $(DISASM)