amiro-os / devices / DiWheelDrive / Makefile @ 3f899f5d
History | View | Annotate | Download (7.322 KB)
| 1 | 
      ##############################################################################  | 
  
|---|---|
| 2 | 
      # Build global options  | 
  
| 3 | 
      # NOTE: Can be overridden externally.  | 
  
| 4 | 
      #  | 
  
| 5 | 
       | 
  
| 6 | 
      # Compiler options here.  | 
  
| 7 | 
      ifeq ($(USE_OPT),)  | 
  
| 8 | 
      USE_OPT = -O2 -fomit-frame-pointer -falign-functions=16 -DCHPRINTF_USE_FLOAT=1 -fstack-usage -DSERIAL_BUFFERS_SIZE=64  | 
  
| 9 | 
      endif  | 
  
| 10 | 
       | 
  
| 11 | 
      # C specific options here (added to USE_OPT).  | 
  
| 12 | 
      ifeq ($(USE_COPT),)  | 
  
| 13 | 
      USE_COPT =  | 
  
| 14 | 
      endif  | 
  
| 15 | 
       | 
  
| 16 | 
      # C++ specific options here (added to USE_OPT).  | 
  
| 17 | 
      ifeq ($(USE_CPPOPT),)  | 
  
| 18 | 
      USE_CPPOPT = -fno-rtti -fno-exceptions -std=c++11 -U__STRICT_ANSI__  | 
  
| 19 | 
      endif  | 
  
| 20 | 
       | 
  
| 21 | 
      # Enable this if you want the linker to remove unused code and data  | 
  
| 22 | 
      ifeq ($(USE_LINK_GC),)  | 
  
| 23 | 
      USE_LINK_GC = yes  | 
  
| 24 | 
      endif  | 
  
| 25 | 
       | 
  
| 26 | 
      # Linker extra options here.  | 
  
| 27 | 
      ifeq ($(USE_LDOPT),)  | 
  
| 28 | 
      USE_LDOPT =  | 
  
| 29 | 
      endif  | 
  
| 30 | 
       | 
  
| 31 | 
      # Enable this if you want link time optimizations (LTO)  | 
  
| 32 | 
      ifeq ($(USE_LTO),)  | 
  
| 33 | 
      USE_LTO = no  | 
  
| 34 | 
      endif  | 
  
| 35 | 
       | 
  
| 36 | 
      # If enabled, this option allows to compile the application in THUMB mode.  | 
  
| 37 | 
      ifeq ($(USE_THUMB),)  | 
  
| 38 | 
      USE_THUMB = yes  | 
  
| 39 | 
      endif  | 
  
| 40 | 
       | 
  
| 41 | 
      # Enable this if you want to see the full log while compiling.  | 
  
| 42 | 
      ifeq ($(USE_VERBOSE_COMPILE),)  | 
  
| 43 | 
      USE_VERBOSE_COMPILE = no  | 
  
| 44 | 
      endif  | 
  
| 45 | 
       | 
  
| 46 | 
      #  | 
  
| 47 | 
      # Build global options  | 
  
| 48 | 
      ##############################################################################  | 
  
| 49 | 
       | 
  
| 50 | 
      ##############################################################################  | 
  
| 51 | 
      # Architecture or project specific options  | 
  
| 52 | 
      #  | 
  
| 53 | 
       | 
  
| 54 | 
      # Enable this if you really want to use the STM FWLib.  | 
  
| 55 | 
      ifeq ($(USE_FWLIB),)  | 
  
| 56 | 
      USE_FWLIB = no  | 
  
| 57 | 
      endif  | 
  
| 58 | 
       | 
  
| 59 | 
      #  | 
  
| 60 | 
      # Architecture or project specific options  | 
  
| 61 | 
      ##############################################################################  | 
  
| 62 | 
       | 
  
| 63 | 
      ##############################################################################  | 
  
| 64 | 
      # Project, sources and paths  | 
  
| 65 | 
      #  | 
  
| 66 | 
       | 
  
| 67 | 
      # Define project name here  | 
  
| 68 | 
      PROJECT = DiWheelDrive  | 
  
| 69 | 
       | 
  
| 70 | 
      # Imported source files and paths  | 
  
| 71 | 
      CHIBIOS = ../../../ChibiOS  | 
  
| 72 | 
      AMIRO = ../..  | 
  
| 73 | 
      include $(AMIRO)/boards/DiWheelDrive/board.mk  | 
  
| 74 | 
      include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk  | 
  
| 75 | 
      include $(CHIBIOS)/os/hal/hal.mk  | 
  
| 76 | 
      include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F1xx/port.mk  | 
  
| 77 | 
      include $(CHIBIOS)/os/kernel/kernel.mk  | 
  
| 78 | 
      include $(CHIBIOS)/os/various/cpp_wrappers/kernel.mk  | 
  
| 79 | 
      include $(AMIRO)/hal/platforms/STM32/platform.mk  | 
  
| 80 | 
      include $(AMIRO)/hal/hal.mk  | 
  
| 81 | 
       | 
  
| 82 | 
      # Define linker script file here  | 
  
| 83 | 
      LDSCRIPT= $(BOARDLD)/STM32F103xE.ld  | 
  
| 84 | 
       | 
  
| 85 | 
      # C sources that can be compiled in ARM or THUMB mode depending on the global  | 
  
| 86 | 
      # setting.  | 
  
| 87 | 
      CSRC = $(PORTSRC) \  | 
  
| 88 | 
      $(KERNSRC) \  | 
  
| 89 | 
      $(HALSRC) \  | 
  
| 90 | 
      $(PLATFORMSRC) \  | 
  
| 91 | 
      $(BOARDSRC) \  | 
  
| 92 | 
      $(CHIBIOS)/os/various/evtimer.c \  | 
  
| 93 | 
      $(CHIBIOS)/os/various/syscalls.c \  | 
  
| 94 | 
      $(CHIBIOS)/os/various/chprintf.c \  | 
  
| 95 | 
      $(CHIBIOS)/os/various/shell.c \  | 
  
| 96 | 
      $(CHIBIOS)/os/various/memstreams.c \  | 
  
| 97 | 
      $(AMIRO)/stubs.c \  | 
  
| 98 | 
      $(AMIRO)/components/Debug.c \  | 
  
| 99 | 
       | 
  
| 100 | 
      # C++ sources that can be compiled in ARM or THUMB mode depending on the global  | 
  
| 101 | 
      # setting.  | 
  
| 102 | 
      CPPSRC = $(CHCPPSRC) \  | 
  
| 103 | 
      $(AMIRO)/components/bus/spi/HWSPIDriver.cpp \  | 
  
| 104 | 
      $(AMIRO)/components/bus/i2c/HWI2CDriver.cpp \  | 
  
| 105 | 
      $(AMIRO)/components/bus/i2c/I2CMultiplexer.cpp \  | 
  
| 106 | 
      $(AMIRO)/components/bus/i2c/VI2CDriver.cpp \  | 
  
| 107 | 
      $(AMIRO)/components/proximity/vcnl4020.cpp \  | 
  
| 108 | 
      $(AMIRO)/components/magneto/hmc5883l.cpp \  | 
  
| 109 | 
      $(AMIRO)/components/accel/lis331dlh.cpp \  | 
  
| 110 | 
      $(AMIRO)/components/gyro/l3g4200d.cpp \  | 
  
| 111 | 
      $(AMIRO)/components/power/ina219.cpp \  | 
  
| 112 | 
      $(AMIRO)/components/eeprom/eeprom.cpp \  | 
  
| 113 | 
      $(AMIRO)/components/eeprom/at24.cpp \  | 
  
| 114 | 
      $(AMIRO)/components/FileSystemInputOutput/FileSystemInputOutputBase.cpp \  | 
  
| 115 | 
      $(AMIRO)/components/FileSystemInputOutput/FSIODiWheelDrive.cpp \  | 
  
| 116 | 
      $(AMIRO)/components/MotorIncrements.cpp \  | 
  
| 117 | 
      $(AMIRO)/components/MotorControl.cpp \  | 
  
| 118 | 
      $(AMIRO)/components/DistControl.cpp \  | 
  
