Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. #############################################################
  2. # Required variables for each makefile
  3. # Discard this section from all parent makefiles
  4. # Expected variables (with automatic defaults):
  5. # CSRCS (all "C" files in the dir)
  6. # SUBDIRS (all subdirs with a Makefile)
  7. # GEN_LIBS - list of libs to be generated ()
  8. # GEN_IMAGES - list of object file images to be generated ()
  9. # GEN_BINS - list of binaries to be generated ()
  10. # COMPONENTS_xxx - a list of libs/objs in the form
  11. # subdir/lib to be extracted and rolled up into
  12. # a generated lib/image xxx.a ()
  13. #
  14. TARGET = eagle
  15. #FLAVOR = release
  16. FLAVOR = debug
  17. #EXTRA_CCFLAGS += -u
  18. ifndef PDIR # {
  19. GEN_IMAGES= eagle.app.v6.out
  20. GEN_BINS= eagle.app.v6.bin
  21. SPECIAL_MKTARGETS=$(APP_MKTARGETS)
  22. SUBDIRS= \
  23. user \
  24. driver \
  25. pcm \
  26. mbedtls \
  27. platform \
  28. libc \
  29. lua \
  30. lwip \
  31. coap \
  32. mqtt \
  33. task \
  34. u8glib \
  35. ucglib \
  36. smart \
  37. modules \
  38. spiffs \
  39. cjson \
  40. crypto \
  41. dhtlib \
  42. tsl2561 \
  43. net \
  44. http \
  45. fatfs \
  46. esp-gdbstub \
  47. websocket
  48. endif # } PDIR
  49. APPDIR = .
  50. LDDIR = ../ld
  51. CCFLAGS += -Os
  52. TARGET_LDFLAGS = \
  53. -nostdlib \
  54. -Wl,-EL \
  55. --longcalls \
  56. --text-section-literals
  57. ifeq ($(FLAVOR),debug)
  58. TARGET_LDFLAGS += -g -Os
  59. endif
  60. ifeq ($(FLAVOR),release)
  61. TARGET_LDFLAGS += -Os
  62. endif
  63. LD_FILE = $(LDDIR)/nodemcu.ld
  64. COMPONENTS_eagle.app.v6 = \
  65. user/libuser.a \
  66. driver/libdriver.a \
  67. pcm/pcm.a \
  68. platform/libplatform.a \
  69. task/libtask.a \
  70. libc/liblibc.a \
  71. lua/liblua.a \
  72. lwip/liblwip.a \
  73. coap/coap.a \
  74. mqtt/mqtt.a \
  75. u8glib/u8glib.a \
  76. ucglib/ucglib.a \
  77. smart/smart.a \
  78. spiffs/spiffs.a \
  79. fatfs/libfatfs.a \
  80. cjson/libcjson.a \
  81. crypto/libcrypto.a \
  82. dhtlib/libdhtlib.a \
  83. tsl2561/tsl2561lib.a \
  84. http/libhttp.a \
  85. websocket/libwebsocket.a \
  86. esp-gdbstub/libgdbstub.a \
  87. net/libnodemcu_net.a \
  88. mbedtls/libmbedtls.a \
  89. modules/libmodules.a \
  90. # Inspect the modules library and work out which modules need to be linked.
  91. # For each enabled module, a symbol name of the form XYZ_module_selected is
  92. # returned. At link time those names are declared undefined, so those (and
  93. # only those) modules are pulled in.
  94. SELECTED_MODULE_SYMS=$(filter %_module_selected %module_selected1,$(shell $(NM) modules/.output/$(TARGET)/$(FLAVOR)/lib/libmodules.a))
  95. LINKFLAGS_eagle.app.v6 = \
  96. -Wl,--gc-sections \
  97. -Wl,-Map=mapfile \
  98. -nostdlib \
  99. -T$(LD_FILE) \
  100. -Wl,@../ld/defsym.rom \
  101. -Wl,--no-check-sections \
  102. -Wl,--wrap=_xtos_set_exception_handler \
  103. -Wl,-static \
  104. $(addprefix -u , $(SELECTED_MODULE_SYMS)) \
  105. -Wl,--start-group \
  106. -lmain \
  107. -lc \
  108. -lgcc \
  109. -lhal \
  110. -lphy \
  111. -lpp \
  112. -lnet80211 \
  113. -lwpa \
  114. -lwpa2 \
  115. -lsmartconfig \
  116. -lcrypto \
  117. -lwps \
  118. $(DEP_LIBS_eagle.app.v6) \
  119. -Wl,--end-group \
  120. -lm
  121. DEPENDS_eagle.app.v6 = \
  122. $(LD_FILE) \
  123. Makefile
  124. #############################################################
  125. # Configuration i.e. compile options etc.
  126. # Target specific stuff (defines etc.) goes in here!
  127. # Generally values applying to a tree are captured in the
  128. # makefile at its root level - these are then overridden
  129. # for a subtree within the makefile rooted therein
  130. #
  131. #UNIVERSAL_TARGET_DEFINES = \
  132. # Other potential configuration flags include:
  133. # -DTXRX_TXBUF_DEBUG
  134. # -DTXRX_RXBUF_DEBUG
  135. # -DWLAN_CONFIG_CCX
  136. CONFIGURATION_DEFINES = -D__ets__ \
  137. -DICACHE_FLASH \
  138. -DLUA_OPTIMIZE_MEMORY=2 \
  139. -DMIN_OPT_LEVEL=2 \
  140. -DLWIP_OPEN_SRC \
  141. -DPBUF_RSV_FOR_WLAN \
  142. -DEBUF_LWIP \
  143. -DMBEDTLS_USER_CONFIG_FILE=\"user_mbedtls.h\" \
  144. DEFINES += \
  145. $(UNIVERSAL_TARGET_DEFINES) \
  146. $(CONFIGURATION_DEFINES)
  147. DDEFINES += \
  148. $(UNIVERSAL_TARGET_DEFINES) \
  149. $(CONFIGURATION_DEFINES)
  150. #############################################################
  151. # Recursion Magic - Don't touch this!!
  152. #
  153. # Each subtree potentially has an include directory
  154. # corresponding to the common APIs applicable to modules
  155. # rooted at that subtree. Accordingly, the INCLUDE PATH
  156. # of a module can only contain the include directories up
  157. # its parent path, and not its siblings
  158. #
  159. # Required for each makefile to inherit from the parent
  160. #
  161. INCLUDES := $(INCLUDES) -I $(PDIR)include
  162. INCLUDES += -I ./
  163. PDIR := ../$(PDIR)
  164. sinclude $(PDIR)Makefile
  165. .PHONY: FORCE
  166. FORCE: