Advertisement
Guest User

Untitled

a guest
Jan 13th, 2015
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 3.22 KB | None | 0 0
  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.  
  18. #EXTRA_CCFLAGS += -u
  19.  
  20. ifndef PDIR # {
  21. GEN_IMAGES= eagle.app.v6.out
  22. GEN_BINS= eagle.app.v6.bin
  23. SPECIAL_MKTARGETS=$(APP_MKTARGETS)
  24. SUBDIRS=    \
  25.     user    \
  26.     driver
  27.  
  28. endif # } PDIR
  29.  
  30. APPDIR = .
  31. LDDIR = ../ld
  32.  
  33. CCFLAGS += -Os
  34.  
  35. TARGET_LDFLAGS =        \
  36.     -nostdlib       \
  37.     -Wl,-EL \
  38.     --longcalls \
  39.     --text-section-literals
  40.  
  41. ifeq ($(FLAVOR),debug)
  42.     TARGET_LDFLAGS += -g -O2
  43. endif
  44.  
  45. ifeq ($(FLAVOR),release)
  46.     TARGET_LDFLAGS += -g -O0
  47. endif
  48.  
  49. LD_FILE = $(LDDIR)/eagle.app.v6.ld
  50.  
  51. ifeq ($(APP), 1)
  52.     LD_FILE = $(LDDIR)/eagle.app.v6.app1.ld
  53. endif
  54.  
  55. ifeq ($(APP), 2)
  56.     LD_FILE = $(LDDIR)/eagle.app.v6.app2.ld
  57. endif
  58.  
  59. COMPONENTS_eagle.app.v6 = \
  60.     user/libuser.a  \
  61.     driver/libdriver.a
  62.  
  63. LINKFLAGS_eagle.app.v6 = \
  64.     -L../lib        \
  65.     -nostdlib   \
  66.     -T$(LD_FILE)   \
  67.     -Wl,--no-check-sections \
  68.     -u call_user_start  \
  69.     -Wl,-static                     \
  70.     -Wl,--start-group                   \
  71.     -lc                 \
  72.     -lgcc                   \
  73.     -lhal                   \
  74.     -lphy   \
  75.     -lpp    \
  76.     -lnet80211  \
  77.     -llwip  \
  78.     -lwpa   \
  79.     -lmain  \
  80.     -ljson  \
  81.     -lupgrade\
  82.     $(DEP_LIBS_eagle.app.v6)                    \
  83.     -Wl,--end-group
  84.  
  85. DEPENDS_eagle.app.v6 = \
  86.                 $(LD_FILE) \
  87.                 $(LDDIR)/eagle.rom.addr.v6.ld
  88.  
  89. #############################################################
  90. # Configuration i.e. compile options etc.
  91. # Target specific stuff (defines etc.) goes in here!
  92. # Generally values applying to a tree are captured in the
  93. #   makefile at its root level - these are then overridden
  94. #   for a subtree within the makefile rooted therein
  95. #
  96.  
  97. #UNIVERSAL_TARGET_DEFINES =     \
  98.  
  99. # Other potential configuration flags include:
  100. #   -DTXRX_TXBUF_DEBUG
  101. #   -DTXRX_RXBUF_DEBUG
  102. #   -DWLAN_CONFIG_CCX
  103. CONFIGURATION_DEFINES = -D__ets__ \
  104.             -DICACHE_FLASH
  105.  
  106. DEFINES +=              \
  107.     $(UNIVERSAL_TARGET_DEFINES) \
  108.     $(CONFIGURATION_DEFINES)
  109.  
  110. DDEFINES +=             \
  111.     $(UNIVERSAL_TARGET_DEFINES) \
  112.     $(CONFIGURATION_DEFINES)
  113.  
  114.  
  115. #############################################################
  116. # Recursion Magic - Don't touch this!!
  117. #
  118. # Each subtree potentially has an include directory
  119. #   corresponding to the common APIs applicable to modules
  120. #   rooted at that subtree. Accordingly, the INCLUDE PATH
  121. #   of a module can only contain the include directories up
  122. #   its parent path, and not its siblings
  123. #
  124. # Required for each makefile to inherit from the parent
  125. #
  126.  
  127. INCLUDES := $(INCLUDES) -I $(PDIR)include
  128. INCLUDES += -I ./
  129. PDIR := ../$(PDIR)
  130. sinclude $(PDIR)Makefile
  131.  
  132. #########################################################################
  133. #
  134. #  generate bin file
  135. #
  136.  
  137. $(BINODIR)/%.bin: $(IMAGEODIR)/%.out
  138.     @mkdir -p $(BINODIR)
  139.     $(OBJCOPY) -O binary $< $@
  140.  
  141. .PHONY: FORCE
  142. FORCE:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement