Makefile 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  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. crypto \
  40. dhtlib \
  41. tsl2561 \
  42. net \
  43. http \
  44. fatfs \
  45. esp-gdbstub \
  46. websocket \
  47. swTimer \
  48. misc \
  49. pm \
  50. endif # } PDIR
  51. APPDIR = .
  52. LDDIR = ../ld
  53. CCFLAGS += -Os
  54. TARGET_LDFLAGS = \
  55. -nostdlib \
  56. -Wl,-EL \
  57. --longcalls \
  58. --text-section-literals
  59. ifeq ($(FLAVOR),debug)
  60. TARGET_LDFLAGS += -g -Os
  61. endif
  62. ifeq ($(FLAVOR),release)
  63. TARGET_LDFLAGS += -Os
  64. endif
  65. LD_FILE = $(LDDIR)/nodemcu.ld
  66. COMPONENTS_eagle.app.v6 = \
  67. user/libuser.a \
  68. driver/libdriver.a \
  69. pcm/pcm.a \
  70. platform/libplatform.a \
  71. task/libtask.a \
  72. libc/liblibc.a \
  73. lua/liblua.a \
  74. lwip/liblwip.a \
  75. coap/coap.a \
  76. mqtt/mqtt.a \
  77. u8glib/u8glib.a \
  78. ucglib/ucglib.a \
  79. smart/smart.a \
  80. spiffs/spiffs.a \
  81. fatfs/libfatfs.a \
  82. crypto/libcrypto.a \
  83. dhtlib/libdhtlib.a \
  84. tsl2561/tsl2561lib.a \
  85. http/libhttp.a \
  86. pm/libpm.a \
  87. websocket/libwebsocket.a \
  88. esp-gdbstub/libgdbstub.a \
  89. net/libnodemcu_net.a \
  90. mbedtls/libmbedtls.a \
  91. modules/libmodules.a \
  92. swTimer/libswtimer.a \
  93. misc/libmisc.a \
  94. # Inspect the modules library and work out which modules need to be linked.
  95. # For each enabled module, a symbol name of the form XYZ_module_selected is
  96. # returned. At link time those names are declared undefined, so those (and
  97. # only those) modules are pulled in.
  98. SELECTED_MODULE_SYMS=$(filter %_module_selected %module_selected1,$(shell $(NM) modules/.output/$(TARGET)/$(FLAVOR)/lib/libmodules.a))
  99. LINKFLAGS_eagle.app.v6 = \
  100. -Wl,--gc-sections \
  101. -Wl,-Map=mapfile \
  102. -nostdlib \
  103. -T$(LD_FILE) \
  104. -Wl,@../ld/defsym.rom \
  105. -Wl,--no-check-sections \
  106. -Wl,--wrap=_xtos_set_exception_handler \
  107. -Wl,-static \
  108. $(addprefix -u , $(SELECTED_MODULE_SYMS)) \
  109. -Wl,--start-group \
  110. -lmain \
  111. -lc \
  112. -lgcc \
  113. -lhal \
  114. -lphy \
  115. -lpp \
  116. -lnet80211 \
  117. -lwpa \
  118. -lwpa2 \
  119. -lsmartconfig \
  120. -lcrypto \
  121. -lwps \
  122. $(DEP_LIBS_eagle.app.v6) \
  123. -Wl,--end-group \
  124. -lm
  125. DEPENDS_eagle.app.v6 = \
  126. $(LD_FILE) \
  127. Makefile
  128. #############################################################
  129. # Configuration i.e. compile options etc.
  130. # Target specific stuff (defines etc.) goes in here!
  131. # Generally values applying to a tree are captured in the
  132. # makefile at its root level - these are then overridden
  133. # for a subtree within the makefile rooted therein
  134. #
  135. #UNIVERSAL_TARGET_DEFINES = \
  136. # Other potential configuration flags include:
  137. # -DTXRX_TXBUF_DEBUG
  138. # -DTXRX_RXBUF_DEBUG
  139. # -DWLAN_CONFIG_CCX
  140. CONFIGURATION_DEFINES = -D__ets__ \
  141. -DICACHE_FLASH \
  142. -DLUA_OPTIMIZE_MEMORY=2 \
  143. -DMIN_OPT_LEVEL=2 \
  144. -DLWIP_OPEN_SRC \
  145. -DPBUF_RSV_FOR_WLAN \
  146. -DEBUF_LWIP \
  147. -DMBEDTLS_USER_CONFIG_FILE=\"user_mbedtls.h\" \
  148. DEFINES += \
  149. $(UNIVERSAL_TARGET_DEFINES) \
  150. $(CONFIGURATION_DEFINES)
  151. DDEFINES += \
  152. $(UNIVERSAL_TARGET_DEFINES) \
  153. $(CONFIGURATION_DEFINES)
  154. #############################################################
  155. # Recursion Magic - Don't touch this!!
  156. #
  157. # Each subtree potentially has an include directory
  158. # corresponding to the common APIs applicable to modules
  159. # rooted at that subtree. Accordingly, the INCLUDE PATH
  160. # of a module can only contain the include directories up
  161. # its parent path, and not its siblings
  162. #
  163. # Required for each makefile to inherit from the parent
  164. #
  165. INCLUDES := $(INCLUDES) -I $(PDIR)include
  166. INCLUDES += -I ./
  167. PDIR := ../$(PDIR)
  168. sinclude $(PDIR)Makefile
  169. .PHONY: FORCE
  170. FORCE: