applications.mk 4.8 KB

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