applications.mk 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225
  1. APP_DIR = $(PROJECT_ROOT)/applications
  2. LIB_DIR = $(PROJECT_ROOT)/lib
  3. CFLAGS += -I$(APP_DIR)
  4. # Use APP_* for autostart app
  5. # Use BUILD_* for add app to build
  6. APP_RELEASE ?= 0
  7. ifeq ($(APP_RELEASE), 1)
  8. APP_MENU = 1
  9. APP_NFC = 1
  10. APP_POWER = 1
  11. BUILD_IRDA = 1
  12. APP_IRUKAGOTCHI = 1
  13. BUILD_EXAMPLE_BLINK = 1
  14. BUILD_EXAMPLE_UART_WRITE = 1
  15. BUILD_EXAMPLE_INPUT_DUMP = 1
  16. BUILD_CC1101 = 1
  17. BUILD_LF_RFID = 1
  18. BUILD_SPEAKER_DEMO = 1
  19. endif
  20. APP_NFC ?= 0
  21. ifeq ($(APP_NFC), 1)
  22. APP_MENU = 1
  23. CFLAGS += -DAPP_NFC
  24. C_SOURCES += $(wildcard $(APP_DIR)/nfc/*.c)
  25. endif
  26. APP_IRUKAGOTCHI ?= 0
  27. ifeq ($(APP_IRUKAGOTCHI), 1)
  28. APP_MENU = 1
  29. CFLAGS += -DAPP_IRUKAGOTCHI
  30. C_SOURCES += $(wildcard $(APP_DIR)/irukagotchi/*.c)
  31. endif
  32. APP_POWER ?= 0
  33. ifeq ($(APP_POWER), 1)
  34. APP_GUI = 1
  35. CFLAGS += -DAPP_POWER
  36. C_SOURCES += $(wildcard $(APP_DIR)/power/*.c)
  37. endif
  38. APP_MENU ?= 0
  39. ifeq ($(APP_MENU), 1)
  40. CFLAGS += -DAPP_MENU
  41. BUILD_MENU = 1
  42. endif
  43. BUILD_MENU ?= 0
  44. ifeq ($(BUILD_MENU), 1)
  45. APP_INPUT = 1
  46. APP_GUI = 1
  47. CFLAGS += -DBUILD_MENU
  48. C_SOURCES += $(wildcard $(APP_DIR)/menu/*.c)
  49. C_SOURCES += $(wildcard $(APP_DIR)/app-loader/*.c)
  50. endif
  51. APP_TEST ?= 0
  52. ifeq ($(APP_TEST), 1)
  53. CFLAGS += -DAPP_TEST
  54. C_SOURCES += $(APP_DIR)/tests/furiac_test.c
  55. C_SOURCES += $(APP_DIR)/tests/furi_record_test.c
  56. C_SOURCES += $(APP_DIR)/tests/test_index.c
  57. C_SOURCES += $(APP_DIR)/tests/minunit_test.c
  58. C_SOURCES += $(APP_DIR)/tests/furi_valuemutex_test.c
  59. C_SOURCES += $(APP_DIR)/tests/furi_pubsub_test.c
  60. C_SOURCES += $(APP_DIR)/tests/furi_memmgr_test.c
  61. C_SOURCES += $(APP_DIR)/tests/furi_value_expanders_test.c
  62. C_SOURCES += $(APP_DIR)/tests/furi_event_test.c
  63. endif
  64. APP_EXAMPLE_BLINK ?= 0
  65. ifeq ($(APP_EXAMPLE_BLINK), 1)
  66. CFLAGS += -DAPP_EXAMPLE_BLINK
  67. BUILD_EXAMPLE_BLINK = 1
  68. endif
  69. BUILD_EXAMPLE_BLINK ?= 0
  70. ifeq ($(BUILD_EXAMPLE_BLINK), 1)
  71. CFLAGS += -DBUILD_EXAMPLE_BLINK
  72. C_SOURCES += $(APP_DIR)/examples/blink.c
  73. endif
  74. APP_EXAMPLE_UART_WRITE ?= 0
  75. ifeq ($(APP_EXAMPLE_UART_WRITE), 1)
  76. CFLAGS += -DAPP_EXAMPLE_UART_WRITE
  77. BUILD_EXAMPLE_UART_WRITE = 1
  78. endif
  79. BUILD_EXAMPLE_UART_WRITE ?= 0
  80. ifeq ($(BUILD_EXAMPLE_UART_WRITE), 1)
  81. CFLAGS += -DBUILD_EXAMPLE_UART_WRITE
  82. C_SOURCES += $(APP_DIR)/examples/uart_write.c
  83. endif
  84. APP_EXAMPLE_IPC ?= 0
  85. ifeq ($(APP_EXAMPLE_IPC), 1)
  86. CFLAGS += -DAPP_EXAMPLE_IPC
  87. BUILD_EXAMPLE_IPC = 1
  88. endif
  89. BUILD_EXAMPLE_IPC ?= 0
  90. ifeq ($(BUILD_EXAMPLE_IPC), 1)
  91. CFLAGS += -DBUILD_EXAMPLE_IPC
  92. C_SOURCES += $(APP_DIR)/examples/ipc.c
  93. endif
  94. APP_EXAMPLE_INPUT_DUMP ?= 0
  95. ifeq ($(APP_EXAMPLE_INPUT_DUMP), 1)
  96. CFLAGS += -DAPP_EXAMPLE_INPUT_DUMP
  97. BUILD_EXAMPLE_INPUT_DUMP = 1
  98. endif
  99. BUILD_EXAMPLE_INPUT_DUMP ?= 0
  100. ifeq ($(BUILD_EXAMPLE_INPUT_DUMP), 1)
  101. CFLAGS += -DBUILD_EXAMPLE_INPUT_DUMP
  102. C_SOURCES += $(APP_DIR)/examples/input_dump.c
  103. APP_INPUT = 1
  104. endif
  105. APP_EXAMPLE_QRCODE ?= 0
  106. ifeq ($(APP_EXAMPLE_QRCODE), 1)
  107. CFLAGS += -DAPP_EXAMPLE_QRCODE
  108. BUILD_EXAMPLE_QRCODE = 1
  109. endif
  110. BUILD_EXAMPLE_QRCODE ?= 0
  111. ifeq ($(BUILD_EXAMPLE_QRCODE), 1)
  112. CFLAGS += -DBUILD_EXAMPLE_QRCODE
  113. C_SOURCES += $(APP_DIR)/examples/u8g2_qrcode.c
  114. C_SOURCES += $(LIB_DIR)/qrcode/qrcode.c
  115. APP_DISPLAY = 1
  116. endif
  117. # deprecated
  118. APP_EXAMPLE_DISPLAY ?= 0
  119. ifeq ($(APP_EXAMPLE_DISPLAY), 1)
  120. CFLAGS += -DAPP_EXAMPLE_DISPLAY
  121. C_SOURCES += $(APP_DIR)/examples/u8g2_example.c
  122. APP_DISPLAY = 1
  123. endif
  124. APP_EXAMPLE_FATFS ?= 0
  125. ifeq ($(APP_EXAMPLE_FATFS), 1)
  126. CFLAGS += -DAPP_EXAMPLE_FATFS
  127. BUILD_EXAMPLE_FATFS = 1
  128. endif
  129. BUILD_EXAMPLE_FATFS ?= 0
  130. ifeq ($(BUILD_EXAMPLE_FATFS), 1)
  131. CFLAGS += -DBUILD_EXAMPLE_FATFS
  132. C_SOURCES += $(APP_DIR)/examples/fatfs_list.c
  133. APP_INPUT = 1
  134. APP_DISPLAY = 1
  135. endif
  136. APP_CC1101 ?= 0
  137. ifeq ($(APP_CC1101), 1)
  138. CFLAGS += -DAPP_CC1101
  139. BUILD_CC1101 = 1
  140. endif
  141. BUILD_CC1101 ?= 0
  142. ifeq ($(BUILD_CC1101), 1)
  143. CFLAGS += -DBUILD_CC1101
  144. C_SOURCES += $(wildcard $(APP_DIR)/cc1101-workaround/*.c)
  145. CPP_SOURCES += $(wildcard $(APP_DIR)/cc1101-workaround/*.cpp)
  146. APP_INPUT = 1
  147. APP_GUI = 1
  148. endif
  149. APP_LF_RFID ?= 0
  150. ifeq ($(APP_LF_RFID), 1)
  151. CFLAGS += -DAPP_LF_RFID
  152. BUILD_LF_RFID = 1
  153. endif
  154. BUILD_LF_RFID ?= 0
  155. ifeq ($(BUILD_LF_RFID), 1)
  156. CFLAGS += -DBUILD_LF_RFID
  157. C_SOURCES += $(wildcard $(APP_DIR)/lf-rfid/*.c)
  158. CPP_SOURCES += $(wildcard $(APP_DIR)/lf-rfid/*.cpp)
  159. APP_INPUT = 1
  160. APP_GUI = 1
  161. endif
  162. APP_IRDA ?= 0
  163. ifeq ($(APP_IRDA), 1)
  164. CFLAGS += -DAPP_IRDA
  165. BUILD_IRDA = 1
  166. endif
  167. BUILD_IRDA ?= 0
  168. ifeq ($(BUILD_IRDA), 1)
  169. CFLAGS += -DBUILD_IRDA
  170. C_SOURCES += $(wildcard $(APP_DIR)/irda/*.c)
  171. APP_INPUT = 1
  172. APP_GUI = 1
  173. endif
  174. APP_SPEAKER_DEMO ?= 0
  175. ifeq ($(APP_SPEAKER_DEMO), 1)
  176. CFLAGS += -DAPP_SPEAKER_DEMO
  177. BUILD_SPEAKER_DEMO = 1
  178. endif
  179. BUILD_SPEAKER_DEMO ?= 0
  180. ifeq ($(BUILD_SPEAKER_DEMO), 1)
  181. CFLAGS += -DBUILD_SPEAKER_DEMO
  182. C_SOURCES += $(wildcard $(APP_DIR)/coreglitch_demo_0/*.c)
  183. APP_INPUT = 1
  184. APP_GUI = 1
  185. endif
  186. # device drivers
  187. APP_GUI ?= 0
  188. ifeq ($(APP_GUI), 1)
  189. CFLAGS += -DAPP_GUI
  190. C_SOURCES += $(wildcard $(APP_DIR)/gui/*.c)
  191. C_SOURCES += $(wildcard $(APP_DIR)/backlight-control/*.c)
  192. endif
  193. # deprecated
  194. ifeq ($(APP_DISPLAY), 1)
  195. CFLAGS += -DAPP_DISPLAY
  196. C_SOURCES += $(APP_DIR)/display-u8g2/display-u8g2.c
  197. endif
  198. APP_INPUT ?= 0
  199. ifeq ($(APP_INPUT), 1)
  200. CFLAGS += -DAPP_INPUT
  201. C_SOURCES += $(APP_DIR)/input/input.c
  202. endif