applications.mk 4.6 KB

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