Makefile 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  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. platform \
  26. libc \
  27. lua \
  28. lwip \
  29. coap \
  30. mqtt \
  31. task \
  32. u8glib \
  33. ucglib \
  34. smart \
  35. modules \
  36. spiffs \
  37. cjson \
  38. crypto \
  39. dhtlib \
  40. tsl2561 \
  41. net \
  42. http
  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. platform/libplatform.a \
  63. task/libtask.a \
  64. libc/liblibc.a \
  65. lua/liblua.a \
  66. lwip/liblwip.a \
  67. coap/coap.a \
  68. mqtt/mqtt.a \
  69. u8glib/u8glib.a \
  70. ucglib/ucglib.a \
  71. smart/smart.a \
  72. spiffs/spiffs.a \
  73. cjson/libcjson.a \
  74. crypto/libcrypto.a \
  75. dhtlib/libdhtlib.a \
  76. tsl2561/tsl2561lib.a \
  77. http/libhttp.a \
  78. net/libnodemcu_net.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. -lsmartconfig \
  106. -lssl \
  107. -lcrypto \
  108. $(DEP_LIBS_eagle.app.v6) \
  109. -Wl,--end-group \
  110. -lm
  111. DEPENDS_eagle.app.v6 = \
  112. $(LD_FILE) \
  113. Makefile
  114. #############################################################
  115. # Configuration i.e. compile options etc.
  116. # Target specific stuff (defines etc.) goes in here!
  117. # Generally values applying to a tree are captured in the
  118. # makefile at its root level - these are then overridden
  119. # for a subtree within the makefile rooted therein
  120. #
  121. #UNIVERSAL_TARGET_DEFINES = \
  122. # Other potential configuration flags include:
  123. # -DTXRX_TXBUF_DEBUG
  124. # -DTXRX_RXBUF_DEBUG
  125. # -DWLAN_CONFIG_CCX
  126. CONFIGURATION_DEFINES = -D__ets__ \
  127. -DICACHE_FLASH \
  128. -DLUA_OPTIMIZE_MEMORY=2 \
  129. -DMIN_OPT_LEVEL=2 \
  130. -DLWIP_OPEN_SRC \
  131. -DPBUF_RSV_FOR_WLAN \
  132. -DEBUF_LWIP \
  133. DEFINES += \
  134. $(UNIVERSAL_TARGET_DEFINES) \
  135. $(CONFIGURATION_DEFINES)
  136. DDEFINES += \
  137. $(UNIVERSAL_TARGET_DEFINES) \
  138. $(CONFIGURATION_DEFINES)
  139. #############################################################
  140. # Recursion Magic - Don't touch this!!
  141. #
  142. # Each subtree potentially has an include directory
  143. # corresponding to the common APIs applicable to modules
  144. # rooted at that subtree. Accordingly, the INCLUDE PATH
  145. # of a module can only contain the include directories up
  146. # its parent path, and not its siblings
  147. #
  148. # Required for each makefile to inherit from the parent
  149. #
  150. INCLUDES := $(INCLUDES) -I $(PDIR)include
  151. INCLUDES += -I ./
  152. PDIR := ../$(PDIR)
  153. sinclude $(PDIR)Makefile
  154. .PHONY: FORCE
  155. FORCE: