Skript file: /~heha/ewa/Kram/Solarpaneel.zip/C-Programm/makefile

# makfile configuration
NAME            = solar
OBJECTS         = main.o tableau.o display.o analog.o ser0.o vt100.o conio.o graphics.o
CPU             = msp430x168

CFLAGS          = -mmcu=${CPU} -O2 -Wall -g
LDFLAGS		= -lmspgcc

#switch the compiler (for the internal make rules)
CC              = msp430-gcc

.PHONY: all FORCE clean download download-jtag download-bsl dist

#all should be the first target. it's built when make is run without args
all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst

#confgigure the next line if you want to use the serial download
program: download
download: download-jtag
#download: download-bsl

#additional rules for files
${NAME}.elf: ${OBJECTS}
	${CC} -mmcu=${CPU} -o $@ ${OBJECTS} ${LDFLAGS}
	msp430-size $@

${NAME}.a43: ${NAME}.elf
	msp430-objcopy -O ihex $^ $@

${NAME}.lst: ${NAME}.elf
	msp430-objdump -dSt $^ >$@

download-jtag: all
	msp430-jtag -e ${NAME}.elf

download-bsl: all
	msp430-bsl -e ${NAME}.elf

clean:
	rm -f ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${OBJECTS}

#backup archive
dist:
	tar czf dist.tgz *.c *.h *.txt makefile

#dummy target as dependecy if something has to be build everytime
FORCE:

#project dependencies
main.o: main.c solar.h
tableau.o: tableau.c solar.h
display.o: display.c solar.h
analog.o: analog.c solar.h
ser0.o: ser0.c solar.h
vt100.o: vt100.c solar.h
conio.o: conio.c conio.h solar.h
graphics.o: graphics.c graphics.h solar.h

Detected encoding: ASCII (7 bit)2