You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

47 lines
1.1 KiB

5 years ago
  1. # makfile configuration
  2. NAME = launchpad
  3. OBJECTS = launchpad.o
  4. CPU = msp430g2553
  5. CFLAGS = -mmcu=${CPU} -O2 -Wall -g
  6. #switch the compiler (for the internal make rules)
  7. CC = msp430-gcc
  8. .PHONY: all FORCE clean download download-jtag download-bsl dist
  9. #all should be the first target. it's built when make is run without args
  10. all: ${NAME}.elf ${NAME}.a43 ${NAME}.lst
  11. #confgigure the next line if you want to use the serial download
  12. download: download-jtag
  13. #download: download-bsl
  14. #additional rules for files
  15. ${NAME}.elf: ${OBJECTS}
  16. ${CC} -mmcu=${CPU} -o $@ ${OBJECTS}
  17. ${NAME}.a43: ${NAME}.elf
  18. msp430-objcopy -O ihex $^ $@
  19. ${NAME}.lst: ${NAME}.elf
  20. msp430-objdump -dSt $^ >$@
  21. download-jtag: all
  22. msp430-jtag -e ${NAME}.elf
  23. download-bsl: all
  24. msp430-bsl -e ${NAME}.elf
  25. clean:
  26. rm -f ${NAME}.elf ${NAME}.a43 ${NAME}.lst ${OBJECTS}
  27. #backup archive
  28. dist:
  29. tar czf dist.tgz *.c *.h *.txt makefile
  30. #dummy target as dependecy if something has to be build everytime
  31. FORCE:
  32. #project dependencies
  33. launchpad.o: launchpad.c