applications.mk 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  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. APP_CLI = 1
  12. BUILD_IRDA = 1
  13. APP_IRUKAGOTCHI = 1
  14. BUILD_EXAMPLE_BLINK = 1
  15. BUILD_EXAMPLE_UART_WRITE = 1
  16. BUILD_EXAMPLE_INPUT_DUMP = 1
  17. BUILD_CC1101 = 1
  18. BUILD_LF_RFID = 1
  19. BUILD_SPEAKER_DEMO = 1
  20. BUILD_VIBRO_DEMO = 1
  21. BUILD_SD_TEST = 1
  22. BUILD_GPIO_DEMO = 1
  23. endif
  24. APP_NFC ?= 0
  25. ifeq ($(APP_NFC), 1)
  26. APP_MENU = 1
  27. CFLAGS += -DAPP_NFC
  28. C_SOURCES += $(wildcard $(APP_DIR)/nfc/*.c)
  29. endif
  30. APP_IRUKAGOTCHI ?= 0
  31. ifeq ($(APP_IRUKAGOTCHI), 1)
  32. APP_MENU = 1
  33. CFLAGS += -DAPP_IRUKAGOTCHI
  34. C_SOURCES += $(wildcard $(APP_DIR)/irukagotchi/*.c)
  35. endif
  36. APP_POWER ?= 0
  37. ifeq ($(APP_POWER), 1)
  38. APP_GUI = 1
  39. CFLAGS += -DAPP_POWER
  40. C_SOURCES += $(wildcard $(APP_DIR)/power/*.c)
  41. endif
  42. APP_CLI ?= 0
  43. ifeq ($(APP_CLI), 1)
  44. APP_GUI = 1
  45. CFLAGS += -DAPP_CLI
  46. C_SOURCES += $(wildcard $(APP_DIR)/cli/*.c)
  47. endif
  48. APP_MENU ?= 0
  49. ifeq ($(APP_MENU), 1)
  50. CFLAGS += -DAPP_MENU
  51. BUILD_MENU = 1
  52. endif
  53. BUILD_MENU ?= 0
  54. ifeq ($(BUILD_MENU), 1)
  55. APP_INPUT = 1
  56. APP_GUI = 1
  57. CFLAGS += -DBUILD_MENU
  58. C_SOURCES += $(wildcard $(APP_DIR)/menu/*.c)
  59. C_SOURCES += $(wildcard $(APP_DIR)/app-loader/*.c)
  60. endif
  61. APP_TEST ?= 0
  62. ifeq ($(APP_TEST), 1)
  63. CFLAGS += -DAPP_TEST
  64. C_SOURCES += $(APP_DIR)/tests/furiac_test.c
  65. C_SOURCES += $(APP_DIR)/tests/furi_record_test.c
  66. C_SOURCES += $(APP_DIR)/tests/test_index.c
  67. C_SOURCES += $(APP_DIR)/tests/minunit_test.c
  68. C_SOURCES += $(APP_DIR)/tests/furi_valuemutex_test.c
  69. C_SOURCES += $(APP_DIR)/tests/furi_pubsub_test.c
  70. C_SOURCES += $(APP_DIR)/tests/furi_memmgr_test.c
  71. C_SOURCES += $(APP_DIR)/tests/furi_value_expanders_test.c
  72. C_SOURCES += $(APP_DIR)/tests/furi_event_test.c
  73. endif
  74. APP_EXAMPLE_BLINK ?= 0
  75. ifeq ($(APP_EXAMPLE_BLINK), 1)
  76. CFLAGS += -DAPP_EXAMPLE_BLINK
  77. BUILD_EXAMPLE_BLINK = 1
  78. endif
  79. BUILD_EXAMPLE_BLINK ?= 0
  80. ifeq ($(BUILD_EXAMPLE_BLINK), 1)
  81. CFLAGS += -DBUILD_EXAMPLE_BLINK
  82. C_SOURCES += $(APP_DIR)/examples/blink.c
  83. APP_INPUT = 1
  84. endif
  85. APP_EXAMPLE_UART_WRITE ?= 0
  86. ifeq ($(APP_EXAMPLE_UART_WRITE), 1)
  87. CFLAGS += -DAPP_EXAMPLE_UART_WRITE
  88. BUILD_EXAMPLE_UART_WRITE = 1
  89. endif
  90. BUILD_EXAMPLE_UART_WRITE ?= 0
  91. ifeq ($(BUILD_EXAMPLE_UART_WRITE), 1)
  92. CFLAGS += -DBUILD_EXAMPLE_UART_WRITE
  93. C_SOURCES += $(APP_DIR)/examples/uart_write.c
  94. endif
  95. APP_EXAMPLE_IPC ?= 0
  96. ifeq ($(APP_EXAMPLE_IPC), 1)
  97. CFLAGS += -DAPP_EXAMPLE_IPC
  98. BUILD_EXAMPLE_IPC = 1
  99. endif
  100. BUILD_EXAMPLE_IPC ?= 0
  101. ifeq ($(BUILD_EXAMPLE_IPC), 1)
  102. CFLAGS += -DBUILD_EXAMPLE_IPC
  103. C_SOURCES += $(APP_DIR)/examples/ipc.c
  104. endif
  105. APP_EXAMPLE_INPUT_DUMP ?= 0
  106. ifeq ($(APP_EXAMPLE_INPUT_DUMP), 1)
  107. CFLAGS += -DAPP_EXAMPLE_INPUT_DUMP
  108. BUILD_EXAMPLE_INPUT_DUMP = 1
  109. endif
  110. BUILD_EXAMPLE_INPUT_DUMP ?= 0
  111. ifeq ($(BUILD_EXAMPLE_INPUT_DUMP), 1)
  112. CFLAGS += -DBUILD_EXAMPLE_INPUT_DUMP
  113. C_SOURCES += $(APP_DIR)/examples/input_dump.c
  114. APP_INPUT = 1
  115. endif
  116. APP_EXAMPLE_QRCODE ?= 0
  117. ifeq ($(APP_EXAMPLE_QRCODE), 1)
  118. CFLAGS += -DAPP_EXAMPLE_QRCODE
  119. BUILD_EXAMPLE_QRCODE = 1
  120. endif
  121. BUILD_EXAMPLE_QRCODE ?= 0
  122. ifeq ($(BUILD_EXAMPLE_QRCODE), 1)
  123. CFLAGS += -DBUILD_EXAMPLE_QRCODE
  124. C_SOURCES += $(APP_DIR)/examples/u8g2_qrcode.c
  125. C_SOURCES += $(LIB_DIR)/qrcode/qrcode.c
  126. APP_DISPLAY = 1
  127. endif
  128. # deprecated
  129. APP_EXAMPLE_DISPLAY ?= 0
  130. ifeq ($(APP_EXAMPLE_DISPLAY), 1)
  131. CFLAGS += -DAPP_EXAMPLE_DISPLAY
  132. C_SOURCES += $(APP_DIR)/examples/u8g2_example.c
  133. APP_DISPLAY = 1
  134. endif
  135. APP_EXAMPLE_FATFS ?= 0
  136. ifeq ($(APP_EXAMPLE_FATFS), 1)
  137. CFLAGS += -DAPP_EXAMPLE_FATFS
  138. BUILD_EXAMPLE_FATFS = 1
  139. endif
  140. BUILD_EXAMPLE_FATFS ?= 0
  141. ifeq ($(BUILD_EXAMPLE_FATFS), 1)
  142. CFLAGS += -DBUILD_EXAMPLE_FATFS
  143. C_SOURCES += $(APP_DIR)/examples/fatfs_list.c
  144. APP_INPUT = 1
  145. APP_DISPLAY = 1
  146. endif
  147. APP_CC1101 ?= 0
  148. ifeq ($(APP_CC1101), 1)
  149. CFLAGS += -DAPP_CC1101
  150. BUILD_CC1101 = 1
  151. endif
  152. BUILD_CC1101 ?= 0
  153. ifeq ($(BUILD_CC1101), 1)
  154. CFLAGS += -DBUILD_CC1101
  155. C_SOURCES += $(wildcard $(APP_DIR)/cc1101-workaround/*.c)
  156. CPP_SOURCES += $(wildcard $(APP_DIR)/cc1101-workaround/*.cpp)
  157. APP_INPUT = 1
  158. APP_GUI = 1
  159. endif
  160. APP_LF_RFID ?= 0
  161. ifeq ($(APP_LF_RFID), 1)
  162. CFLAGS += -DAPP_LF_RFID
  163. BUILD_LF_RFID = 1
  164. endif
  165. BUILD_LF_RFID ?= 0
  166. ifeq ($(BUILD_LF_RFID), 1)
  167. CFLAGS += -DBUILD_LF_RFID
  168. C_SOURCES += $(wildcard $(APP_DIR)/lf-rfid/*.c)
  169. CPP_SOURCES += $(wildcard $(APP_DIR)/lf-rfid/*.cpp)
  170. APP_INPUT = 1
  171. APP_GUI = 1
  172. endif
  173. APP_IRDA ?= 0
  174. ifeq ($(APP_IRDA), 1)
  175. CFLAGS += -DAPP_IRDA
  176. BUILD_IRDA = 1
  177. endif
  178. BUILD_IRDA ?= 0
  179. ifeq ($(BUILD_IRDA), 1)
  180. CFLAGS += -DBUILD_IRDA
  181. C_SOURCES += $(wildcard $(APP_DIR)/irda/*.c)
  182. APP_INPUT = 1
  183. APP_GUI = 1
  184. endif
  185. APP_SD_TEST ?= 0
  186. ifeq ($(APP_SD_TEST), 1)
  187. CFLAGS += -DAPP_SD_TEST
  188. BUILD_SD_TEST = 1
  189. endif
  190. BUILD_SD_TEST ?= 0
  191. ifeq ($(BUILD_SD_TEST), 1)
  192. CFLAGS += -DBUILD_SD_TEST
  193. CPP_SOURCES += $(wildcard $(APP_DIR)/sd-card-test/*.cpp)
  194. APP_INPUT = 1
  195. APP_GUI = 1
  196. endif
  197. APP_SPEAKER_DEMO ?= 0
  198. ifeq ($(APP_SPEAKER_DEMO), 1)
  199. CFLAGS += -DAPP_SPEAKER_DEMO
  200. BUILD_SPEAKER_DEMO = 1
  201. endif
  202. BUILD_SPEAKER_DEMO ?= 0
  203. ifeq ($(BUILD_SPEAKER_DEMO), 1)
  204. CFLAGS += -DBUILD_SPEAKER_DEMO
  205. C_SOURCES += $(wildcard $(APP_DIR)/coreglitch_demo_0/*.c)
  206. APP_INPUT = 1
  207. APP_GUI = 1
  208. endif
  209. BUILD_VIBRO_DEMO ?= 0
  210. ifeq ($(BUILD_VIBRO_DEMO), 1)
  211. CFLAGS += -DBUILD_VIBRO_DEMO
  212. C_SOURCES += $(wildcard $(APP_DIR)/examples/vibro.c)
  213. APP_INPUT = 1
  214. endif
  215. APP_GPIO_DEMO ?= 0
  216. ifeq ($(APP_GPIO_DEMO), 1)
  217. CFLAGS += -DAPP_GPIO_DEMO
  218. BUILD_GPIO_DEMO = 1
  219. endif
  220. BUILD_GPIO_DEMO ?= 0
  221. ifeq ($(BUILD_GPIO_DEMO), 1)
  222. CFLAGS += -DBUILD_GPIO_DEMO
  223. C_SOURCES += $(wildcard $(APP_DIR)/gpio-tester/*.c)
  224. endif
  225. # device drivers
  226. APP_GUI ?= 0
  227. ifeq ($(APP_GUI), 1)
  228. CFLAGS += -DAPP_GUI
  229. C_SOURCES += $(wildcard $(APP_DIR)/gui/*.c)
  230. C_SOURCES += $(wildcard $(APP_DIR)/backlight-control/*.c)
  231. endif
  232. # deprecated
  233. ifeq ($(APP_DISPLAY), 1)
  234. CFLAGS += -DAPP_DISPLAY
  235. C_SOURCES += $(APP_DIR)/display-u8g2/display-u8g2.c
  236. endif
  237. APP_INPUT ?= 0
  238. ifeq ($(APP_INPUT), 1)
  239. CFLAGS += -DAPP_INPUT
  240. C_SOURCES += $(APP_DIR)/input/input.c
  241. endif