Makefile 4.1 KB

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