TEST

Dependencies:   max32630fthr Adafruit_FeatherOLED USBDevice

Committer:
wwwarunraj
Date:
Sun Apr 19 11:19:57 2020 +0000
Revision:
4:291477e8690d
Parent:
1:f60eafbf009a
19/04

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gmehmet 1:f60eafbf009a 1 PROJECT_PATH=$(realpath ./)
gmehmet 1:f60eafbf009a 2 PROJECT_NAME=$(shell basename $(realpath ./))
gmehmet 1:f60eafbf009a 3 PROJECT_BUILD_PATH=$(realpath BUILD/)
gmehmet 1:f60eafbf009a 4 PROJECT_TOOLS_PATH=$(realpath tools/)
gmehmet 1:f60eafbf009a 5 PROJECT_CONFIGS_PATH=$(realpath configs/)
gmehmet 1:f60eafbf009a 6 PROJECT_TOOLCHAIN=GCC_ARM
gmehmet 1:f60eafbf009a 7 PROJECT_SCM_BRANCH=$(shell git rev-parse --abbrev-ref HEAD)
gmehmet 1:f60eafbf009a 8 PROJECT_SCM_HASH=$(shell git rev-parse HEAD)
gmehmet 1:f60eafbf009a 9 -include .config
gmehmet 1:f60eafbf009a 10
gmehmet 1:f60eafbf009a 11 STACK_SIZE ?= 0x30000
gmehmet 1:f60eafbf009a 12 HEAP_SIZE ?= 0x30000
gmehmet 1:f60eafbf009a 13
gmehmet 1:f60eafbf009a 14 $(info STACK_SIZE: ${STACK_SIZE}, HEAP_SIZE: ${HEAP_SIZE})
gmehmet 1:f60eafbf009a 15
gmehmet 1:f60eafbf009a 16 ALGO_DIR = Algorithms/
gmehmet 1:f60eafbf009a 17 DRIVERS_DIR = Drivers/
gmehmet 1:f60eafbf009a 18 INTERFACES_DIR = Interfaces/
gmehmet 1:f60eafbf009a 19 SCOMMS_DIR = $(INTERFACES_DIR)/SensorComm/
gmehmet 1:f60eafbf009a 20 DSINT_DIR = $(INTERFACES_DIR)/DeviceStudio/
gmehmet 1:f60eafbf009a 21 SSCOMMS_DIR = $(SCOMMS_DIR)/SmartSensorComm/
gmehmet 1:f60eafbf009a 22 SSINT_DIR = $(INTERFACES_DIR)/SmartSensor/
gmehmet 1:f60eafbf009a 23 PLATFORMS_DIR = Platforms/
gmehmet 1:f60eafbf009a 24
gmehmet 1:f60eafbf009a 25 EXTERNAL_SOURCES += mbed-os
gmehmet 1:f60eafbf009a 26 EXTERNAL_SOURCES += $(DRIVERS_DIR)USBDevice
gmehmet 1:f60eafbf009a 27 PROJECT_SOURCES += $(wildcard *.cpp)
gmehmet 1:f60eafbf009a 28 PROJECT_SOURCES += $(wildcard *.h)
gmehmet 1:f60eafbf009a 29 PROJECT_SOURCES += $(SCOMMS_DIR)/SensorComm
gmehmet 1:f60eafbf009a 30 PROJECT_SOURCES += $(DSINT_DIR)
gmehmet 1:f60eafbf009a 31 PROJECT_SOURCES += $(DRIVERS_DIR)MaximSensor
gmehmet 1:f60eafbf009a 32 PROJECT_SOURCES += Utilities
gmehmet 1:f60eafbf009a 33
gmehmet 1:f60eafbf009a 34 ## BEGIN PLATFORM ##
gmehmet 1:f60eafbf009a 35 ifeq ($(CONFIG_PLATFORM_MAX32600MBED), y)
gmehmet 1:f60eafbf009a 36 CONFIG_FLAGS += PLATFORM_MAX32600MBED
gmehmet 1:f60eafbf009a 37 CONFIG_PLATFORM_NAME=MAX32600MBED
gmehmet 1:f60eafbf009a 38
gmehmet 1:f60eafbf009a 39 else ifeq ($(CONFIG_PLATFORM_MAX32625MBED), y)
gmehmet 1:f60eafbf009a 40 CONFIG_FLAGS += PLATFORM_MAX32625MBED
gmehmet 1:f60eafbf009a 41 CONFIG_PLATFORM_NAME=MAX32625MBED
gmehmet 1:f60eafbf009a 42 PROJECT_SOURCES += $(PLATFORMS_DIR)max32625mbed
gmehmet 1:f60eafbf009a 43
gmehmet 1:f60eafbf009a 44 else ifeq ($(CONFIG_PLATFORM_MAX32630FTHR), y)
gmehmet 1:f60eafbf009a 45 CONFIG_FLAGS += PLATFORM_MAX32630FTHR
gmehmet 1:f60eafbf009a 46 CONFIG_PLATFORM_NAME=MAX32630FTHR
gmehmet 1:f60eafbf009a 47 EXTERNAL_SOURCES += $(PLATFORMS_DIR)max32630fthr
gmehmet 1:f60eafbf009a 48
gmehmet 1:f60eafbf009a 49 else ifeq ($(CONFIG_PLATFORM_MAX32630HSP), y)
gmehmet 1:f60eafbf009a 50 CONFIG_FLAGS += PLATFORM_MAX32630HSP
gmehmet 1:f60eafbf009a 51 CONFIG_PLATFORM_NAME=MAX32630FTHR
gmehmet 1:f60eafbf009a 52 EXTERNAL_SOURCES += $(PLATFORMS_DIR)max32630hsp
gmehmet 1:f60eafbf009a 53 PROJECT_SOURCES += $(PLATFORMS_DIR)max32630hsp
gmehmet 1:f60eafbf009a 54
gmehmet 1:f60eafbf009a 55 else ifeq ($(CONFIG_PLATFORM_MAX32625PICO), y)
gmehmet 1:f60eafbf009a 56 CONFIG_FLAGS += PLATFORM_MAX32625PICO
gmehmet 1:f60eafbf009a 57 CONFIG_PLATFORM_NAME=MAX32625PICO
gmehmet 1:f60eafbf009a 58
gmehmet 1:f60eafbf009a 59 else
gmehmet 1:f60eafbf009a 60 $(warning NO MAXIM PLATFORM SELECTED)
gmehmet 1:f60eafbf009a 61 endif
gmehmet 1:f60eafbf009a 62 CONFIG_FLAGS += MAXIM_PLATFORM_NAME=\"$(CONFIG_MAXIM_PLATFORM_NAME)\"
gmehmet 1:f60eafbf009a 63
gmehmet 1:f60eafbf009a 64
gmehmet 1:f60eafbf009a 65 ifeq ($(CONFIG_ENABLE_LED_STATUS), y)
gmehmet 1:f60eafbf009a 66 CONFIG_FLAGS += ENABLE_LED_STATUS
gmehmet 1:f60eafbf009a 67 endif
gmehmet 1:f60eafbf009a 68
gmehmet 1:f60eafbf009a 69 ifeq ($(CONFIG_ENABLE_EVENTSTATS), y)
gmehmet 1:f60eafbf009a 70 CONFIG_FLAGS += ENABLE_EVENTSTATS
gmehmet 1:f60eafbf009a 71 endif
gmehmet 1:f60eafbf009a 72 ## END PLATFORM ##
gmehmet 1:f60eafbf009a 73
gmehmet 1:f60eafbf009a 74 ## BEGIN PPG SENSOR ##
gmehmet 1:f60eafbf009a 75 ifeq ($(CONFIG_ENABLE_PPG), y)
gmehmet 1:f60eafbf009a 76 CONFIG_FLAGS += ENABLE_PPG
gmehmet 1:f60eafbf009a 77 PROJECT_SOURCES += $(SCOMMS_DIR)PpgComm/
gmehmet 1:f60eafbf009a 78 endif
gmehmet 1:f60eafbf009a 79
gmehmet 1:f60eafbf009a 80 ifeq ($(CONFIG_PPG_MAX3011X), y)
gmehmet 1:f60eafbf009a 81 CONFIG_FLAGS += PPG_MAX3011X
gmehmet 1:f60eafbf009a 82 PROJECT_SOURCES += $(DRIVERS_DIR)MAX3011X
gmehmet 1:f60eafbf009a 83 endif
gmehmet 1:f60eafbf009a 84
gmehmet 1:f60eafbf009a 85 ifeq ($(CONFIG_PPG_MAX8614X), y)
gmehmet 1:f60eafbf009a 86 CONFIG_FLAGS += PPG_MAX8614X
gmehmet 1:f60eafbf009a 87 PROJECT_SOURCES += $(DRIVERS_DIR)MAX8614X
gmehmet 1:f60eafbf009a 88 endif
gmehmet 1:f60eafbf009a 89 ## END PPG SENSOR ##
gmehmet 1:f60eafbf009a 90
gmehmet 1:f60eafbf009a 91 ## BEGIN ECG SENSOR ##
gmehmet 1:f60eafbf009a 92 ifeq ($(CONFIG_ENABLE_ECG), y)
gmehmet 1:f60eafbf009a 93 CONFIG_FLAGS += ENABLE_ECG
gmehmet 1:f60eafbf009a 94 PROJECT_SOURCES += $(SCOMMS_DIR)EcgComm/
gmehmet 1:f60eafbf009a 95 endif
gmehmet 1:f60eafbf009a 96
gmehmet 1:f60eafbf009a 97 ifeq ($(CONFIG_ECG_MAX30001), y)
gmehmet 1:f60eafbf009a 98 CONFIG_FLAGS += ECG_MAX30001
gmehmet 1:f60eafbf009a 99 PROJECT_SOURCES += $(DRIVERS_DIR)MAX30001
gmehmet 1:f60eafbf009a 100 endif
gmehmet 1:f60eafbf009a 101 ## END PPG SENSOR ##
gmehmet 1:f60eafbf009a 102
gmehmet 1:f60eafbf009a 103 ## BEGIN TEMP SENSOR
gmehmet 1:f60eafbf009a 104 ifeq ($(CONFIG_ENABLE_TP), y)
gmehmet 1:f60eafbf009a 105 CONFIG_FLAGS += ENABLE_TP
gmehmet 1:f60eafbf009a 106 PROJECT_SOURCES += $(SCOMMS_DIR)TempComm/
gmehmet 1:f60eafbf009a 107 endif
gmehmet 1:f60eafbf009a 108
gmehmet 1:f60eafbf009a 109 ifeq ($(CONFIG_TP_MAX30205), y)
gmehmet 1:f60eafbf009a 110 CONFIG_FLAGS += TP_MAX30205
gmehmet 1:f60eafbf009a 111 PROJECT_SOURCES += $(DRIVERS_DIR)MAX30205
gmehmet 1:f60eafbf009a 112 endif
gmehmet 1:f60eafbf009a 113 ## END TEMP SENSOR
gmehmet 1:f60eafbf009a 114
gmehmet 1:f60eafbf009a 115 ## BEGIN PRESSURE SENSOR
gmehmet 1:f60eafbf009a 116 ifeq ($(CONFIG_ENABLE_BMP280), y)
gmehmet 1:f60eafbf009a 117 CONFIG_FLAGS +=ENABLE_BMP280
gmehmet 1:f60eafbf009a 118 PROJECT_SOURCES += $(DRIVERS_DIR)BMP280
gmehmet 1:f60eafbf009a 119 endif
gmehmet 1:f60eafbf009a 120 ## END PRESSURE SENSOR
gmehmet 1:f60eafbf009a 121
gmehmet 1:f60eafbf009a 122 ## BEGIN FLASH CONFIGURATION
gmehmet 1:f60eafbf009a 123 ifeq ($(CONFIG_ENABLE_MX25U), y)
gmehmet 1:f60eafbf009a 124 CONFIG_FLAGS +=ENABLE_MX25U
gmehmet 1:f60eafbf009a 125 PROJECT_SOURCES += $(DRIVERS_DIR)SPIBlockDevice
gmehmet 1:f60eafbf009a 126 $(info flash driver is included)
gmehmet 1:f60eafbf009a 127 endif
gmehmet 1:f60eafbf009a 128 ## END FLASH CONFIGURATION
gmehmet 1:f60eafbf009a 129
gmehmet 1:f60eafbf009a 130 ## BEGIN USBMSD CONFIGURATION
gmehmet 1:f60eafbf009a 131 ifeq ($(CONFIG_ENABLE_USBMSD), y)
gmehmet 1:f60eafbf009a 132 CONFIG_FLAGS +=ENABLE_USBMSD
gmehmet 1:f60eafbf009a 133 PROJECT_SOURCES += $(DRIVERS_DIR)USBMSD_BD
gmehmet 1:f60eafbf009a 134 $(info USBMSD feature enabled)
gmehmet 1:f60eafbf009a 135 endif
gmehmet 1:f60eafbf009a 136 ## END USBMSD CONFIGURATION
gmehmet 1:f60eafbf009a 137
gmehmet 1:f60eafbf009a 138 ## BEGIN ACCEL ##
gmehmet 1:f60eafbf009a 139 ifeq ($(CONFIG_ENABLE_ACCEL), y)
gmehmet 1:f60eafbf009a 140 CONFIG_FLAGS += ENABLE_ACCEL
gmehmet 1:f60eafbf009a 141 PROJECT_SOURCES += $(DRIVERS_DIR)BMI160
gmehmet 1:f60eafbf009a 142 endif
gmehmet 1:f60eafbf009a 143
gmehmet 1:f60eafbf009a 144 ifeq ($(CONFIG_ACCEL_BMA160), y)
gmehmet 1:f60eafbf009a 145 CONFIG_FLAGS += ACCEL_BMA160
gmehmet 1:f60eafbf009a 146 PROJECT_SOURCES += $(DRIVERS_DIR)BMA160
gmehmet 1:f60eafbf009a 147 endif
gmehmet 1:f60eafbf009a 148
gmehmet 1:f60eafbf009a 149 ifeq ($(CONFIG_ACCEL_BMA280), y)
gmehmet 1:f60eafbf009a 150 CONFIG_FLAGS += ACCEL_BMA280
gmehmet 1:f60eafbf009a 151 PROJECT_SOURCES += $(DRIVERS_DIR)BMA280
gmehmet 1:f60eafbf009a 152 endif
gmehmet 1:f60eafbf009a 153
gmehmet 1:f60eafbf009a 154 ifeq ($(CONFIG_ACCEL_LIS2DH), y)
gmehmet 1:f60eafbf009a 155 CONFIG_FLAGS += ACCEL_LIS2DH
gmehmet 1:f60eafbf009a 156 PROJECT_SOURCES += $(DRIVERS_DIR)LIS2DH
gmehmet 1:f60eafbf009a 157 endif
gmehmet 1:f60eafbf009a 158 ## END ACCEL ##
gmehmet 1:f60eafbf009a 159
gmehmet 1:f60eafbf009a 160 ## BEGIN SMARTSENSOR ##
gmehmet 1:f60eafbf009a 161 ifeq ($(CONFIG_ENABLE_SMARTSENSOR), y)
gmehmet 1:f60eafbf009a 162 CONFIG_FLAGS += ENABLE_SMARTSENSOR
gmehmet 1:f60eafbf009a 163 PROJECT_SOURCES += $(SSINT_DIR)
gmehmet 1:f60eafbf009a 164 endif
gmehmet 1:f60eafbf009a 165
gmehmet 1:f60eafbf009a 166 ifeq ($(CONFIG_ENABLE_SS_BOOTLOADER), y)
gmehmet 1:f60eafbf009a 167 CONFIG_FLAGS += ENABLE_SS_BOOTLOADER
gmehmet 1:f60eafbf009a 168 PROJECT_SOURCES += $(SSCOMMS_DIR)SSBootloader
gmehmet 1:f60eafbf009a 169 endif
gmehmet 1:f60eafbf009a 170
gmehmet 1:f60eafbf009a 171 ifeq ($(CONFIG_ENABLE_SS_MAX30101), y)
gmehmet 1:f60eafbf009a 172 CONFIG_FLAGS += ENABLE_SS_MAX30101
gmehmet 1:f60eafbf009a 173 PROJECT_SOURCES += $(SSCOMMS_DIR)SSMAX30101
gmehmet 1:f60eafbf009a 174 endif
gmehmet 1:f60eafbf009a 175
gmehmet 1:f60eafbf009a 176 ifeq ($(CONFIG_ENABLE_SS_MAX8614X), y)
gmehmet 1:f60eafbf009a 177 CONFIG_FLAGS += ENABLE_SS_MAX8614X
gmehmet 1:f60eafbf009a 178 PROJECT_SOURCES += $(SSCOMMS_DIR)SSMAX8614X
gmehmet 1:f60eafbf009a 179 endif
gmehmet 1:f60eafbf009a 180 ## END SMARTSENSOR ##
gmehmet 1:f60eafbf009a 181
gmehmet 1:f60eafbf009a 182 ## BEGIN SMARTSENSOR ##
gmehmet 1:f60eafbf009a 183 ifeq ($(CONFIG_BOOTLOADER_USES_MFIO), y)
gmehmet 1:f60eafbf009a 184 CONFIG_FLAGS += BOOTLOADER_USES_MFIO
gmehmet 1:f60eafbf009a 185 endif
gmehmet 1:f60eafbf009a 186
gmehmet 1:f60eafbf009a 187 ## BEGIN DISPLAY ##
gmehmet 1:f60eafbf009a 188 ifeq ($(CONFIG_ENABLE_DISPLAY), y)
gmehmet 1:f60eafbf009a 189 CONFIG_FLASG += ENABLE_DISPLAY
gmehmet 1:f60eafbf009a 190 endif
gmehmet 1:f60eafbf009a 191
gmehmet 1:f60eafbf009a 192 ifeq ($(CONFIG_OLED_ADAFRUIT_SSD1306), y)
gmehmet 1:f60eafbf009a 193 CONFIG_FLAGS += OLED_ADAFRUIT_SSD1306
gmehmet 1:f60eafbf009a 194 EXTERNAL_SOURCES += $(DRIVERS_DIR)Adafruit_FeatherOLED
gmehmet 1:f60eafbf009a 195 endif
gmehmet 1:f60eafbf009a 196 ifeq ($(CONFIG_LCD_WATCHINTERFACE), y)
gmehmet 1:f60eafbf009a 197 CONFIG_FLAGS += LCD_WATCHINTERFACE
gmehmet 1:f60eafbf009a 198 endif
gmehmet 1:f60eafbf009a 199 ifeq ($(CONFIG_LCD_LS013B7DH03), y)
gmehmet 1:f60eafbf009a 200 CONFIG_FLAGS += LCD_LS013B7DH03
gmehmet 1:f60eafbf009a 201 PROJECT_SOURCES += $(DRIVERS_DIR)LS013B7DH03
gmehmet 1:f60eafbf009a 202 endif
gmehmet 1:f60eafbf009a 203 ## END DISPLAY ##
gmehmet 1:f60eafbf009a 204
gmehmet 1:f60eafbf009a 205 ## BEGIN ALGORITHMS ##
gmehmet 1:f60eafbf009a 206 #ifeq ($(CONFIG_ENABLE_WHRM), y)
gmehmet 1:f60eafbf009a 207 #CONFIG_FLAGS += ENABLE_WHRM
gmehmet 1:f60eafbf009a 208 #PROJECT_SOURCES += $(ALGO_DIR)WHRM
gmehmet 1:f60eafbf009a 209 #endif
gmehmet 1:f60eafbf009a 210
gmehmet 1:f60eafbf009a 211 ifeq ($(CONFIG_ENABLE_WHRM_AND_SPO2), y)
gmehmet 1:f60eafbf009a 212 CONFIG_FLAGS += ENABLE_WHRM_AND_SPO2
gmehmet 1:f60eafbf009a 213 #PROJECT_SOURCES += $(ALGO_DIR)WHRM
gmehmet 1:f60eafbf009a 214 endif
gmehmet 1:f60eafbf009a 215
gmehmet 1:f60eafbf009a 216 #ifeq ($(CONFIG_ENABLE_BPT), y)
gmehmet 1:f60eafbf009a 217 #CONFIG_FLAGS += ENABLE_BPT
gmehmet 1:f60eafbf009a 218 #PROJECT_SOURCES += $(ALGO_DIR)WHRM
gmehmet 1:f60eafbf009a 219 #endif
gmehmet 1:f60eafbf009a 220 ## END ALGORITHMS ##
gmehmet 1:f60eafbf009a 221
gmehmet 1:f60eafbf009a 222 ## SPO2 ##
gmehmet 1:f60eafbf009a 223 ifeq ($(CONFIG_ENABLE_SPO2), y)
gmehmet 1:f60eafbf009a 224 CONFIG_FLAGS += ENABLE_SPO2
gmehmet 1:f60eafbf009a 225 endif
gmehmet 1:f60eafbf009a 226 ## END ##
gmehmet 1:f60eafbf009a 227
gmehmet 1:f60eafbf009a 228
gmehmet 1:f60eafbf009a 229 ## BEGIN BLE ##
gmehmet 1:f60eafbf009a 230 ifeq ($(CONFIG_ENABLE_BLE), y)
gmehmet 1:f60eafbf009a 231 CONFIG_FLAGS += ENABLE_BLE
gmehmet 1:f60eafbf009a 232 PROJECT_SOURCES += $(DRIVERS_DIR)BLE_ICARUS
gmehmet 1:f60eafbf009a 233
gmehmet 1:f60eafbf009a 234 #ifeq ("$(CONFIG_BLE_ADV_NAME)", "")
gmehmet 1:f60eafbf009a 235 #$(error BLE Avertisement name must be specified with CONFIG_BLE_ADV_NAME)
gmehmet 1:f60eafbf009a 236 #else
gmehmet 1:f60eafbf009a 237 #CONFIG_FLAGS += BLE_ADV_NAME=\"$(CONFIG_BLE_ADV_NAME)\"
gmehmet 1:f60eafbf009a 238 #endif
gmehmet 1:f60eafbf009a 239
gmehmet 1:f60eafbf009a 240 ifeq ($(CONFIG_USE_BLE_TICKER_TO_CHECK_TRANSFER), y)
gmehmet 1:f60eafbf009a 241 CONFIG_FLAGS += USE_BLE_TICKER_TO_CHECK_TRANSFER
gmehmet 1:f60eafbf009a 242 endif
gmehmet 1:f60eafbf009a 243
gmehmet 1:f60eafbf009a 244 endif
gmehmet 1:f60eafbf009a 245 ## END BLE ##
gmehmet 1:f60eafbf009a 246
gmehmet 1:f60eafbf009a 247 ## BEGIN DATA STREAMING DEBUG ##
gmehmet 1:f60eafbf009a 248 ifeq ($(CONFIG_ASCII_COMM), y)
gmehmet 1:f60eafbf009a 249 CONFIG_FLAGS += ASCII_COMM
gmehmet 1:f60eafbf009a 250 endif
gmehmet 1:f60eafbf009a 251
gmehmet 1:f60eafbf009a 252 ifeq ($(CONFIG_ENABLE_BLETEST_COMM), y)
gmehmet 1:f60eafbf009a 253 CONFIG_FLAGS += ENABLE_BLETEST_COMM
gmehmet 1:f60eafbf009a 254 PROJECT_SOURCES += $(SCOMMS_DIR)BleTestComm
gmehmet 1:f60eafbf009a 255 endif
gmehmet 1:f60eafbf009a 256
gmehmet 1:f60eafbf009a 257 ifeq ($(CONFIG_ENABLE_SS_GENERICCMDCOMM), y)
gmehmet 1:f60eafbf009a 258 CONFIG_FLAGS += ENABLE_SS_GENERICMDCOMM
gmehmet 1:f60eafbf009a 259 PROJECT_SOURCES += $(SSCOMMS_DIR)SSGenericCmd
gmehmet 1:f60eafbf009a 260 endif
gmehmet 1:f60eafbf009a 261 ## END DATA STREAMING DEBUG ##
gmehmet 1:f60eafbf009a 262
gmehmet 1:f60eafbf009a 263 ## BEGIN TEST FIRMWARE
gmehmet 1:f60eafbf009a 264 ifeq ($(CONFIG_ENABLE_TESTCOMM), y)
gmehmet 1:f60eafbf009a 265 CONFIG_FLAGS += ENABLE_TESTCOMM
gmehmet 1:f60eafbf009a 266 PROJECT_SOURCES += $(SCOMMS_DIR)TestComm
gmehmet 1:f60eafbf009a 267 endif
gmehmet 1:f60eafbf009a 268 # END TEST FIRMWARE
gmehmet 1:f60eafbf009a 269
gmehmet 1:f60eafbf009a 270 ## BEGIN MEMORY DEBUG ##
gmehmet 1:f60eafbf009a 271 ifeq ($(CONFIG_ENABLE_MEMORY_DEBUG), y)
gmehmet 1:f60eafbf009a 272 CONFIG_FLAGS += ENABLE_MEMORY_DEBUG
gmehmet 1:f60eafbf009a 273 endif
gmehmet 1:f60eafbf009a 274
gmehmet 1:f60eafbf009a 275 ifeq ($(CONFIG_MBED_HEAP_STATS_ENABLED), y)
gmehmet 1:f60eafbf009a 276 CONFIG_FLAGS += MBED_HEAP_STATS_ENABLED
gmehmet 1:f60eafbf009a 277 endif
gmehmet 1:f60eafbf009a 278
gmehmet 1:f60eafbf009a 279 ifeq ($(CONFIG_MBED_MEM_TRACING_ENABLED), y)
gmehmet 1:f60eafbf009a 280 CONFIG_FLAGS += MBED_MEM_TRACING_ENABLED
gmehmet 1:f60eafbf009a 281 endif
gmehmet 1:f60eafbf009a 282
gmehmet 1:f60eafbf009a 283 ifeq ($(CONFIG_MBED_STACK_STATS_ENABLED), y)
gmehmet 1:f60eafbf009a 284 CONFIG_FLAGS += MBED_STACK_STATS_ENABLED
gmehmet 1:f60eafbf009a 285 endif
gmehmet 1:f60eafbf009a 286 ## END MEMORY DEBUG ##
gmehmet 1:f60eafbf009a 287
gmehmet 1:f60eafbf009a 288
gmehmet 1:f60eafbf009a 289 ## BEGIN DEBUG MSGS TOGGLE
gmehmet 1:f60eafbf009a 290 ifeq ($(CONFIG_SHOW_DEBUG_MSGS), y)
gmehmet 1:f60eafbf009a 291 CONFIG_FLAGS += SHOW_DEBUG_MSGS
gmehmet 1:f60eafbf009a 292 endif
gmehmet 1:f60eafbf009a 293 ifeq ($(CONFIG_SHOW_INFO_MSGS), y)
gmehmet 1:f60eafbf009a 294 CONFIG_FLAGS += SHOW_INFO_MSGS
gmehmet 1:f60eafbf009a 295 endif
gmehmet 1:f60eafbf009a 296 ifeq ($(CONFIG_SHOW_I2C_DEBUG_MESSAGES), y)
gmehmet 1:f60eafbf009a 297 CONFIG_FLAGS += SHOW_I2C_DEBUG_MESSAGES
gmehmet 1:f60eafbf009a 298 endif
gmehmet 1:f60eafbf009a 299
gmehmet 1:f60eafbf009a 300 ifeq ($(V), 1)
gmehmet 1:f60eafbf009a 301 BUILD_VERBOSE = -v
gmehmet 1:f60eafbf009a 302 endif
gmehmet 1:f60eafbf009a 303
gmehmet 1:f60eafbf009a 304 SRC_ARGS += $(addprefix --source $(PROJECT_PATH)/, $(EXTERNAL_SOURCES))
gmehmet 1:f60eafbf009a 305 SRC_ARGS += $(addprefix --source $(PROJECT_PATH)/, $(PROJECT_SOURCES))
gmehmet 1:f60eafbf009a 306 CFG_ARGS = $(addprefix -D, $(CONFIG_FLAGS))
gmehmet 1:f60eafbf009a 307
gmehmet 1:f60eafbf009a 308 ###$(info SELECTED_CONFIG=$(CONFIG_CONFIG_NAME))
gmehmet 1:f60eafbf009a 309 $(info CONFIG_PLATFORM_NAME=$(CONFIG_PLATFORM_NAME) CONFIG_MAXIM_PLATFORM_NAME=$(CONFIG_MAXIM_PLATFORM_NAME) CONFIG_FLAGS=$(CONFIG_FLAGS))
gmehmet 1:f60eafbf009a 310 $(info PROJECT_SOURCES=$(PROJECT_SOURCES))
gmehmet 1:f60eafbf009a 311 $(info EXTERNAL_SOURCES=$(EXTERNAL_SOURCES))
gmehmet 1:f60eafbf009a 312 $(info PROJECT_SCM=$(PROJECT_SCM_BRANCH) ($(PROJECT_SCM_HASH)))
gmehmet 1:f60eafbf009a 313
gmehmet 1:f60eafbf009a 314 ## BEGIN MAKEFILE RULES ##
gmehmet 1:f60eafbf009a 315 all: pre_build
gmehmet 1:f60eafbf009a 316 ### @if [ -f $(CONFIG_CONFIG_NAME) ]; then \
gmehmet 1:f60eafbf009a 317 ### printf "NO CONFIG SELECTED!\n"; \
gmehmet 1:f60eafbf009a 318 ### exit 1; \
gmehmet 1:f60eafbf009a 319 ### fi;
gmehmet 1:f60eafbf009a 320 @if [ ! -f .checkout ]; then \
gmehmet 1:f60eafbf009a 321 $(MAKE) checkout ; \
gmehmet 1:f60eafbf009a 322 fi;
gmehmet 1:f60eafbf009a 323 mbed compile -t $(PROJECT_TOOLCHAIN) -m $(CONFIG_PLATFORM_NAME) -D__STACK_SIZE=$(STACK_SIZE) -D__HEAP_SIZE=$(HEAP_SIZE) $(BUILD_VERBOSE) $(CFG_ARGS) $(SRC_ARGS)
gmehmet 1:f60eafbf009a 324 debug_build:
gmehmet 1:f60eafbf009a 325 mbed compile -t $(PROJECT_TOOLCHAIN) -m $(CONFIG_PLATFORM_NAME) -D__STACK_SIZE=$(STACK_SIZE) -D__HEAP_SIZE=$(HEAP_SIZE) $(BUILD_VERBOSE) $(CFG_ARGS) $(SRC_ARGS) --profile $(PROJECT_PATH)/mbed-os/tools/profiles/debug.json
gmehmet 1:f60eafbf009a 326
gmehmet 1:f60eafbf009a 327 clean_build:
gmehmet 1:f60eafbf009a 328 mbed compile -t $(PROJECT_TOOLCHAIN) -m $(CONFIG_PLATFORM_NAME) -D__STACK_SIZE=$(STACK_SIZE) -D__HEAP_SIZE=$(HEAP_SIZE) -c $(BUILD_VERBOSE) $(CFG_ARGS) $(SRC_ARGS)
gmehmet 1:f60eafbf009a 329
gmehmet 1:f60eafbf009a 330 werror_build:
gmehmet 1:f60eafbf009a 331 mbed compile -t $(PROJECT_TOOLCHAIN) -m $(CONFIG_PLATFORM_NAME) -D__STACK_SIZE=$(STACK_SIZE) -D__HEAP_SIZE=$(HEAP_SIZE) -c $(BUILD_VERBOSE) $(CFG_ARGS) $(SRC_ARGS) --profile $(PROJECT_PATH)/werror_build_profile.json
gmehmet 1:f60eafbf009a 332
gmehmet 1:f60eafbf009a 333 clean:
gmehmet 1:f60eafbf009a 334 rm -rf $(PROJECT_BUILD_PATH)
gmehmet 1:f60eafbf009a 335
gmehmet 1:f60eafbf009a 336 menuconfig:
gmehmet 1:f60eafbf009a 337 ${PROJECT_TOOLS_PATH}/windows_kconfig/kconfig-mconf.exe Kconfig
gmehmet 1:f60eafbf009a 338
gmehmet 1:f60eafbf009a 339 run:
gmehmet 1:f60eafbf009a 340 python ${PROJECT_TOOLS_PATH}/mbed_run.py ${PROJECT_BUILD_PATH}/${CONFIG_PLATFORM_NAME}/$(PROJECT_TOOLCHAIN)/mbed-os.bin
gmehmet 1:f60eafbf009a 341
gmehmet 1:f60eafbf009a 342 co: checkout
gmehmet 1:f60eafbf009a 343
gmehmet 1:f60eafbf009a 344 checkout:
gmehmet 1:f60eafbf009a 345 @echo "Downloading libraries"
gmehmet 1:f60eafbf009a 346 mbed deploy
gmehmet 1:f60eafbf009a 347 $(MAKE) apply_mbedos_patches
gmehmet 1:f60eafbf009a 348 @touch .$@
gmehmet 1:f60eafbf009a 349
gmehmet 1:f60eafbf009a 350 applypatches:
gmehmet 1:f60eafbf009a 351 @echo "Applying patches"
gmehmet 1:f60eafbf009a 352 # cd mbed-os; \
gmehmet 1:f60eafbf009a 353 # git am ../patches/0001-porting-MAX32625PICO-to-mbed-os-5.patch
gmehmet 1:f60eafbf009a 354 # cd USBDevice; \
gmehmet 1:f60eafbf009a 355 # hg import --no-commit --force ../patches/USBDevice.patch
gmehmet 1:f60eafbf009a 356
gmehmet 1:f60eafbf009a 357 apply_mbedos_patches:
gmehmet 1:f60eafbf009a 358 @echo "Applying mbed-os patches"
gmehmet 1:f60eafbf009a 359 @cd ./mbed_os_patches; \
gmehmet 1:f60eafbf009a 360 for i in *.patch ; do \
gmehmet 1:f60eafbf009a 361 [ -f "$$i" ] || break ; \
gmehmet 1:f60eafbf009a 362 echo "$$i"; \
gmehmet 1:f60eafbf009a 363 cp "$$i" ../mbed-os; \
gmehmet 1:f60eafbf009a 364 cd ../mbed-os; \
gmehmet 1:f60eafbf009a 365 git apply "$$i"; \
gmehmet 1:f60eafbf009a 366 rm -f "$$i"; \
gmehmet 1:f60eafbf009a 367 cd ..; \
gmehmet 1:f60eafbf009a 368 cd ./mbed_os_patches; \
gmehmet 1:f60eafbf009a 369 done; \
gmehmet 1:f60eafbf009a 370
gmehmet 1:f60eafbf009a 371 selectconfig.%:
gmehmet 1:f60eafbf009a 372 @if [ -f $(PROJECT_CONFIGS_PATH)/$(word 2,$(subst ., ,$@)).config ]; then \
gmehmet 1:f60eafbf009a 373 cp $(PROJECT_CONFIGS_PATH)/$(word 2,$(subst ., ,$@)).config $(PROJECT_PATH)/.config; \
gmehmet 1:f60eafbf009a 374 printf "\n$(word 2,$(subst ., ,$@)).config selected\n"; \
gmehmet 1:f60eafbf009a 375 else \
gmehmet 1:f60eafbf009a 376 printf "\nConfig [$(word 2,$(subst ., ,$@))] is not found!\n"; \
gmehmet 1:f60eafbf009a 377 printf "Available configs are:\n\n"; \
gmehmet 1:f60eafbf009a 378 ls $(PROJECT_CONFIGS_PATH) | cut -d "." -f 1; \
gmehmet 1:f60eafbf009a 379 printf "\n"; \
gmehmet 1:f60eafbf009a 380 fi;
gmehmet 1:f60eafbf009a 381
gmehmet 1:f60eafbf009a 382 saveconfig:
gmehmet 1:f60eafbf009a 383 ### cp $(PROJECT_PATH)/.config $(PROJECT_CONFIGS_PATH)/$(CONFIG_CONFIG_NAME).config
gmehmet 1:f60eafbf009a 384
gmehmet 1:f60eafbf009a 385 staticcheck:
gmehmet 1:f60eafbf009a 386 @printf "\n\nRATS-2.4 Staic Analyzer\n"
gmehmet 1:f60eafbf009a 387 @printf "=========== BEGIN =============\n"
gmehmet 1:f60eafbf009a 388 ${PROJECT_TOOLS_PATH}/Rats-2.4/rats.exe --quiet -w 3 --db ${PROJECT_TOOLS_PATH}/Rats-2.4/rats-c.xml $(PROJECT_SOURCES)
gmehmet 1:f60eafbf009a 389 @printf "============ END ==============\n"
gmehmet 1:f60eafbf009a 390 @printf "\n\nCppcheck-1.78 Static Analyzer\n"
gmehmet 1:f60eafbf009a 391 @printf "=========== BEGIN =============\n"
gmehmet 1:f60eafbf009a 392 ${PROJECT_TOOLS_PATH}/Cppcheck-1.78/cppcheck.exe -q --enable=all --force $(PROJECT_SOURCES)
gmehmet 1:f60eafbf009a 393 @printf "============ END ==============\n"
gmehmet 1:f60eafbf009a 394 @printf "\n\nVisualCodeGrepper-2.1.0 Static Analyzer\n"
gmehmet 1:f60eafbf009a 395 @printf "=========== BEGIN =============\n"
gmehmet 1:f60eafbf009a 396 @cd ${PROJECT_TOOLS_PATH}/VisualCodeGrepper-2.1.0; \
gmehmet 1:f60eafbf009a 397 for src in $(PROJECT_SOURCES) ; do \
gmehmet 1:f60eafbf009a 398 ${PROJECT_TOOLS_PATH}/VisualCodeGrepper-2.1.0/VisualCodeGrepper.exe -c -t $(PROJECT_PATH)/$$src -r $(PROJECT_PATH)/.tmp_VCG_step.txt ; \
gmehmet 1:f60eafbf009a 399 echo "" >> $(PROJECT_PATH)/.tmp_VCG_result.txt ; \
gmehmet 1:f60eafbf009a 400 echo "$$src:" >> $(PROJECT_PATH)/.tmp_VCG_result.txt ; \
gmehmet 1:f60eafbf009a 401 cat $(PROJECT_PATH)/.tmp_VCG_step.txt >> $(PROJECT_PATH)/.tmp_VCG_result.txt ; \
gmehmet 1:f60eafbf009a 402 rm -rf $(PROJECT_PATH)/.tmp_VCG_step.txt ;\
gmehmet 1:f60eafbf009a 403 done ; \
gmehmet 1:f60eafbf009a 404 cat $(PROJECT_PATH)/.tmp_VCG_result.txt ; \
gmehmet 1:f60eafbf009a 405 rm -rf $(PROJECT_PATH)/.tmp_VCG_result.txt
gmehmet 1:f60eafbf009a 406 @printf "============ END ==============\n"
gmehmet 1:f60eafbf009a 407
gmehmet 1:f60eafbf009a 408 doxygen:
gmehmet 1:f60eafbf009a 409 mkdir -p $(PROJECT_BUILD_PATH)
gmehmet 1:f60eafbf009a 410 export PROJECT_SOURCES="$(PROJECT_SOURCES)"; \
gmehmet 1:f60eafbf009a 411 export PROJECT_SCM_HASH="$(PROJECT_SCM_HASH)"; \
gmehmet 1:f60eafbf009a 412 doxygen doxygen.conf
gmehmet 1:f60eafbf009a 413 start $(PROJECT_BUILD_PATH)/doc/html/index.html
gmehmet 1:f60eafbf009a 414
gmehmet 1:f60eafbf009a 415 astyle:
gmehmet 1:f60eafbf009a 416 @printf "=========== BEGIN ASTYLE =============\n"
gmehmet 1:f60eafbf009a 417 ${PROJECT_TOOLS_PATH}/AStyle_2.06_windows/bin/AStyle.exe --options=${PROJECT_TOOLS_PATH}/AStyle_2.06_windows/file/custom.ini "*.cpp";
gmehmet 1:f60eafbf009a 418 ${PROJECT_TOOLS_PATH}/AStyle_2.06_windows/bin/AStyle.exe --options=${PROJECT_TOOLS_PATH}/AStyle_2.06_windows/file/custom.ini "*.h";
gmehmet 1:f60eafbf009a 419 @for src in $(PROJECT_SOURCES); do \
gmehmet 1:f60eafbf009a 420 if [[ -d $$src ]]; then \
gmehmet 1:f60eafbf009a 421 ${PROJECT_TOOLS_PATH}/AStyle_2.06_windows/bin/AStyle.exe --options=${PROJECT_TOOLS_PATH}/AStyle_2.06_windows/file/custom.ini --recursive "$$src/*.cpp" ; \
gmehmet 1:f60eafbf009a 422 ${PROJECT_TOOLS_PATH}/AStyle_2.06_windows/bin/AStyle.exe --options=${PROJECT_TOOLS_PATH}/AStyle_2.06_windows/file/custom.ini --recursive "$$src/*.h" ; \
gmehmet 1:f60eafbf009a 423 fi; \
gmehmet 1:f60eafbf009a 424 done;
gmehmet 1:f60eafbf009a 425 @printf "============ END ASTYLE ==============\n"
gmehmet 1:f60eafbf009a 426
gmehmet 1:f60eafbf009a 427 help:
gmehmet 1:f60eafbf009a 428 start https://confluence.maxim-ic.com/x/VSAkB
gmehmet 1:f60eafbf009a 429
gmehmet 1:f60eafbf009a 430 create_flags:
gmehmet 1:f60eafbf009a 431 python ./scripts/py/mbed_convertconfigtoflags.py
gmehmet 1:f60eafbf009a 432
gmehmet 1:f60eafbf009a 433 pre_build:
gmehmet 1:f60eafbf009a 434 @echo "#ifndef __BUILD_VERSION_H__" > build_version.h
gmehmet 1:f60eafbf009a 435 @echo "#define __BUILD_VERSION_H__" >> build_version.h
gmehmet 1:f60eafbf009a 436 @echo "#define BUILD_SOURCE_BRANCH \"$(PROJECT_SCM_BRANCH)\"" >> build_version.h
gmehmet 1:f60eafbf009a 437 @echo "#define BUILD_SOURCE_HASH \"$(PROJECT_SCM_HASH)\"" >> build_version.h
gmehmet 1:f60eafbf009a 438 @echo "#endif" >> build_version.h
gmehmet 1:f60eafbf009a 439 ## END MAKEFILE RULES ##