1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

*.mk: fix double '/' in path names ($dir always returns it as a last char)

Also minor formatting of all library.mk files.

Conflicts:
	flight/PiOS/Common/Libraries/CMSIS2/library.mk
This commit is contained in:
Oleg Semyonov 2013-03-17 16:59:29 +02:00
parent 38d822d2f5
commit 992bd696a6
8 changed files with 43 additions and 49 deletions

View File

@ -5,5 +5,5 @@
RSCODE_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
RSCODE_SRC := berlekamp.c crcgen.c galois.c rs.c
SRC += $(addprefix $(RSCODE_DIR)/,$(RSCODE_SRC))
SRC += $(addprefix $(RSCODE_DIR),$(RSCODE_SRC))
EXTRAINCDIRS += $(RSCODE_DIR)

View File

@ -2,28 +2,26 @@
# Rules to add CMSIS2 to a PiOS target
#
CMSIS2_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
EXTRAINCDIRS += $(CMSIS2_DIR)/Include
CMSIS2_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
EXTRAINCDIRS += $(CMSIS2_DIR)Include
# Rules to build the ARM DSP library
ifeq ($(USE_DSP_LIB), YES)
DSPLIB_NAME := dsp
CMSIS_DSPLIB := $(CMSIS2_DIR)/DSP_Lib/Source
DSPLIB_NAME := dsp
CMSIS_DSPLIB := $(CMSIS2_DIR)/DSP_Lib/Source
# Compile all files into output directory
DSPLIB_SRC := $(wildcard $(CMSIS_DSPLIB)/*/*.c)
DSPLIB_SRCBASE := $(notdir $(basename $(DSPLIB_SRC)))
$(foreach src, $(DSPLIB_SRC), $(eval $(call COMPILE_C_TEMPLATE, $(src))))
# Compile all files into output directory
DSPLIB_SRC := $(wildcard $(CMSIS_DSPLIB)/*/*.c)
DSPLIB_SRCBASE := $(notdir $(basename $(DSPLIB_SRC)))
$(foreach src, $(DSPLIB_SRC), $(eval $(call COMPILE_C_TEMPLATE, $(src))))
# Define the object files directory and a list of object files for the library
DSPLIB_OBJDIR = $(OUTDIR)
DSPLIB_OBJ = $(addprefix $(DSPLIB_OBJDIR)/, $(addsuffix .o, $(DSPLIB_SRCBASE)))
# Define the object files directory and a list of object files for the library
DSPLIB_OBJDIR = $(OUTDIR)
DSPLIB_OBJ = $(addprefix $(DSPLIB_OBJDIR)/, $(addsuffix .o, $(DSPLIB_SRCBASE)))
# Create a library file
$(eval $(call ARCHIVE_TEMPLATE, $(OUTDIR)/lib$(DSPLIB_NAME).a, $(DSPLIB_OBJ), $(DSPLIB_OBJDIR)))
# Add library to the list of linked objects
ALLLIB += $(OUTDIR)/lib$(DSPLIB_NAME).a
# Create a library file
$(eval $(call ARCHIVE_TEMPLATE, $(OUTDIR)/lib$(DSPLIB_NAME).a, $(DSPLIB_OBJ), $(DSPLIB_OBJDIR)))
# Add library to the list of linked objects
ALLLIB += $(OUTDIR)/lib$(DSPLIB_NAME).a
endif

View File

