######################################################################### # # # Makefile for Hardware Demonstration Programs # # # ######################################################################### # Author: John Zaitseff # Date: 9th March, 2003 # Version: 1.0 # This Makefile creates the executable images for all of the programs that # illustrate various aspects of the DSLMU Microcontroller Board. You # should read the source code for the programs to see what each program is # meant to do. # # Assuming that you have the GNU Assembler and C Compiler for the ARM # microcontroller installed, type "make" to create the executable images. # After you finish, type "make clean" to remove all created files. # The first target is the default: typing "make" is the same as typing # "make all". The target "all" lists a number of other targets as its # dependencies (ie, "all" depends on these other targets). Note that "\" # at the end of the line means "this line continues onto the next one". all: \ flash-leds \ teletype clean: -rm -f \ flash-leds.elf flash-leds.o \ teletype.elf teletype.o # flash-leds: Flash the LEDs on and off flash-leds: flash-leds.elf flash-leds.elf: flash-leds.o flash-leds.o: flash-leds.s # teletype: Echo characters received from the serial port teletype: teletype.elf teletype.elf: teletype.o teletype.o: teletype.s # The following variables and implicit rules are required for the GNU # Assembler and the GNU Compiler for ARM. You probably do not need to # modify anything here. AS = arm-elf-as CC = arm-elf-gcc LD = arm-elf-ld ASFLAGS = --gdwarf2 CFLAGS = -O2 -g -Wall LDFLAGS = LDLIBS = # Assemble ARM assembly language source to an object file %.o: %.s $(AS) -marm7tdmi $(ASFLAGS) $< -o $@ # Compile C code to an object file %.o: %.c $(CC) -c -mcpu=arm7tdmi $(CFLAGS) $< -o $@ # Compile C code into ARM assembly language %.s: %.c $(CC) -S -fverbose-asm -mcpu=arm7tdmi $(CFLAGS) $< -o $@ # Link object files into an ARM executable, using the GNU Linker. %.elf: %.o $(LD) $(LDFLAGS) $^ $(LDLIBS) -o $@ # Miscellaneous rules .PHONY: all clean .DEFAULT: .SUFFIXES: