Makefile 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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. ifdef AT_OPEN_SRC
  25. SUBDIRS += \
  26. at
  27. endif
  28. endif # } PDIR
  29. APPDIR = .
  30. LDDIR = ../ld
  31. CCFLAGS += -Os
  32. TARGET_LDFLAGS = \
  33. -nostdlib \
  34. -Wl,-EL \
  35. --longcalls \
  36. --text-section-literals
  37. ifeq ($(FLAVOR),debug)
  38. TARGET_LDFLAGS += -g -O2
  39. endif
  40. ifeq ($(FLAVOR),release)
  41. TARGET_LDFLAGS += -g -O0
  42. endif
  43. COMPONENTS_eagle.app.v6 = \
  44. user/libuser.a
  45. ifdef AT_OPEN_SRC
  46. COMPONENTS_eagle.app.v6 += \
  47. at/libat.a
  48. endif
  49. LINKFLAGS_eagle.app.v6 = \
  50. -L../lib \
  51. -nostdlib \
  52. -T$(LD_FILE) \
  53. -Wl,--no-check-sections \
  54. -u call_user_start \
  55. -Wl,-static \
  56. -Wl,--start-group \
  57. -lc \
  58. -lgcc \
  59. -lhal \
  60. -lphy \
  61. -lpp \
  62. -lnet80211 \
  63. -llwip \
  64. -lwpa \
  65. -lmain \
  66. -ljson \
  67. -lupgrade \
  68. -lsmartconfig \
  69. $(DEP_LIBS_eagle.app.v6)
  70. ifndef AT_OPEN_SRC
  71. LINKFLAGS_eagle.app.v6 += \
  72. -lat
  73. endif
  74. LINKFLAGS_eagle.app.v6 += \
  75. -Wl,--end-group
  76. DEPENDS_eagle.app.v6 = \
  77. $(LD_FILE) \
  78. $(LDDIR)/eagle.rom.addr.v6.ld
  79. #############################################################
  80. # Configuration i.e. compile options etc.
  81. # Target specific stuff (defines etc.) goes in here!
  82. # Generally values applying to a tree are captured in the
  83. # makefile at its root level - these are then overridden
  84. # for a subtree within the makefile rooted therein
  85. #
  86. #UNIVERSAL_TARGET_DEFINES = \
  87. # Other potential configuration flags include:
  88. # -DTXRX_TXBUF_DEBUG
  89. # -DTXRX_RXBUF_DEBUG
  90. # -DWLAN_CONFIG_CCX
  91. CONFIGURATION_DEFINES = -DICACHE_FLASH
  92. ifdef AT_OPEN_SRC
  93. CONFIGURATION_DEFINES += \
  94. -DAT_OPEN_SRC
  95. endif
  96. ifeq ($(APP),0)
  97. else
  98. CONFIGURATION_DEFINES += \
  99. -DAT_UPGRADE_SUPPORT
  100. endif
  101. DEFINES += \
  102. $(UNIVERSAL_TARGET_DEFINES) \
  103. $(CONFIGURATION_DEFINES)
  104. DDEFINES += \
  105. $(UNIVERSAL_TARGET_DEFINES) \
  106. $(CONFIGURATION_DEFINES)
  107. #############################################################
  108. # Recursion Magic - Don't touch this!!
  109. #
  110. # Each subtree potentially has an include directory
  111. # corresponding to the common APIs applicable to modules
  112. # rooted at that subtree. Accordingly, the INCLUDE PATH
  113. # of a module can only contain the include directories up
  114. # its parent path, and not its siblings
  115. #
  116. # Required for each makefile to inherit from the parent
  117. #
  118. INCLUDES := $(INCLUDES) -I $(PDIR)include
  119. PDIR := ../$(PDIR)
  120. sinclude $(PDIR)Makefile
  121. .PHONY: FORCE
  122. FORCE: