lib.mk 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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 ($(APP_NFC), 1)
  35. ST25RFAL002_DIR = $(LIB_DIR)/ST25RFAL002
  36. CFLAGS += -I$(ST25RFAL002_DIR)
  37. CFLAGS += -I$(ST25RFAL002_DIR)/include
  38. CFLAGS += -I$(ST25RFAL002_DIR)/source/st25r3916
  39. C_SOURCES += $(wildcard $(ST25RFAL002_DIR)/*.c)
  40. C_SOURCES += $(wildcard $(ST25RFAL002_DIR)/source/*.c)
  41. C_SOURCES += $(wildcard $(ST25RFAL002_DIR)/source/st25r3916/*.c)
  42. endif
  43. # callback connector (C to CPP) library
  44. CFLAGS += -I$(LIB_DIR)/callback-connector
  45. # app template library
  46. CFLAGS += -I$(LIB_DIR)/app-template
  47. # fnv1a hash library
  48. CFLAGS += -I$(LIB_DIR)/fnv1a-hash
  49. C_SOURCES += $(LIB_DIR)/fnv1a-hash/fnv1a-hash.c
  50. # build onewire/cyfral library only if
  51. # we build iButton application
  52. ifeq ($(APP_IBUTTON), 1)
  53. # onewire library
  54. APP_ONEWIRE = 1
  55. endif
  56. APP_ONEWIRE ?= 0
  57. ifeq ($(APP_ONEWIRE), 1)
  58. # onewire library
  59. ONEWIRE_DIR = $(LIB_DIR)/onewire
  60. CFLAGS += -I$(ONEWIRE_DIR)
  61. CPP_SOURCES += $(wildcard $(ONEWIRE_DIR)/*.cpp)
  62. # cyfral library
  63. CYFRAL_DIR = $(LIB_DIR)/cyfral
  64. CFLAGS += -I$(CYFRAL_DIR)
  65. CPP_SOURCES += $(wildcard $(CYFRAL_DIR)/*.cpp)
  66. endif
  67. # common apps api
  68. CFLAGS += -I$(LIB_DIR)/common-api
  69. # drivers
  70. CFLAGS += -I$(LIB_DIR)/drivers
  71. C_SOURCES += $(wildcard $(LIB_DIR)/drivers/*.c)
  72. #version
  73. CFLAGS += -I$(LIB_DIR)/version
  74. C_SOURCES += $(LIB_DIR)/version/version.c