| 119 | 
      $(AMIRO)/components/Odometry.cpp \  | 
  
| 120 | 
      $(AMIRO)/components/ControllerAreaNetworkRx.cpp \  | 
  
| 121 | 
      $(AMIRO)/components/ControllerAreaNetworkTx.cpp \  | 
  
| 122 | 
      $(AMIRO)/components/Color.cpp \  | 
  
| 123 | 
      $(AMIRO)/components/serial_reset/serial_can_mux.cpp \  | 
  
| 124 | 
      DiWheelDrive.cpp \  | 
  
| 125 | 
      userthread.cpp \  | 
  
| 126 | 
      main.cpp \  | 
  
| 127 | 
      exti.cpp  | 
  
| 128 | 
       | 
  
| 129 | 
      # C sources to be compiled in ARM mode regardless of the global setting.  | 
  
| 130 | 
      # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler  | 
  
| 131 | 
      # option that results in lower performance and larger code size.  | 
  
| 132 | 
      ACSRC =  | 
  
| 133 | 
       | 
  
| 134 | 
      # C++ sources to be compiled in ARM mode regardless of the global setting.  | 
  
| 135 | 
      # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler  | 
  
| 136 | 
      # option that results in lower performance and larger code size.  | 
  
| 137 | 
      ACPPSRC =  | 
  
| 138 | 
       | 
  
| 139 | 
      # C sources to be compiled in THUMB mode regardless of the global setting.  | 
  
| 140 | 
      # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler  | 
  
| 141 | 
      # option that results in lower performance and larger code size.  | 
  
| 142 | 
      TCSRC =  | 
  
| 143 | 
       | 
  
| 144 | 
      # C sources to be compiled in THUMB mode regardless of the global setting.  | 
  
| 145 | 
      # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler  | 
  
| 146 | 
      # option that results in lower performance and larger code size.  | 
  
| 147 | 
      TCPPSRC =  | 
  
| 148 | 
       | 
  
| 149 | 
      # List ASM source files here  | 
  
| 150 | 
      ASMSRC = $(PORTASM)  | 
  
| 151 | 
       | 
  
| 152 | 
      INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \  | 
  
| 153 | 
      $(HALINC) $(PLATFORMINC) $(BOARDINC) \  | 
  
| 154 | 
      $(CHCPPINC) \  | 
  
| 155 | 
      $(CHIBIOS)/os/various \  | 
  
| 156 | 
      $(AMIRO) \  | 
  
| 157 | 
      $(AMIRO)/include  | 
  
| 158 | 
       | 
  
| 159 | 
      #  | 
  
| 160 | 
      # Project, sources and paths  | 
  
| 161 | 
      ##############################################################################  | 
  
| 162 | 
       | 
  
| 163 | 
      ##############################################################################  | 
  
| 164 | 
      # Compiler settings  | 
  
| 165 | 
      #  | 
  
| 166 | 
       | 
  
| 167 | 
      MCU = cortex-m3  | 
  
| 168 | 
       | 
  
| 169 | 
      #TRGT = arm-elf-  | 
  
| 170 | 
      TRGT = arm-none-eabi-  | 
  
| 171 | 
      CC = $(TRGT)gcc  | 
  
| 172 | 
      CPPC = $(TRGT)g++  | 
  
| 173 | 
      # Enable loading with g++ only if you need C++ runtime support.  | 
  
| 174 | 
      # NOTE: You can use C++ even without C++ support if you are careful. C++  | 
  
| 175 | 
      # runtime support makes code size explode.  | 
  
| 176 | 
      #LD = $(TRGT)gcc  | 
  
| 177 | 
      LD = $(TRGT)g++  | 
  
| 178 | 
      CP = $(TRGT)objcopy  | 
  
| 179 | 
      AS = $(TRGT)gcc -x assembler-with-cpp  | 
  
| 180 | 
      OD = $(TRGT)objdump  | 
  
| 181 | 
      SZ = $(TRGT)size  | 
  
| 182 | 
      HEX = $(CP) -O ihex  | 
  
