2 # Copyright (c) 2009-2013, The OpenPilot Team, http://www.openpilot.org
4 # This program is free software; you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 # You should have received a copy of the GNU General Public License along
15 # with this program; if not, write to the Free Software Foundation, Inc.,
16 # 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 ifndef FLIGHT_MAKEFILE
20 $(error Top level Makefile must be used to build this target
)
23 include ..
/..
/boards
/$(BOARD_NAME
)/board-info.mk
24 include $(FLIGHT_ROOT_DIR
)/make
/firmware-defs.mk
27 override USE_DSP_LIB
:= NO
32 OPSYSTEMINC
= $(OPSYSTEM
)/inc
34 PIOSCOMMON
= $(PIOS
)/common
35 FLIGHTLIBINC
= $(FLIGHTLIB
)/inc
36 HWDEFSINC
= ..
/..
/boards
/$(BOARD_NAME
)
38 # List C source files here (C dependencies are automatically generated).
39 # Use file-extension c for "c-only"-files
40 SRC
+= $(OPSYSTEM
)/main.c
41 SRC
+= $(OPSYSTEM
)/pios_board.c
42 SRC
+= $(PIOSCOMMON
)/pios_led.c
44 ifeq ($(MCU
),cortex-m3
)
45 include $(PIOS
)/stm32f10x
/library.mk
47 ## The standard CMSIS startup
48 SRC
+= $(CMSIS_DEVICEDIR
)/system_stm32f10x.c
50 # Set linker-script name depending on selected submodel name
51 LDFLAGS
+= -T
$(LINKER_SCRIPTS_PATH
)/link_
$(BOARD
)_memory.
ld
52 LDFLAGS
+= -T
$(LINKER_SCRIPTS_PATH
)/link_
$(BOARD
)_sections.
ld
53 else ifeq ($(MCU
),cortex-m4
)
54 include $(PIOS
)/stm32f4xx
/library.mk
55 # Set linker-script name depending on selected submodel name
56 # Using the _compat ld script ensure that the bootloader updated is compiled with irqstack in sram
57 # This allow to be used with bootloader earlier than rel5
58 LDFLAGS
+= $(addprefix -T
,$(LINKER_SCRIPTS_APP
))
59 SRC
+= $(HWDEFSINC
)/firmware
/cm3_fault_handlers.c
60 SRC
+= $(HWDEFSINC
)/firmware
/dcc_stdio.c
62 $(error Unsupported MCU for BootloaderUpdater
: $(MCU
))
65 # List any extra directories to look for include files here.
66 # Each directory must be seperated by a space.
67 EXTRAINCDIRS
+= $(PIOS
)
68 EXTRAINCDIRS
+= $(PIOSINC
)
69 EXTRAINCDIRS
+= $(HWDEFSINC
)
70 EXTRAINCDIRS
+= $(FLIGHTLIBINC
)
71 EXTRAINCDIRS
+= $(PIOSCOMMON
)
72 EXTRAINCDIRS
+= $(OPSYSTEMINC
)
74 # Link: create ELF output file from object files.
75 EXTRAOBJ
:= $(FLIGHT_OUT_DIR
)/bl_
$(BOARD_NAME
)/bl_
$(BOARD_NAME
).bin.o
77 include $(FLIGHT_ROOT_DIR
)/make
/common-defs.mk