Makefile 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. STACKCHECK := # Set to 1 to enable stack instrumentation
  2. # Project name
  3. NAME := cnc-control.cpu
  4. # Project source files
  5. SRCS := main.c 4094.c debug.c uart.c util.c lcd.c \
  6. override.c machine_interface.c \
  7. pdiusb.c usb.c spi.c
  8. GEN_SRCS := descriptor_table.h
  9. # Bootloader source files
  10. BOOT_SRCS := bootloader.c usb.c pdiusb.c util.c uart.c spi.c
  11. BOOT_GEN_SRCS := descriptor_table_mini.h
  12. BOOT_OFFSET := 0x7000
  13. # CPU speed, in Hz
  14. F_CPU := 16000000UL
  15. # Project fuse bits
  16. LFUSE := 0xA0
  17. HFUSE := 0xD8
  18. EFUSE :=
  19. # Architecture configuration
  20. GCC_ARCH := atmega32
  21. AVRDUDE_ARCH := m32
  22. FUNC_STACK_LIMIT := 32
  23. # Programmer selection.
  24. # Values can be: avrisp2, mysmartusb
  25. PROGRAMMER := avrisp2
  26. # Instrumentation
  27. INSTRUMENT_FUNC := $(if $(STACKCHECK),1)
  28. BOOT_INSTRUMENT_FUNC :=
  29. # Additional compiler flags
  30. CFLAGS := -I.. $(if $(STACKCHECK),-DSTACKCHECK)
  31. LDFLAGS :=
  32. SPARSEFLAGS := -Wno-address-space
  33. BOOT_CFLAGS := -I..
  34. BOOT_LDFLAGS :=
  35. BOOT_SPARSEFLAGS := -Wno-address-space
  36. # Additional "clean" and "distclean" target files
  37. CLEAN_FILES :=
  38. DISTCLEAN_FILES :=
  39. include ../avrmakelib.mk
  40. # USB ID configuration (pdiusb)
  41. USB_VENDOR = 0x6666
  42. USB_PRODUCT = 0xC8CC
  43. ADMIN_TOOL := ../../driver/admin.py
  44. boot-app: all
  45. $(ADMIN_TOOL) --enterboot
  46. $(ADMIN_TOOL) --flash-cpu $(HEX)
  47. $(ADMIN_TOOL) --exitboot
  48. $(GEN_SRCS) $(BOOT_GEN_SRCS): %.h: %.py descriptor_generator.py
  49. $(QUIET_PYTHON2) $< $(USB_VENDOR) $(USB_PRODUCT) > $@
  50. .PHONY: boot-app