lib.mk 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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. endif
  49. # callback connector (C to CPP) library
  50. CFLAGS += -I$(LIB_DIR)/callback-connector
  51. # app template library
  52. CFLAGS += -I$(LIB_DIR)/app-template
  53. # fnv1a hash library
  54. CFLAGS += -I$(LIB_DIR)/fnv1a-hash
  55. C_SOURCES += $(LIB_DIR)/fnv1a-hash/fnv1a-hash.c
  56. # build onewire/cyfral library only if
  57. # we build iButton application
  58. ifeq ($(APP_IBUTTON), 1)
  59. # onewire library
  60. APP_ONEWIRE = 1
  61. endif
  62. APP_ONEWIRE ?= 0
  63. ifeq ($(APP_ONEWIRE), 1)
  64. # onewire library
  65. ONEWIRE_DIR = $(LIB_DIR)/onewire
  66. CFLAGS += -I$(ONEWIRE_DIR)
  67. CPP_SOURCES += $(wildcard $(ONEWIRE_DIR)/*.cpp)
  68. # cyfral library
  69. CYFRAL_DIR = $(LIB_DIR)/cyfral
  70. CFLAGS += -I$(CYFRAL_DIR)
  71. CPP_SOURCES += $(wildcard $(CYFRAL_DIR)/*.cpp)
  72. endif
  73. # common apps api
  74. CFLAGS += -I$(LIB_DIR)/common-api
  75. # drivers
  76. CFLAGS += -I$(LIB_DIR)/drivers
  77. C_SOURCES += $(wildcard $(LIB_DIR)/drivers/*.c)
  78. #version
  79. CFLAGS += -I$(LIB_DIR)/version
  80. C_SOURCES += $(LIB_DIR)/version/version.c