Makefile 4.3 KB

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