Atmel Evaluation Board using the SAM7SE Microcontroller AT91SAM7SE-EK AT91SAM7SE-EK Data Sheet

Product codes
AT91SAM7SE-EK
Page of 24
19
6295A–ATARM–27-Mar-07
Application Note
• Compiler options:
– -g: generate debugging information for GDB usage.
– -mcpu = arm7tdmi type of ARM CPU core.
– -c: indicates to gcc to only compile the file, and to not link it (link is done later, when 
all code files are compiled).
– -Wall: displays all warnings.
– -I$(INCL): set paths for include files.
ASFLAGS=-D__ASSEMBLY__ -g -mcpu=arm7tdmi -c -Os -Wall -I$(INCL)
• Assembler options:
– -D__ASSEMBLY__ : defines the __ASSEMBLY__ symbol, which is used in header 
files to distinguish inclusion of the file in assembly code or in C code.
LDFLAGS+=-nostartfiles -Wl,--cref
LDFLAGS+=-lc -lgcc
LDFLAGS+=-T elf32-littlearm.lds
• Linker  options:
– -nostartfile: Do not use the standard system startup files when linking.
– -Wl,--cref: Pass the --cref option to the linker (generates cross-reference in map file if 
this one is requested).
– -lc: use standard C library.
– -lgcc: use gcc library.
– -T elf32-littlearm.lds: use the file elf32-littlearm.lds as linker file.
OBJS=cstartup.o
OBJS+= lowlevel.o \
       main.o
• List of all object file names.
For more detailed information about gcc options, please refer to gcc documentation
(
4.1.1.2
Rules
The second part contains rules. Each rule is composed on the same line by a target name, and
the files needed to create this target.
The first rule, ‘all’, is the default rule used by the make command if none is specified in command
line.
all: sdram flash
The following rules create the 3 object files from the 3 corresponding source files. The option -c
tells gcc to run the compiler and assembler, but not the linker.
main.o: main.c