Makefile 3.7 KB

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