1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-04 12:24:11 +01:00
LibrePilot/flight/pios/stm32f10x/library.mk

52 lines
1.6 KiB
Makefile
Raw Normal View History

2012-12-30 13:28:20 +01:00
#
Final step: lot of small fixes, last commit in this commit series This is the first cleanup pass through makefiles and pios. Probably it is difficult to track changes due to the nature of them. I would recommend to look at resulting files and compiled code instead. NOTE: original branch was rebased and lot of conflicts were fixed on the way. So do not expect that every commit in this series will be buildable (unlike original branch). Only final result was tested. The main goal was to remove as much duplication of code (and copy/paste errors) as possible, moving common parts out of Makefiles. It still is not perfect, and mostly no code changes made - Makefiles and #ifdefs only. But please while testing make sure that all code works as before, and no modules/options are missed by accident. Brief list of changes: - Moved common parts of Makefiles into the set of *.mk files. - Changed method of passing common vars from top Makefile to lower ones. - Some pios cleanup, mostly #ifdefs, and all pios_config.h files. - Many obsolete files removed (for instance, AHRS files, op_config.h). - Many obsolete or unused macros removed or fixed/renamed (ALL_DIGNOSTICS). - Unified pios_config.h template. Please don't remove lines for board configs, only comment/uncomment them. Adding new PIOS options, please propagate them to all board files keeping the same order. - Some formatting, spacing, indentation (no line endings change yet). - Some cosmetic fixes (no more C:\X\Y\filename.c printings on Windows). - Added some library.mk files to move libs into AR achives later. - EntireFlash target now uses cross-platform python script to generate bin files. So it works on all supported platforms: Linux, OSX, Windows. - Top level packaging is completely rewritten. Now it is a part of top Makefile. As such, all dependencies are checked and accounted, no more 'make -j' problems should occur. - Default GCS_BUILD_CONF is release now, may be changed if necessary using 'make GCS_BUILD_CONF=debug gcs'. - GCS build paths are separated into debug and release, so no more obj file clashes. Packaging system supports only release builds. - New target is introduced: 'clean_package'. Now 'make package' does not clean build directory. Use clean_package instead for distributable builds. - Targets like 'all', 'opfw_resource', etc now will print extra contex in parallel builds too. - If any of 'package', 'clean_package', 'opfw_resource' targets are given on command line, GCS build will depend on the resource, so all fw_*.opfw targets will be built and embedded into GCS. By default GCS does not depend on resource, and will be built w/o firmware (unless the resource files already exist and the Qt resource file is generated). - fw_simposix (ELF executable) is now packaged for linux. Run'n'play! - Make help is refined and is now up to date. Still broken: - UnitTests, should be fixed - SimPosix: buildable, but should be reworked. Next planned passes to do: - toolchain bootstrapping and packaging (including windows - WIP) - CMSIS/StdPeriph lib cleanup - more PIOS cleanup - move libs into AR archives to save build time - sim targets refactir and cleanup - move android-related directories under <top>/android - unit test targets fix - source code line ending changes (there are many different, were not changed) - coding style Merging this, please use --no-ff git option to make it the real commit point Conflicts: A lot of... :-)
2013-03-24 12:02:08 +01:00
# Rules to (help) build the F10x device support.
2012-12-30 13:28:20 +01:00
#
# Directory containing this makefile
PIOS_DEVLIB := $(dir $(lastword $(MAKEFILE_LIST)))
# Linker scripts path (contains board-specific scripts)
LINKER_SCRIPTS_PATH = $(PIOS_DEVLIB)
# Compiler options implied by the F10x
CDEFS += -DSTM32F10X -DSTM32F10X_$(MODEL)
CDEFS += -DUSE_STDPERIPH_DRIVER
CDEFS += -DARM_MATH_CM3
CDEFS += -DHSE_VALUE=$(OSCILLATOR_FREQ)
ARCHFLAGS += -mcpu=cortex-m3 --specs=nano.specs
# Board-specific startup files
ASRC += $(PIOS_DEVLIB)startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
# PIOS device library source and includes
SRC += $(sort $(wildcard $(PIOS_DEVLIB)*.c))
2012-12-30 13:28:20 +01:00
# CMSIS for the F1
2013-04-24 23:38:56 +02:00
include $(PIOS)/common/libraries/CMSIS2/library.mk
CMSIS_DIR = $(PIOS_DEVLIB)libraries/CMSIS/Core/CM3
SRC += $(CMSIS_DIR)/core_cm3.c
EXTRAINCDIRS += $(CMSIS_DIR)
# ST Peripheral library
PERIPHLIB = $(PIOS_DEVLIB)libraries/STM32F10x_StdPeriph_Driver
SRC += $(sort $(wildcard $(PERIPHLIB)/src/*.c))
EXTRAINCDIRS += $(PERIPHLIB)/inc
# ST USB Device library
USBDEVLIB = $(PIOS_DEVLIB)libraries/STM32_USB-FS-Device_Driver
SRC += $(sort $(wildcard $(USBDEVLIB)/src/*.c))
EXTRAINCDIRS += $(USBDEVLIB)/inc
#
# FreeRTOS
#
# If the application has included the generic FreeRTOS support, then add in
# the device-specific pieces of the code.
2012-12-30 13:28:20 +01:00
#
ifneq ($(FREERTOS_DIR),)
FREERTOS_PORTDIR := $(PIOS_DEVLIB)libraries/FreeRTOS/Source
SRC += $(sort $(wildcard $(FREERTOS_PORTDIR)/portable/GCC/ARM_CM3/*.c))
Merge branch 'amorale/OP-900_update_freertos_740' into next Conflicts: flight/PiOS/Common/Libraries/FreeRTOS/Source/croutine.c flight/PiOS/Common/Libraries/FreeRTOS/Source/include/FreeRTOS.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/StackMacros.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/croutine.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/list.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/mpu_wrappers.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/portable.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/projdefs.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/queue.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/semphr.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/task.h flight/PiOS/Common/Libraries/FreeRTOS/Source/include/timers.h flight/PiOS/Common/Libraries/FreeRTOS/Source/list.c flight/PiOS/Common/Libraries/FreeRTOS/Source/queue.c flight/PiOS/Common/Libraries/FreeRTOS/Source/tasks.c flight/PiOS/Common/Libraries/FreeRTOS/Source/timers.c flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/port.c flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM3/portmacro.h flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_1.c flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_2.c flight/PiOS/STM32F10x/Libraries/FreeRTOS/Source/portable/MemMang/heap_3.c flight/PiOS/STM32F10x/library.mk flight/PiOS/STM32F4xx/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM4F/port.c flight/PiOS/STM32F4xx/Libraries/FreeRTOS/Source/portable/GCC/ARM_CM4F/portmacro.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/FreeRTOS.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/StackMacros.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/croutine.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/list.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/mpu_wrappers.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/portable.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/projdefs.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/queue.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/semphr.h flight/PiOS/posix/Libraries/FreeRTOS/Source/include/task.h flight/PiOS/posix/Libraries/FreeRTOS/Source/list.c flight/PiOS/posix/Libraries/FreeRTOS/Source/queue.c
2013-04-23 21:57:50 +02:00
SRC += $(sort $(wildcard $(FREERTOS_DIR)/portable/MemMang/heap_1.c))
EXTRAINCDIRS += $(FREERTOS_PORTDIR)/portable/GCC/ARM_CM3
endif