######################################################################### # # # Template Makefile for Assembly Language Programs # # # ######################################################################### # Author: John Zaitseff # Date: 28th May, 2003 # Version: 1.9 # This file is meant to be used as a template (in other words, a starting # point) for any Makefile that you write. Modify it to suit your needs, # making sure that the file is called "Makefile"; in most cases, all you # need to do is replace every occurrence of "template" with the name of # your file. # # Every Makefile should have the targets "all" and "clean", at a minimum. # See chapter 14 of the GNU Make Reference for other suggestions on how # Makefiles should be written. # # Please note that every line that is indented (or, in the language of # Makefiles, the command part of the rules) is done so with TAB # characters, NOT with spaces. This is important and a subtle trap for # the unwary! all: template.elf template.elf: template.o template.o: template.s clean: -rm -f template.elf template.o # The following variables and implicit rules are required for the GNU # Assembler for ARM. You probably do not need to modify anything here. AS = arm-elf-as LD = arm-elf-ld ASFLAGS = --gdwarf2 LDFLAGS = LOADLIBES = LDLIBS = # Assemble ARM assembly language source (.s) to an object file (.o) %.o: %.s $(AS) -marm7tdmi $(ASFLAGS) $< -o $@ # Link files into an ARM executable (.elf), using the GNU Linker. %.elf: $(LD) $(LDFLAGS) $+ $(LOADLIBES) $(LDLIBS) -o $@ # Miscellaneous rules .PHONY: all clean .DEFAULT: .SUFFIXES: