Advertisement
alex_novinski

Untitled

Mar 15th, 2016
166
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 8.82 KB | None | 0 0
  1. COMPONENTS_PATH = ../../../../BitCloud/Components
  2. APP_NAME = Blink
  3. CONFIG_NAME = All_MegaRf_Atmega256rfr2_8Mhz_Gcc
  4. LIST_PATH = $(CONFIG_NAME)/List
  5. EXE_PATH = $(CONFIG_NAME)/Exe
  6. OBJ_PATH = $(CONFIG_NAME)/Obj
  7.  
  8. include ../../../../BitCloud/lib/Makerules_Atmega256rfr2_Gcc
  9.  
  10. DEFINES = \
  11.   -DBOARD_MEGARF \
  12.   -DATMEGA256RFR2 \
  13.   -DHAL_8MHz \
  14.   -DNO_SECURITY_MODE \
  15.   -DSTACK_TYPE_ALL
  16.  
  17. INCLUDES = \
  18.   -I../.. \
  19.   -I../../include \
  20.   -I../../../../BitCloud/Components/BSP/MEGARF/include \
  21.   -I../../../../BitCloud/Components/SystemEnvironment/include \
  22.   -I../../../../BitCloud/lib \
  23.   -I../../../../BitCloud/Components/HAL/include \
  24.   -I../../../../BitCloud/Components/BSP \
  25.   -I../../../../BitCloud/Components/BSP/include \
  26.   -I../../../../BitCloud/Components/NWK/include \
  27.   -I../../../../BitCloud/Components/NWK/include/private \
  28.   -I../../../../BitCloud/Components/ZDO/include \
  29.   -I../../../../BitCloud/Components/ZDO/include/private \
  30.   -I../../../../BitCloud/Components/APS/include \
  31.   -I../../../../BitCloud/Components/APS/include/private \
  32.   -I../../../../BitCloud/Components/SystemEnvironment/include \
  33.   -I../../../../BitCloud/Components/ConfigServer/include \
  34.   -I../../../../BitCloud/Components/ConfigServer/include/private \
  35.   -I../../../../BitCloud/Components/PersistDataServer/include \
  36.   -I../../../../BitCloud/Components/PersistDataServer/std/include \
  37.   -I../../../../BitCloud/Components/PersistDataServer/wl/include \
  38.   -I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Types/include \
  39.   -I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Util/include \
  40.   -I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Timer/include \
  41.   -I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Task/include \
  42.   -I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_ErrH/include \
  43.   -I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Log/include \
  44.   -I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Memory/include \
  45.   -I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Init/include \
  46.   -I../../../../BitCloud/Components/ZLLPlatform/ZLL/S_Nv/include \
  47.   -I../../../../BitCloud/Components/ZLLPlatform/ZLL/S_XNv/include \
  48.   -I../../../../BitCloud/Components/ZLLPlatform/ZLL/D_Nv/include \
  49.   -I../../../../BitCloud/Components/ZLLPlatform/ZLL/D_XNv/include \
  50.   -I../../../../BitCloud/Components/ZLLPlatform/ZLL/D_XNv/src \
  51.   -I../../../../BitCloud/Components/ZLLPlatform/ZLL/S_XNv/src \
  52.   -I../../../../BitCloud/Components/Security/TrustCentre/include \
  53.   -I../../../../BitCloud/Components/Security/ServiceProvider/include \
  54.   -I../../../../BitCloud/Components/HAL/drivers/include \
  55.   -I../../../../BitCloud/Components/HAL/drivers/USBFIFO/include \
  56.   -I../../../../BitCloud/Components/HAL/avr/atmega128rfa1/common/include \
  57.   -I../../../../BitCloud/Components/MAC_PHY/include \
  58.   -I../../../../BitCloud/Components/MAC_PHY/MAC_ENV/include \
  59.   -I../../../../BitCloud/Components/MAC_PHY/MAC_HWI/include \
  60.   -I../../../../BitCloud/Components/MAC_PHY/MAC_HWD_PHY/include \
  61.   -I../../../../BitCloud/Components/MAC_PHY/MAC_HWD_PHY/ATMEGA128RFA1/PHY/include \
  62.   -I../../../../BitCloud/Components/MAC_PHY/MAC_HWD_PHY/ATMEGA128RFA1/MAC_HWD/include
  63.  
  64. LIBS = \
  65.   ../../../../BitCloud/lib/libBc_All_Atmega256rfr2_Atmega256rfr2_Gcc.a \
  66.   ../../../../BitCloud/lib/libHAL_MegaRf_Atmega256rfr2_8Mhz_Gcc.a \
  67.   ../../../../BitCloud/lib/WdtInitatmega256rfr2_Gcc.o
  68.  
  69. SRCS = \
  70.   ../../src/blink.c \
  71.   ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsMemAccess.c \
  72.   ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsTimer.c \
  73.   ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsMem.c \
  74.   ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsWriteData.c \
  75.   ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsCrcService.c \
  76.   ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsInit.c \
  77.   ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsEvents.c \
  78.   ../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsDataServer.c \
  79.   ../../../../BitCloud/Components/PersistDataServer/src/fakePds.c \
  80.   ../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsTypesConverter.c \
  81.   ../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsTaskManager.c \
  82.   ../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsSecurity.c \
  83.   ../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsInit.c \
  84.   ../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsDataServer.c \
  85.   ../../../../BitCloud/Components/ZLLPlatform/ZLL/S_Nv/src/S_Nv.c \
  86.   ../../../../BitCloud/Components/ZLLPlatform/ZLL/S_XNv/src/S_XNv.c \
  87.   ../../../../BitCloud/Components/ZLLPlatform/ZLL/S_Nv/src/S_Nv-External.c \
  88.   ../../../../BitCloud/Components/ZLLPlatform/ZLL/D_Nv/src/D_Nv.c \
  89.   ../../../../BitCloud/Components/ZLLPlatform/ZLL/S_Nv/src/S_Nv_Stub.c \
  90.   ../../../../BitCloud/Components/SystemEnvironment/src/sysIdleHandler.c \
  91.   ../../../../BitCloud/Components/SystemEnvironment/src/sysSleep.c \
  92.   ../../../../BitCloud/Components/SystemEnvironment/src/sysStat.c \
  93.   ../../../../BitCloud/Components/SystemEnvironment/src/sysEventsHandler.c \
  94.   ../../../../BitCloud/Components/SystemEnvironment/src/sysQueue.c \
  95.   ../../../../BitCloud/Components/SystemEnvironment/src/sysUtils.c \
  96.   ../../../../BitCloud/Components/SystemEnvironment/src/sysAssert.c \
  97.   ../../../../BitCloud/Components/SystemEnvironment/src/sysDuplicateTable.c \
  98.   ../../../../BitCloud/Components/SystemEnvironment/src/sysInit.c \
  99.   ../../../../BitCloud/Components/SystemEnvironment/src/sysTaskManager.c \
  100.   ../../../../BitCloud/Components/SystemEnvironment/src/dbg.c \
  101.   ../../../../BitCloud/Components/SystemEnvironment/src/sysMutex.c \
  102.   ../../../../BitCloud/Components/SystemEnvironment/src/sysTimer.c \
  103.   ../../../../BitCloud/Components/BSP/MEGARF/src/xyl2rgb.c \
  104.   ../../../../BitCloud/Components/BSP/MEGARF/src/bspVoltageSensor.c \
  105.   ../../../../BitCloud/Components/BSP/MEGARF/src/bspTaskManager.c \
  106.   ../../../../BitCloud/Components/BSP/MEGARF/src/bspTempSensor.c \
  107.   ../../../../BitCloud/Components/BSP/MEGARF/src/hs2xy.c \
  108.   ../../../../BitCloud/Components/BSP/MEGARF/src/buttons.c \
  109.   ../../../../BitCloud/Components/BSP/MEGARF/src/MaxL.c \
  110.   ../../../../BitCloud/Components/BSP/MEGARF/src/lcd.c \
  111.   ../../../../BitCloud/Components/BSP/MEGARF/src/bspUid.c \
  112.   ../../../../BitCloud/Components/BSP/MEGARF/src/leds.c \
  113.   ../../../../BitCloud/Components/BSP/MEGARF/src/fakeBSP.c \
  114.   ../../../../BitCloud/Components/HAL/drivers/USBFIFO/src/usbFifoVirtualUsart.c \
  115.   ../../../../BitCloud/Components/HAL/drivers/USBFIFO/src/usbFifoFT245RL.c \
  116.   ../../../../BitCloud/Components/ConfigServer/src/csPersistentMem.c \
  117.   ../../../../BitCloud/Components/ConfigServer/src/csMem.c \
  118.   ../../../../BitCloud/Components/ConfigServer/src/configServer.c
  119.  
  120. PREINCLUDE = MakerulesBc_All_Atmega256rfr2_Atmega256rfr2_Gcc.h
  121.  
  122. CSRCS = $(filter %.c, $(SRCS))
  123. OBJS = $(addprefix $(OBJ_PATH)/, $(notdir %/$(subst .c,.o,$(CSRCS))))
  124.  
  125. ASM_FILE_EXT = s
  126.  
  127. ifneq (, $(findstring .$(ASM_FILE_EXT), $(SRCS)))
  128.   ASRCS = $(filter %.$(ASM_FILE_EXT), $(SRCS))
  129.   OBJS += $(addprefix $(OBJ_PATH)/, $(notdir %$(subst .$(ASM_FILE_EXT),.o,$(ASRCS))))
  130. endif
  131.  
  132. CFLAGS += $(DEFINES)
  133. CFLAGS += $(INCLUDES)
  134. CFLAGS += --include $(PREINCLUDE)
  135. CFLAGS += -g
  136.  
  137. ASFLAGS = $(INCLUDES)
  138. ASFLAGS += $(filter -mmcu%,$(CFLAGS))
  139.  
  140. LD = $(CC)
  141. LINKER_FLAGS = -Wl,-Map=$(LIST_PATH)/$(APP_NAME).map -Wl,--gc-sections
  142. LINKER_FLAGS += -Wl,--script=../../linkerScr/atmega256rfr2.ld
  143. LINKER_FLAGS += -Wl,--section-start=.data=0x800200
  144. LINKER_FLAGS += $(filter -mmcu%,$(CFLAGS))
  145. LINKER_FLAGS += -Wl,--relax
  146.  
  147. .PHONY: all directories clean size root_files images
  148.  
  149. images: $(EXE_PATH)/$(APP_NAME).elf $(EXE_PATH)/$(APP_NAME).hex $(EXE_PATH)/$(APP_NAME).srec $(EXE_PATH)/$(APP_NAME).bin
  150.  
  151. all: directories images root_files size
  152.  
  153. $(OBJ_PATH)/%.o: $(SRCS)
  154.     $(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir $@)), $(SRCS)) -o $@
  155.  
  156. $(OBJS): directories
  157.  
  158.  
  159. $(EXE_PATH)/$(APP_NAME).elf: $(OBJS)
  160.     $(LD) $(LINKER_FLAGS) $(OBJS) -Wl,-\( $(LIBS) -Wl,-\) -o $@
  161.  
  162. $(EXE_PATH)/$(APP_NAME).srec: $(EXE_PATH)/$(APP_NAME).elf
  163.     $(OBJCOPY) -O srec --srec-len 128 $^ $@
  164.  
  165. $(EXE_PATH)/$(APP_NAME).hex: $(EXE_PATH)/$(APP_NAME).elf
  166.     $(OBJCOPY) -O ihex -R .eeprom $^ $@
  167.  
  168. $(EXE_PATH)/$(APP_NAME).bin: $(EXE_PATH)/$(APP_NAME).elf
  169.     $(OBJCOPY) -O binary --strip-debug --strip-unneeded -R .eeprom $^ $@
  170.  
  171. root_files: images
  172.     cp -f $(EXE_PATH)/*.* ./../../
  173.  
  174. clean:
  175.     rm -rf $(CONFIG_NAME) ../../$(APP_NAME).elf ../../$(APP_NAME).hex ../../$(APP_NAME).srec ../../$(APP_NAME).bin
  176.  
  177. directories:
  178.     @"mkdir" -p $(LIST_PATH)
  179.     @"mkdir" -p $(EXE_PATH)
  180.     @"mkdir" -p $(OBJ_PATH)
  181.  
  182. size: $(EXE_PATH)/$(APP_NAME).elf
  183.     @echo
  184.     @$(SIZE) -td $(EXE_PATH)/$(APP_NAME).elf
  185.  
  186. ifeq ($(MAKECMDGOALS), fresh)
  187. directories: clean
  188. endif
  189. fresh: all
  190.  
  191. # eof Makefile
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement