Skip to content
CJBB edited this page Sep 13, 2010 · 14 revisions

I should like to point out that the makefile output will not always be as awful as previously described.

A short explaination for those new to makefiles.

A makefile is a set of instructions for the compiler to use, which tells the compiler what to do with the source files to make the output file.

It looks at the timestamps of the files, and if any sources are newer than the output, it processes those source files. Thus if you use ‘make’ twice without any changes inbetween, the 2nd output should just read “Target is up to date” i.e. nothing needs doing.

The rather long output is mostly repeated commands.

If we rename all instances of:

“-mmcu=msp430×1612 -g -O3 -Wall -Wcast-align -Wcast-qual -Wimplicit -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wredundant-decls -Wreturn-type -Wshadow -Wstrict-prototypes -Wswitch -Wunused”

TO

“-SWITCHES

the output becomes (once neatly formatted):

msp430-gcc -M -SWITCHES main.c cpuclockinit.c initPorts.c adc.c led.c AdcLut.c MazeManipulation.c MapMaze.c Motor2.c Setup.c DeadEndBlocking.c Alignment.c MazeSolving.c Error.c >main.d
msp430-gcc -SWITCHES -c -o main.o main.c
msp430-gcc -SWITCHES -c -o cpuclockinit.o cpuclockinit.c
msp430-gcc -SWITCHES -c -o initPorts.o initPorts.c
msp430-gcc -SWITCHES -c -o adc.o adc.c
msp430-gcc -SWITCHES -c -o led.o led.c
msp430-gcc -SWITCHES -c -o AdcLut.o AdcLut.c
msp430-gcc -SWITCHES -c -o MazeManipulation.o MazeManipulation.c
msp430-gcc -SWITCHES -c -o MapMaze.o MapMaze.c
msp430-gcc -SWITCHES -c -o Motor2.o Motor2.c
msp430-gcc -SWITCHES -c -o Setup.o Setup.c
msp430-gcc -SWITCHES -c -o DeadEndBlocking.o DeadEndBlocking.c
msp430-gcc -SWITCHES -c -o Alignment.o Alignment.c
msp430-gcc -SWITCHES -c -o MazeSolving.o MazeSolving.c
msp430-gcc -SWITCHES -c -o Error.o Error.c
msp430-gcc main.o cpuclockinit.o initPorts.o adc.o led.o AdcLut.o MazeManipulation.o MapMaze.o Motor2.o Setup.o DeadEndBlocking.o Alignment.o MazeSolving.o Error.o -mmcu=msp430×1612 -Wl -o main.elf

CJBB

Clone this wiki locally