@ -5,7 +5,6 @@
# has been defined and add in the target-specific pieces separately.
#
FREERTOS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))/Source
SRC += $(wildcard $(FREERTOS_DIR)/*.c)
EXTRAINCDIRS += $(FREERTOS_DIR)/include
FREERTOS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))/Source
SRC += $(wildcard $(FREERTOS_DIR)/*.c)
EXTRAINCDIRS += $(FREERTOS_DIR)/include

View File

@ -2,7 +2,6 @@
# Rules to add DOSFS to a PiOS target
#
DOSFS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
SRC += $(wildcard $(DOSFS_DIR)*.c)
EXTRAINCDIRS += $(DOSFS_DIR)
DOSFS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
SRC += $(wildcard $(DOSFS_DIR)*.c)
EXTRAINCDIRS += $(DOSFS_DIR)

View File

@ -2,7 +2,6 @@
# Rules to add the MSHeap allocator to a PiOS target
#
MSHEAP_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
SRC += $(wildcard $(MSHEAP_DIR)*.c)
EXTRAINCDIRS += $(MSHEAP_DIR)
MSHEAP_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
SRC += $(wildcard $(MSHEAP_DIR)*.c)
EXTRAINCDIRS += $(MSHEAP_DIR)

View File

@ -16,24 +16,24 @@ CDEFS += -DARM_MATH_CM3
ARCHFLAGS += -mcpu=cortex-m3
# Board-specific startup files
ASRC += $(PIOS_DEVLIB)/startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
ASRC += $(PIOS_DEVLIB)startup_stm32f10x_$(MODEL)$(MODEL_SUFFIX).S
# PIOS device library source and includes
SRC += $(wildcard $(PIOS_DEVLIB)*.c)
# CMSIS for the F1
CMSIS_DIR = $(PIOS_DEVLIB)/Libraries/CMSIS/Core/CM3
CMSIS_DIR = $(PIOS_DEVLIB)Libraries/CMSIS/Core/CM3
SRC += $(CMSIS_DIR)/core_cm3.c
SRC += $(CMSIS_DIR)/system_stm32f10x.c
EXTRAINCDIRS += $(CMSIS_DIR)
# ST Peripheral library
PERIPHLIB = $(PIOS_DEVLIB)/Libraries/STM32F10x_StdPeriph_Driver
PERIPHLIB = $(PIOS_DEVLIB)Libraries/STM32F10x_StdPeriph_Driver
SRC += $(wildcard $(PERIPHLIB)/src/*.c)
EXTRAINCDIRS += $(PERIPHLIB)/inc
# ST USB Device library
USBDEVLIB = $(PIOS_DEVLIB)/Libraries/STM32_USB-FS-Device_Driver
USBDEVLIB = $(PIOS_DEVLIB)Libraries/STM32_USB-FS-Device_Driver
SRC += $(wildcard $(USBDEVLIB)/src/*.c)
EXTRAINCDIRS += $(USBDEVLIB)/inc
@ -44,7 +44,7 @@ EXTRAINCDIRS += $(USBDEVLIB)/inc
# the device-specific pieces of the code.
#
ifneq ($(FREERTOS_DIR),)
FREERTOS_PORTDIR := $(PIOS_DEVLIB)/Libraries/FreeRTOS/Source
FREERTOS_PORTDIR := $(PIOS_DEVLIB)Libraries/FreeRTOS/Source
SRC += $(wildcard $(FREERTOS_PORTDIR)/portable/GCC/ARM_CM3/*.c)
SRC += $(wildcard $(FREERTOS_PORTDIR)/portable/MemMang/heap_1.c)
EXTRAINCDIRS += $(FREERTOS_PORTDIR)/portable/GCC/ARM_CM3

View File

@ -6,10 +6,10 @@
PIOS_DEVLIB := $(dir $(lastword $(MAKEFILE_LIST)))
# Hardcoded linker script names for now
LINKER_SCRIPTS_APP = $(PIOS_DEVLIB)/link_STM32F4xx_OP_memory.ld \
$(PIOS_DEVLIB)/link_STM32F4xx_sections.ld
LINKER_SCRIPTS_BL = $(PIOS_DEVLIB)/link_STM32F4xx_BL_memory.ld \
$(PIOS_DEVLIB)/link_STM32F4xx_sections.ld
LINKER_SCRIPTS_APP = $(PIOS_DEVLIB)link_STM32F4xx_OP_memory.ld \
$(PIOS_DEVLIB)link_STM32F4xx_sections.ld
LINKER_SCRIPTS_BL = $(PIOS_DEVLIB)link_STM32F4xx_BL_memory.ld \
$(PIOS_DEVLIB)link_STM32F4xx_sections.ld
# Compiler options implied by the F4xx
CDEFS += -DSTM32F4XX
@ -20,27 +20,27 @@ ARCHFLAGS += -mcpu=cortex-m4 -march=armv7e-m -mfpu=fpv4-sp-d16 -mfloat-abi=hard
# PIOS device library source and includes
SRC += $(wildcard $(PIOS_DEVLIB)*.c)
EXTRAINCDIRS += $(PIOS_DEVLIB)/inc
EXTRAINCDIRS += $(PIOS_DEVLIB)inc
# CMSIS for the F4
include $(PIOSCOMMON)/Libraries/CMSIS2/library.mk
CMSIS2_DEVICEDIR := $(PIOS_DEVLIB)/Libraries/CMSIS2/Device/ST/STM32F4xx
CMSIS2_DEVICEDIR := $(PIOS_DEVLIB)Libraries/CMSIS2/Device/ST/STM32F4xx
SRC += $(wildcard $(CMSIS2_DEVICEDIR)/Source/$(BOARD_NAME)/*.c)
EXTRAINCDIRS += $(CMSIS2_DEVICEDIR)/Include
# ST Peripheral library
PERIPHLIB = $(PIOS_DEVLIB)/Libraries/STM32F4xx_StdPeriph_Driver
PERIPHLIB = $(PIOS_DEVLIB)Libraries/STM32F4xx_StdPeriph_Driver
SRC += $(wildcard $(PERIPHLIB)/src/*.c)
EXTRAINCDIRS += $(PERIPHLIB)/inc
# ST USB OTG library
USBOTGLIB = $(PIOS_DEVLIB)/Libraries/STM32_USB_OTG_Driver
USBOTGLIB = $(PIOS_DEVLIB)Libraries/STM32_USB_OTG_Driver
USBOTGLIB_SRC = usb_core.c usb_dcd.c usb_dcd_int.c
SRC += $(addprefix $(USBOTGLIB)/src/,$(USBOTGLIB_SRC))
EXTRAINCDIRS += $(USBOTGLIB)/inc
# ST USB Device library
USBDEVLIB = $(PIOS_DEVLIB)/Libraries/STM32_USB_Device_Library
USBDEVLIB = $(PIOS_DEVLIB)Libraries/STM32_USB_Device_Library
SRC += $(wildcard $(USBDEVLIB)/Core/src/*.c)
EXTRAINCDIRS += $(USBDEVLIB)/Core/inc
@ -51,7 +51,7 @@ EXTRAINCDIRS += $(USBDEVLIB)/Core/inc
# the device-specific pieces of the code.
#
ifneq ($(FREERTOS_DIR),)
FREERTOS_PORTDIR := $(PIOS_DEVLIB)/Libraries/FreeRTOS/Source
FREERTOS_PORTDIR := $(PIOS_DEVLIB)Libraries/FreeRTOS/Source
SRC += $(wildcard $(FREERTOS_PORTDIR)/portable/GCC/ARM_CM4F/*.c)
EXTRAINCDIRS += $(FREERTOS_PORTDIR)/portable/GCC/ARM_CM4F
include $(PIOSCOMMON)/Libraries/msheap/library.mk

View File

@ -5,7 +5,6 @@
# has been defined and add in the target-specific pieces separately.
#
FREERTOS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))/Source
SRC += $(wildcard $(FREERTOS_DIR)/*.c)
EXTRAINCDIRS += $(FREERTOS_DIR)/include
FREERTOS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))/Source
SRC += $(wildcard $(FREERTOS_DIR)/*.c)
EXTRAINCDIRS += $(FREERTOS_DIR)/include