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 ifneq (,$(findstring STM32F10
,$(CHIP
)))
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 ifneq (,$(findstring STM32F4
,$(CHIP
)))
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 else ifneq (,$(findstring STM32F30
,$(CHIP
)))
60 include $(PIOS
)/stm32f30x
/library.mk
61 # Set linker-script name depending on selected submodel name
62 # Using the _compat ld script ensure that the bootloader updated is compiled with irqstack in sram
63 # This allow to be used with bootloader earlier than rel5
64 # LDFLAGS += $(addprefix -T,$(LINKER_SCRIPTS_APP))
66 $(error Unsupported MCU for BootloaderUpdater
: $(CHIP
))
69 # List any extra directories to look for include files here.
70 # Each directory must be seperated by a space.
71 EXTRAINCDIRS
+= $(PIOS
)
72 EXTRAINCDIRS
+= $(PIOSINC
)
73 EXTRAINCDIRS
+= $(HWDEFSINC
)
74 EXTRAINCDIRS
+= $(FLIGHTLIBINC
)
75 EXTRAINCDIRS
+= $(PIOSCOMMON
)
76 EXTRAINCDIRS
+= $(OPSYSTEMINC
)
78 # Link: create ELF output file from object files.
79 EXTRAOBJ
:= $(FLIGHT_OUT_DIR
)/bl_
$(BOARD_NAME
)/bl_
$(BOARD_NAME
).bin.o
81 include $(FLIGHT_ROOT_DIR
)/make
/common-defs.mk