Makefile 4.2 KB

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