# configuration of the makefile
NAME = keytest
OBJECTS = keys.o myc.o
CPU = msp430x155

CFLAGS=-mmcu=${CPU} -g -S -O2


# compiler and linker commands
AS = msp430-gcc
ASFLAGS = ${CFLAGS} -D _GNU_ASSEMBLER_ -x assembler-with-cpp -c
CC = msp430-gcc
LD = msp430-ld


# first target all
all: ${NAME}.elf ${NAME}.lst

${NAME}.elf: ${OBJECTS}
	${CC} -mmcu=${CPU} -g -o $@ ${OBJECTS}

${NAME}.a43: ${NAME}.elf
	msp430-objcopy -O ihex $^ $@

${NAME}.lst: ${NAME}.elf
	msp430-objdump -dSt $^ >$@



clean:
	rm -f ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${OBJECTS}

# dependencies

keys.o: keys.s keys.h
myc.o: keys.h