| 183 | 
      BIN = $(CP) -O binary  | 
  
| 184 | 
      SREC = $(CP) -O srec --srec-len=248  | 
  
| 185 | 
       | 
  
| 186 | 
      # ARM-specific options here  | 
  
| 187 | 
      AOPT =  | 
  
| 188 | 
       | 
  
| 189 | 
      # THUMB-specific options here  | 
  
| 190 | 
      TOPT = -mthumb -DTHUMB  | 
  
| 191 | 
       | 
  
| 192 | 
      # Define C warning options here  | 
  
| 193 | 
      CWARN = -Wall -Wextra -Wstrict-prototypes  | 
  
| 194 | 
       | 
  
| 195 | 
      # Define C++ warning options here  | 
  
| 196 | 
      CPPWARN = -Wall -Wextra  | 
  
| 197 | 
       | 
  
| 198 | 
      #  | 
  
| 199 | 
      # Compiler settings  | 
  
| 200 | 
      ##############################################################################  | 
  
| 201 | 
       | 
  
| 202 | 
      ##############################################################################  | 
  
| 203 | 
      # Start of default section  | 
  
| 204 | 
      #  | 
  
| 205 | 
       | 
  
| 206 | 
      # List all default C defines here, like -D_DEBUG=1  | 
  
| 207 | 
      DDEFS =  | 
  
| 208 | 
       | 
  
| 209 | 
      # List all default ASM defines here, like -D_DEBUG=1  | 
  
| 210 | 
      DADEFS =  | 
  
| 211 | 
       | 
  
| 212 | 
      # List all default directories to look for include files here  | 
  
| 213 | 
      DINCDIR =  | 
  
| 214 | 
       | 
  
| 215 | 
      # List the default directory to look for the libraries here  | 
  
| 216 | 
      DLIBDIR =  | 
  
| 217 | 
       | 
  
| 218 | 
      # List all default libraries here  | 
  
| 219 | 
      DLIBS =  | 
  
| 220 | 
       | 
  
| 221 | 
      #  | 
  
| 222 | 
      # End of default section  | 
  
| 223 | 
      ##############################################################################  | 
  
| 224 | 
       | 
  
| 225 | 
      ##############################################################################  | 
  
| 226 | 
      # Start of user section  | 
  
| 227 | 
      #  | 
  
| 228 | 
       | 
  
| 229 | 
      # List all user C define here, like -D_DEBUG=1  | 
  
| 230 | 
      UDEFS =  | 
  
| 231 | 
       | 
  
| 232 | 
      # Define ASM defines here  | 
  
| 233 | 
      UADEFS =  | 
  
| 234 | 
       | 
  
| 235 | 
      # List all user directories here  | 
  
| 236 | 
      UINCDIR =  | 
  
| 237 | 
       | 
  
| 238 | 
      # List the user directory to look for the libraries here  | 
  
| 239 | 
      ULIBDIR =  | 
  
| 240 | 
       | 
  
| 241 | 
      # List all user libraries here  | 
  
| 242 | 
      ULIBS =  | 
  
| 243 | 
       | 
  
| 244 | 
      #  | 
  
| 245 | 
      # End of user defines  | 
  
| 246 | 
      ##############################################################################  | 
  
| 247 | 
       | 
  
| 248 | 
      ifeq ($(USE_FWLIB),yes)  | 
  
| 249 | 
      include $(CHIBIOS)/ext/stm32lib/stm32lib.mk  | 
  
| 250 | 
      CSRC += $(STM32SRC)  | 
  
| 251 | 
      INCDIR += $(STM32INC)  | 
  
| 252 | 
      USE_OPT += -DUSE_STDPERIPH_DRIVER  | 
  
| 253 | 
      endif  | 
  
| 254 | 
       | 
  
| 255 | 
      RULESPATH = $(CHIBIOS)/os/ports/GCC/ARMCMx  | 
  
| 256 | 
      include $(RULESPATH)/rules.mk  | 
  
| 257 | 
       | 
  
| 258 | 
      include $(AMIRO)/ports/rules.mk  | 
  
| 259 | 
      include $(AMIRO)/devices/flash.mk  |