lib.mk 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. LIB_DIR = $(PROJECT_ROOT)/lib
  2. # TODO: some places use lib/header.h includes, is it ok?
  3. CFLAGS += -I$(LIB_DIR)
  4. # Mlib containers
  5. CFLAGS += -I$(LIB_DIR)/mlib
  6. # U8G2 display library
  7. U8G2_DIR = $(LIB_DIR)/u8g2
  8. CFLAGS += -I$(U8G2_DIR)
  9. C_SOURCES += $(U8G2_DIR)/u8x8_d_st7565.c
  10. C_SOURCES += $(U8G2_DIR)/u8g2_d_setup.c
  11. C_SOURCES += $(U8G2_DIR)/u8g2_intersection.c
  12. C_SOURCES += $(U8G2_DIR)/u8g2_setup.c
  13. C_SOURCES += $(U8G2_DIR)/u8g2_d_memory.c
  14. C_SOURCES += $(U8G2_DIR)/u8x8_cad.c
  15. C_SOURCES += $(U8G2_DIR)/u8x8_byte.c
  16. C_SOURCES += $(U8G2_DIR)/u8x8_gpio.c
  17. C_SOURCES += $(U8G2_DIR)/u8x8_display.c
  18. C_SOURCES += $(U8G2_DIR)/u8x8_setup.c
  19. C_SOURCES += $(U8G2_DIR)/u8g2_hvline.c
  20. C_SOURCES += $(U8G2_DIR)/u8g2_line.c
  21. C_SOURCES += $(U8G2_DIR)/u8g2_ll_hvline.c
  22. C_SOURCES += $(U8G2_DIR)/u8g2_circle.c
  23. C_SOURCES += $(U8G2_DIR)/u8g2_box.c
  24. C_SOURCES += $(U8G2_DIR)/u8g2_buffer.c
  25. C_SOURCES += $(U8G2_DIR)/u8g2_font.c
  26. C_SOURCES += $(U8G2_DIR)/u8g2_fonts.c
  27. C_SOURCES += $(U8G2_DIR)/u8x8_8x8.c
  28. C_SOURCES += $(U8G2_DIR)/u8g2_bitmap.c
  29. FATFS_DIR = $(LIB_DIR)/fatfs
  30. C_SOURCES += $(FATFS_DIR)/ff.c
  31. C_SOURCES += $(FATFS_DIR)/ff_gen_drv.c
  32. C_SOURCES += $(FATFS_DIR)/diskio.c
  33. C_SOURCES += $(FATFS_DIR)/option/unicode.c
  34. ifeq ($(SRV_INTERNAL_STORAGE), 1)
  35. LITTLEFS_DIR = $(LIB_DIR)/littlefs
  36. CFLAGS += -I$(LITTLEFS_DIR)
  37. C_SOURCES += $(LITTLEFS_DIR)/lfs.c
  38. C_SOURCES += $(LITTLEFS_DIR)/lfs_util.c
  39. endif
  40. ifeq ($(APP_NFC), 1)
  41. ST25RFAL002_DIR = $(LIB_DIR)/ST25RFAL002
  42. CFLAGS += -I$(ST25RFAL002_DIR)
  43. CFLAGS += -I$(ST25RFAL002_DIR)/include
  44. CFLAGS += -I$(ST25RFAL002_DIR)/source/st25r3916
  45. C_SOURCES += $(wildcard $(ST25RFAL002_DIR)/*.c)
  46. C_SOURCES += $(wildcard $(ST25RFAL002_DIR)/source/*.c)
  47. C_SOURCES += $(wildcard $(ST25RFAL002_DIR)/source/st25r3916/*.c)
  48. CFLAGS += -I$(LIB_DIR)/nfc_protocols
  49. C_SOURCES += $(wildcard $(LIB_DIR)/nfc_protocols/*.c)
  50. endif
  51. # callback connector (C to CPP) library
  52. CFLAGS += -I$(LIB_DIR)/callback-connector
  53. # app template library
  54. CFLAGS += -I$(LIB_DIR)/app-template
  55. # fnv1a hash library
  56. CFLAGS += -I$(LIB_DIR)/fnv1a-hash
  57. C_SOURCES += $(LIB_DIR)/fnv1a-hash/fnv1a-hash.c
  58. # build onewire/cyfral library only if
  59. # we build iButton application
  60. ifeq ($(APP_IBUTTON), 1)
  61. # onewire library
  62. APP_ONEWIRE = 1
  63. endif
  64. APP_ONEWIRE ?= 0
  65. ifeq ($(APP_ONEWIRE), 1)
  66. # onewire library
  67. ONEWIRE_DIR = $(LIB_DIR)/onewire
  68. CFLAGS += -I$(ONEWIRE_DIR)
  69. CPP_SOURCES += $(wildcard $(ONEWIRE_DIR)/*.cpp)
  70. # cyfral library
  71. CYFRAL_DIR = $(LIB_DIR)/cyfral
  72. CFLAGS += -I$(CYFRAL_DIR)
  73. CPP_SOURCES += $(wildcard $(CYFRAL_DIR)/*.cpp)
  74. endif
  75. # common apps api
  76. CFLAGS += -I$(LIB_DIR)/common-api
  77. # drivers
  78. CFLAGS += -I$(LIB_DIR)/drivers
  79. C_SOURCES += $(wildcard $(LIB_DIR)/drivers/*.c)
  80. #version
  81. CFLAGS += -I$(LIB_DIR)/version
  82. C_SOURCES += $(LIB_DIR)/version/version.c
  83. #irda lib
  84. CFLAGS += -I$(LIB_DIR)/irda
  85. C_SOURCES += $(wildcard $(LIB_DIR)/irda/*.c)
  86. C_SOURCES += $(wildcard $(LIB_DIR)/irda/*/*.c)