######################################################################### # # # Makefile for posn-div-int.s and div-main.c # # # ######################################################################### # Author: Christopher Walsh # Date: 27th April, 2005 # Version: 1.1 # This file contains the necessary information to compile posn-div-v2.s # and div-main.c. The executable file posn-div-v2.elf is produced. # Please note that YOU are responsible for creating posn-div-v2.s! # You can use this file by typing: # make -f posn-div-int.make # Generated files can be removed by typing: # make -f posn-div-int.make clean all: posn-div-int.elf posn-div-int.elf: div-main.o posn-div-int.o cstart.o posn-div-int.o: posn-div-int.s div-main.o: div-main.c cstart.o: cstart.s clean: -rm -f posn-div-int.elf posn-div-int.o div-main.o # 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 COPTFLAGS = -O2 CFLAGS = -g -Wall LDFLAGS = LOADLIBES = LDLIBS = # Compile C code (.c) to an object file (.o) %.o: %.c $(CC) -c -mcpu=arm7tdmi $(COPTFLAGS) $(CFLAGS) $< -o $@ # Assemble ARM assembly language source (.s) to an object file (.o) %.o: %.s $(AS) -marm7tdmi $(ASFLAGS) $< -o $@ # Link object files (.o) into an ARM executable (.elf), using the GNU Linker. %.elf: %.o $(LD) $(LDFLAGS) $^ $(LOADLIBES) $(LDLIBS) -o $@ # Miscellaneous rules .PHONY: all clean .DEFAULT: .SUFFIXES: