-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile_All_StdlinkSec_MegaRf_Atmega256rfr2_8Mhz_Gcc
executable file
·258 lines (231 loc) · 12.3 KB
/
Makefile_All_StdlinkSec_MegaRf_Atmega256rfr2_8Mhz_Gcc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
COMPONENTS_PATH = ../../../../BitCloud/Components
APP_NAME = HADevice
CONFIG_NAME = All_StdlinkSec_MegaRf_Atmega256rfr2_8Mhz_Gcc
LIST_PATH = $(CONFIG_NAME)/List
EXE_PATH = $(CONFIG_NAME)/Exe
OBJ_PATH = $(CONFIG_NAME)/Obj
include ../../../../BitCloud/lib/Makerules_Atmega256rfr2_Gcc
DEFINES = \
-DHAL_8MHz \
-DBOARD_MEGARF \
-DATMEGA256RFR2 \
-DSTACK_TYPE_ALL \
-DSTDLINK_SECURITY_MODE
INCLUDES = \
-I../.. \
-I../../dimmableLight/include \
-I../../dimmerSwitch/include \
-I../../occupancySensor/include \
-I../../combinedInterface/include \
-I../../common/include \
-I../../common/clusters/include \
-I../../../../BitCloud/Components/BSP/MEGARF/include \
-I../../../../BitCloud/Components/SystemEnvironment/include \
-I../../../../BitCloud/lib \
-I../../../../BitCloud/Components/HAL/include \
-I../../../../BitCloud/Components/BSP \
-I../../../../BitCloud/Components/BSP/include \
-I../../../../BitCloud/Components/NWK/include \
-I../../../../BitCloud/Components/NWK/include/private \
-I../../../../BitCloud/Components/ZDO/include \
-I../../../../BitCloud/Components/ZDO/include/private \
-I../../../../BitCloud/Components/APS/include \
-I../../../../BitCloud/Components/APS/include/private \
-I../../../../BitCloud/Components/SystemEnvironment/include \
-I../../../../BitCloud/Components/ConfigServer/include \
-I../../../../BitCloud/Components/ConfigServer/include/private \
-I../../../../BitCloud/Components/PersistDataServer/include \
-I../../../../BitCloud/Components/PersistDataServer/std/include \
-I../../../../BitCloud/Components/PersistDataServer/wl/include \
-I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Types/include \
-I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Util/include \
-I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Timer/include \
-I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Task/include \
-I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_ErrH/include \
-I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Log/include \
-I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Memory/include \
-I../../../../BitCloud/Components/ZLLPlatform/Infrastructure/N_Init/include \
-I../../../../BitCloud/Components/ZLLPlatform/ZLL/S_Nv/include \
-I../../../../BitCloud/Components/ZLLPlatform/ZLL/D_Nv/include \
-I../../../../BitCloud/Components/Security/TrustCentre/include \
-I../../../../BitCloud/Components/Security/ServiceProvider/include \
-I../../../../BitCloud/Components/HAL/drivers/include \
-I../../../../BitCloud/Components/HAL/drivers/USBFIFO/include \
-I../../../../BitCloud/Components/HAL/avr/atmega128rfa1/common/include \
-I../../../../BitCloud/Components/ZCL/include/private \
-I../../../../BitCloud/Components/ZCL/include \
-I../../../../BitCloud/Components/HAL/drivers/include \
-I../../../../BitCloud/Components/HAL/drivers/OFD/include \
-I../../../../BitCloud/Components/HAL/drivers/ISD/include \
-I../../../../BitCloud/Components/HAL/drivers/include \
-I../../../../BitCloud/Components/HAL/drivers/OFD/include \
-I../../../../BitCloud/Components/HAL/drivers/ISD/include \
-I../../../../BitCloud/Components/MAC_PHY/include \
-I../../../../BitCloud/Components/MAC_PHY/MAC_ENV/include \
-I../../../../BitCloud/Components/MAC_PHY/MAC_HWI/include \
-I../../../../BitCloud/Components/MAC_PHY/MAC_HWD_PHY/include \
-I../../../../BitCloud/Components/MAC_PHY/MAC_HWD_PHY/ATMEGA128RFA1/PHY/include \
-I../../../../BitCloud/Components/MAC_PHY/MAC_HWD_PHY/ATMEGA128RFA1/MAC_HWD/include
LIBS = \
../../../../BitCloud/lib/libBc_All_StdlinkSec_Atmega256rfr2_Atmega256rfr2_Gcc.a \
../../../../BitCloud/lib/libHAL_MegaRf_Atmega256rfr2_8Mhz_Gcc.a \
../../../../BitCloud/lib/WdtInitatmega256rfr2_Gcc.o
SRCS = \
../../dimmableLight/src/dlIdentifyCluster.c \
../../dimmableLight/src/dlScenes.c \
../../dimmableLight/src/dlScenesCluster.c \
../../dimmableLight/src/dlOnOffCluster.c \
../../dimmableLight/src/dlPdt.c \
../../dimmableLight/src/dlLevelControlCluster.c \
../../dimmableLight/src/dlClusters.c \
../../dimmableLight/src/dlBasicCluster.c \
../../dimmableLight/src/dimmableLight.c \
../../dimmableLight/src/dlGroupsCluster.c \
../../dimmableLight/src/dlConsole.c \
../../occupancySensor/src/osBasicCluster.c \
../../occupancySensor/src/osIdentifyCluster.c \
../../occupancySensor/src/osClusters.c \
../../occupancySensor/src/osConsole.c \
../../occupancySensor/src/osPdt.c \
../../occupancySensor/src/occupancySensor.c \
../../occupancySensor/src/osOccupancySensingCluster.c \
../../dimmerSwitch/src/dsLevelControlCluster.c \
../../dimmerSwitch/src/dsIdentifyCluster.c \
../../dimmerSwitch/src/dsOnOffCluster.c \
../../dimmerSwitch/src/dimmerSwitch.c \
../../dimmerSwitch/src/dsConsole.c \
../../dimmerSwitch/src/dsBasicCluster.c \
../../dimmerSwitch/src/dsClusters.c \
../../combinedInterface/src/ciIdentifyCluster.c \
../../combinedInterface/src/ciClusters.c \
../../combinedInterface/src/ciConsole.c \
../../combinedInterface/src/ciLevelControlCluster.c \
../../combinedInterface/src/ciOnOffCluster.c \
../../combinedInterface/src/ciGroupsCluster.c \
../../combinedInterface/src/ciBasicCluster.c \
../../combinedInterface/src/ciOccupancySensingCluster.c \
../../combinedInterface/src/ciScenesCluster.c \
../../combinedInterface/src/combinedInterface.c \
../../common/src/commandManager.c \
../../common/src/console.c \
../../common/src/keyboardPoll.c \
../../common/src/uartManager.c \
../../common/src/otauService.c \
../../common/src/ezModeManager.c \
../../common/src/zclDevice.c \
../../common/clusters/src/haClusters.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsMemAccess.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsTimer.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsMem.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsWriteData.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsCrcService.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsInit.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsEvents.c \
../../../../BitCloud/Components/PersistDataServer/std/src/stdPdsDataServer.c \
../../../../BitCloud/Components/PersistDataServer/src/fakePds.c \
../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsDataServer.c \
../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsInit.c \
../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsSecurity.c \
../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsTypesConverter.c \
../../../../BitCloud/Components/PersistDataServer/wl/src/wlPdsTaskManager.c \
../../../../BitCloud/Components/ZLLPlatform/ZLL/S_Nv/src/S_Nv.c \
../../../../BitCloud/Components/ZLLPlatform/ZLL/S_Nv/src/S_Nv_Stub.c \
../../../../BitCloud/Components/ZLLPlatform/ZLL/D_Nv/src/D_Nv.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysIdleHandler.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysSleep.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysStat.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysEventsHandler.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysQueue.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysUtils.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysDuplicateTable.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysInit.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysTaskManager.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysTimer.c \
../../../../BitCloud/Components/SystemEnvironment/src/sysMutex.c \
../../../../BitCloud/Components/SystemEnvironment/src/dbg.c \
../../../../BitCloud/Components/HAL/drivers/OFD/src/ofdCommand.c \
../../../../BitCloud/Components/HAL/drivers/OFD/src/ofdAt45dbDriver.c \
../../../../BitCloud/Components/HAL/drivers/OFD/src/ofdSpiSerializer.c \
../../../../BitCloud/Components/HAL/drivers/OFD/src/ofdFakeDriver.c \
../../../../BitCloud/Components/HAL/drivers/OFD/src/ofdCrcService.c \
../../../../BitCloud/Components/HAL/drivers/OFD/src/ofdAt25Driver.c \
../../../../BitCloud/Components/ZCL/src/zclSecurityManager.c \
../../../../BitCloud/Components/ZCL/src/zclParser.c \
../../../../BitCloud/Components/ZCL/src/zclOtauServer.c \
../../../../BitCloud/Components/ZCL/src/zclTaskManager.c \
../../../../BitCloud/Components/ZCL/src/zclMemoryManager.c \
../../../../BitCloud/Components/ZCL/src/zclCommandAnalyzer.c \
../../../../BitCloud/Components/ZCL/src/zclAttributes.c \
../../../../BitCloud/Components/ZCL/src/zclOtauClient.c \
../../../../BitCloud/Components/ZCL/src/zclOtauManager.c \
../../../../BitCloud/Components/ZCL/src/zcl.c \
../../../../BitCloud/Components/ZCL/src/zclKeyEstablishmentCluster.c \
../../../../BitCloud/Components/ZCL/src/zclOtauDiscovery.c \
../../../../BitCloud/Components/BSP/MEGARF/src/xyl2rgb.c \
../../../../BitCloud/Components/BSP/MEGARF/src/bspTaskManager.c \
../../../../BitCloud/Components/BSP/MEGARF/src/hs2xy.c \
../../../../BitCloud/Components/BSP/MEGARF/src/buttons.c \
../../../../BitCloud/Components/BSP/MEGARF/src/MaxL.c \
../../../../BitCloud/Components/BSP/MEGARF/src/lcd.c \
../../../../BitCloud/Components/BSP/MEGARF/src/bspUid.c \
../../../../BitCloud/Components/BSP/MEGARF/src/leds.c \
../../../../BitCloud/Components/BSP/MEGARF/src/fakeBSP.c \
../../../../BitCloud/Components/HAL/drivers/USBFIFO/src/usbFifoVirtualUsart.c \
../../../../BitCloud/Components/HAL/drivers/USBFIFO/src/usbFifoFT245RL.c \
../../../../BitCloud/Components/HAL/drivers/ISD/src/isdImageStorage.c \
../../../../BitCloud/Components/HAL/drivers/ISD/src/isdConsoleTunneling.c \
../../../../BitCloud/Components/ConfigServer/src/csPersistentMem.c \
../../../../BitCloud/Components/ConfigServer/src/csMem.c \
../../../../BitCloud/Components/ConfigServer/src/configServer.c \
../../../../BitCloud/Components/HAL/drivers/OFD/src/ofdIntFlashRead.s
PREINCLUDE = MakerulesBc_All_StdlinkSec_Atmega256rfr2_Atmega256rfr2_Gcc.h
CSRCS = $(filter %.c, $(SRCS))
COBJS = $(addprefix $(OBJ_PATH)/, $(notdir %/$(subst .c,.o,$(CSRCS))))
ASM_FILE_EXT = s
ifneq (, $(findstring .$(ASM_FILE_EXT), $(SRCS)))
ASRCS = $(filter %.$(ASM_FILE_EXT), $(SRCS))
AOBJS += $(addprefix $(OBJ_PATH)/, $(notdir %$(subst .$(ASM_FILE_EXT),.o,$(ASRCS))))
endif
CFLAGS += $(DEFINES)
CFLAGS += $(INCLUDES)
CFLAGS += -include $(PREINCLUDE)
CFLAGS += -g
ASFLAGS = $(INCLUDES)
ASFLAGS += $(filter -mmcu%,$(CFLAGS))
LD = $(CC)
LINKER_FLAGS = -Wl,-Map=$(LIST_PATH)/$(APP_NAME).map -Wl,--gc-sections
LINKER_FLAGS += -Wl,--script=../../linkerScr/atmega256rfr2.ld
LINKER_FLAGS += -Wl,--section-start=.data=0x800200
LINKER_FLAGS += $(filter -mmcu%,$(CFLAGS))
LINKER_FLAGS += -Wl,--relax
.PHONY: all directories clean size root_files images
images: $(EXE_PATH)/$(APP_NAME).elf $(EXE_PATH)/$(APP_NAME).hex $(EXE_PATH)/$(APP_NAME).srec $(EXE_PATH)/$(APP_NAME).bin
all: directories images root_files size
$(COBJS): $(OBJ_PATH)/%.o: $(CSRCS) directories
$(CC) $(CFLAGS) $(filter %/$(subst .o,.c,$(notdir $@)), $(CSRCS)) -o $@
$(AOBJS): $(OBJ_PATH)/%.o: $(ASRCS) directories
$(AS) $(ASFLAGS) $(filter %/$(subst .o,.s,$(notdir $@)), $(ASRCS)) -o $@
$(EXE_PATH)/$(APP_NAME).elf: $(COBJS) $(AOBJS)
$(LD) $(LINKER_FLAGS) $(COBJS) $(AOBJS) -Wl,-\( $(LIBS) -Wl,-\) -o $@
$(EXE_PATH)/$(APP_NAME).srec: $(EXE_PATH)/$(APP_NAME).elf
$(OBJCOPY) -O srec --srec-len 128 $^ $@
$(EXE_PATH)/$(APP_NAME).hex: $(EXE_PATH)/$(APP_NAME).elf
$(OBJCOPY) -O ihex -R .eeprom $^ $@
$(EXE_PATH)/$(APP_NAME).bin: $(EXE_PATH)/$(APP_NAME).elf
$(OBJCOPY) -O binary --strip-debug --strip-unneeded -R .eeprom $^ $@
root_files: images
cp -f $(EXE_PATH)/*.* ./../../
clean:
rm -rf $(CONFIG_NAME) ../../$(APP_NAME).elf ../../$(APP_NAME).hex ../../$(APP_NAME).srec ../../$(APP_NAME).bin
directories:
@"mkdir" -p $(LIST_PATH)
@"mkdir" -p $(EXE_PATH)
@"mkdir" -p $(OBJ_PATH)
size: $(EXE_PATH)/$(APP_NAME).elf
@echo
@$(SIZE) -td $(EXE_PATH)/$(APP_NAME).elf
ifeq ($(MAKECMDGOALS), fresh)
directories: clean
endif
fresh: all
# eof Makefile