Keyboard firmwares for Atmel AVR and Cortex-M
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.

Makefile 5.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. # Hey Emacs, this is a -*- makefile -*-
  2. #----------------------------------------------------------------------------
  3. # WinAVR Makefile Template written by Eric B. Weddington, Jörg Wunsch, et al.
  4. # >> Modified for use with the LUFA project. <<
  5. #
  6. # Released to the Public Domain
  7. #
  8. # Additional material for this makefile was written by:
  9. # Peter Fleury
  10. # Tim Henigan
  11. # Colin O'Flynn
  12. # Reiner Patommel
  13. # Markus Pfaff
  14. # Sander Pool
  15. # Frederik Rouleau
  16. # Carlos Lamas
  17. # Dean Camera
  18. # Opendous Inc.
  19. # Denver Gingerich
  20. #
  21. #----------------------------------------------------------------------------
  22. # On command line:
  23. #
  24. # make all = Make software.
  25. #
  26. # make clean = Clean out built project files.
  27. #
  28. # make coff = Convert ELF to AVR COFF.
  29. #
  30. # make extcoff = Convert ELF to AVR Extended COFF.
  31. #
  32. # make program = Download the hex file to the device, using avrdude.
  33. # Please customize the avrdude settings below first!
  34. #
  35. # make dfu = Download the hex file to the device, using dfu-programmer (must
  36. # have dfu-programmer installed).
  37. #
  38. # make flip = Download the hex file to the device, using Atmel FLIP (must
  39. # have Atmel FLIP installed).
  40. #
  41. # make dfu-ee = Download the eeprom file to the device, using dfu-programmer
  42. # (must have dfu-programmer installed).
  43. #
  44. # make flip-ee = Download the eeprom file to the device, using Atmel FLIP
  45. # (must have Atmel FLIP installed).
  46. #
  47. # make doxygen = Generate DoxyGen documentation for the project (must have
  48. # DoxyGen installed)
  49. #
  50. # make debug = Start either simulavr or avarice as specified for debugging,
  51. # with avr-gdb or avr-insight as the front end for debugging.
  52. #
  53. # make filename.s = Just compile filename.c into the assembler code only.
  54. #
  55. # make filename.i = Create a preprocessed source file for use in submitting
  56. # bug reports to the GCC project.
  57. #
  58. # To rebuild project do "make clean" then "make all".
  59. #----------------------------------------------------------------------------
  60. # Directory common source filess exist
  61. TOP_DIR = ../..
  62. # Directory keyboard dependent files exist
  63. TARGET_DIR = .
  64. # MCU name
  65. #MCU = at90usb1287
  66. MCU = atmega32u4
  67. # Target architecture (see library "Board Types" documentation).
  68. ARCH = AVR8
  69. # Target board (see library "Board Types" documentation, NONE for projects not requiring
  70. # LUFA board drivers). If USER is selected, put custom board drivers in a directory called
  71. # "Board" inside the application directory.
  72. BOARD = USBKEY
  73. # Processor frequency.
  74. # This will define a symbol, F_CPU, in all source code files equal to the
  75. # processor frequency in Hz. You can then use this symbol in your source code to
  76. # calculate timings. Do NOT tack on a 'UL' at the end, this will be done
  77. # automatically to create a 32-bit value in your source code.
  78. #
  79. # This will be an integer division of F_USB below, as it is sourced by
  80. # F_USB after it has run through any CPU prescalers. Note that this value
  81. # does not *change* the processor frequency - it should merely be updated to
  82. # reflect the processor speed set externally so that the code can use accurate
  83. # software delays.
  84. F_CPU = 16000000
  85. # Input clock frequency.
  86. # This will define a symbol, F_USB, in all source code files equal to the
  87. # input clock frequency (before any prescaling is performed) in Hz. This value may
  88. # differ from F_CPU if prescaling is used on the latter, and is required as the
  89. # raw input clock is fed directly to the PLL sections of the AVR for high speed
  90. # clock generation for the USB and other AVR subsections. Do NOT tack on a 'UL'
  91. # at the end, this will be done automatically to create a 32-bit value in your
  92. # source code.
  93. #
  94. # If no clock division is performed on the input clock inside the AVR (via the
  95. # CPU clock adjust registers or the clock division fuses), this will be equal to F_CPU.
  96. F_USB = $(F_CPU)
  97. # Target file name (without extension).
  98. TARGET = lufa
  99. # Path to the LUFA library
  100. LUFA_PATH = ../../protocol
  101. # Create the LUFA source path variables by including the LUFA root makefile
  102. include $(LUFA_PATH)/LUFA/makefile
  103. # List C source files here. (C dependencies are automatically generated.)
  104. LUFA_SRC = $(TARGET).c \
  105. descriptor.c \
  106. $(LUFA_SRC_USB) \
  107. $(LUFA_SRC_USBCLASS)
  108. SRC = $(subst $(LUFA_PATH)/LUFA/,,$(LUFA_SRC))
  109. SRC += keymap.c \
  110. matrix.c \
  111. led.c \
  112. pjrc/bootloader_teensy.c
  113. CONFIG_H = config.h
  114. # Build Options
  115. # comment out to disable the options.
  116. #
  117. MOUSEKEY_ENABLE = yes # Mouse keys
  118. #PS2_MOUSE_ENABLE = yes # PS/2 mouse(TrackPoint) support
  119. EXTRAKEY_ENABLE = yes # Audio control and System control
  120. #NKRO_ENABLE = yes # USB Nkey Rollover
  121. # LUFA library compile-time options and predefined tokens
  122. LUFA_OPTS = -D USB_DEVICE_ONLY
  123. LUFA_OPTS += -D FIXED_CONTROL_ENDPOINT_SIZE=8
  124. LUFA_OPTS += -D FIXED_NUM_CONFIGURATIONS=1
  125. LUFA_OPTS += -D USE_FLASH_DESCRIPTORS
  126. LUFA_OPTS += -D USE_STATIC_OPTIONS="(USB_DEVICE_OPT_FULLSPEED | USB_OPT_REG_ENABLED | USB_OPT_AUTO_PLL)"
  127. OPT_DEFS = -DF_CPU=$(F_CPU)UL
  128. OPT_DEFS += -DF_USB=$(F_USB)UL
  129. OPT_DEFS += -DBOARD=BOARD_$(BOARD) -DARCH=ARCH_$(ARCH)
  130. OPT_DEFS += $(LUFA_OPTS)
  131. # Search Path
  132. VPATH += $(TARGET_DIR)
  133. VPATH += $(LUFA_PATH)/LUFA
  134. include $(TOP_DIR)/protocol.mk
  135. include $(TOP_DIR)/common.mk
  136. include $(TOP_DIR)/rules.mk
  137. test:
  138. echo $(SRC)