UAVCAN: Changes to build system

This commit is contained in:
Paul A. Patience 2015-09-29 17:11:47 -04:00
parent a7e6b54265
commit e1460c9987
3 changed files with 43 additions and 11 deletions

View File

@ -6,8 +6,10 @@
config CANUTILS_UAVCAN
bool "UAVCAN Library"
default n
depends on STM32_CAN1
depends on STM32_TIM2 || STM32_TIM3 || STM32_TIM4 || STM32_TIM5 || STM32_TIM6 || STM32_TIM7
depends on STM32_HAVE_CAN1
depends on !STM32_CAN1
depends on !STM32_CAN2
depends on (STM32_HAVE_TIM2 && !STM32_TIM2) || (STM32_HAVE_TIM3 && !STM32_TIM3) || (STM32_HAVE_TIM4 && !STM32_TIM4) || (STM32_HAVE_TIM5 && !STM32_TIM5) || (STM32_HAVE_TIM6 && !STM32_TIM6) || (STM32_HAVE_TIM7 && !STM32_TIM7)
depends on C99_BOOL8
depends on HAVE_CXX
depends on !DISABLE_POLL
@ -52,9 +54,39 @@ config UAVCAN_PYUAVCAN_VERSION
---help---
Python UAVCAN version.
config UAVCAN_STM32_NUM_IFACES
int "Number of CAN Interfaces"
default 1
range 1 1 if !STM32_HAVE_CAN2
range 1 2 if STM32_HAVE_CAN2
if UAVCAN_STM32_TIMER_NUMBER = 2 && STM32_TIM2
comment "Timer 2 is already configured for NuttX"
endif
if UAVCAN_STM32_TIMER_NUMBER = 3 && STM32_TIM3
comment "Timer 3 is already configured for NuttX"
endif
if UAVCAN_STM32_TIMER_NUMBER = 4 && STM32_TIM4
comment "Timer 4 is already configured for NuttX"
endif
if UAVCAN_STM32_TIMER_NUMBER = 5 && STM32_TIM5
comment "Timer 5 is already configured for NuttX"
endif
if UAVCAN_STM32_TIMER_NUMBER = 6 && STM32_TIM6
comment "Timer 6 is already configured for NuttX"
endif
if UAVCAN_STM32_TIMER_NUMBER = 7 && STM32_TIM7
comment "Timer 7 is already configured for NuttX"
endif
config UAVCAN_STM32_TIMER_NUMBER
int "Timer Number"
default 2
default 2 if STM32_HAVE_TIM2 && !STM32_TIM2
default 3 if STM32_HAVE_TIM3 && !STM32_TIM3
default 4 if STM32_HAVE_TIM4 && !STM32_TIM4
default 5 if STM32_HAVE_TIM5 && !STM32_TIM5
default 6 if STM32_HAVE_TIM6 && !STM32_TIM6
default 7 if STM32_HAVE_TIM7 && !STM32_TIM7
range 2 7
---help---
Specifies the timer number.

View File

@ -67,14 +67,9 @@ CXXFLAGS += -I$(LIBUAVCAN_INC) -I$(LIBUAVCAN_STM32_INC) -Idsdlc_generated
CXXFLAGS += -I$(TOPDIR)/arch/arm/src/common -I$(TOPDIR)/arch/arm/src/stm32
CXXFLAGS += -DUAVCAN_STM32_NUTTX=1
CXXFLAGS += -DUAVCAN_STM32_NUM_IFACES=$(CONFIG_UAVCAN_STM32_NUM_IFACES)
CXXFLAGS += -DUAVCAN_STM32_TIMER_NUMBER=$(CONFIG_UAVCAN_STM32_TIMER_NUMBER)
ifeq ($(CONFIG_STM32_CAN2),y)
CXXFLAGS += -DUAVCAN_STM32_NUM_IFACES=2
else
CXXFLAGS += -DUAVCAN_STM32_NUM_IFACES=1
endif
ifeq ($(CONFIG_UAVCAN_CPP03),y)
CXXFLAGS += -std=c++03 -DUAVCAN_CPP_VERSION=UAVCAN_CPP03
else
@ -164,6 +159,9 @@ libuavcan: $(LIBUAVCAN_UNPACKNAME) $(DSDL_UNPACKNAME) $(PYUAVCAN_UNPACKNAME)
dsdlc_generated: libuavcan
$(info $(shell $(LIBUAVCAN_DSDLC) $(UAVCAN_DSDL_DIR)))
$(APPDIR)/include/uavcan: libuavcan/libuavcan/include/uavcan
$(Q) cp -R libuavcan/libuavcan/include/uavcan $(APPDIR)/include
$(CXXOBJS): %$(OBJEXT): %$(CXXEXT)
$(call COMPILEXX, $<, $@)
@ -173,9 +171,9 @@ $(CXXOBJS): %$(OBJEXT): %$(CXXEXT)
install:
context:
context: libuavcan dsdlc_generated $(APPDIR)/include/uavcan
.depend: Makefile $(CXXSRCS) dsdlc_generated
.depend: Makefile $(CXXSRCS)
$(Q) $(MKDEP) $(ROOTDEPPATH) "$(CXX)" -- $(CXXFLAGS) -- $(CXXSRCS) >Make.dep
$(Q) touch $@
@ -185,6 +183,7 @@ clean:
$(call DELFILE, .built)
$(call DELDIR, libuavcan)
$(call DELDIR, dsdlc_generated)
$(call DELDIR, $(APPDIR)/include/uavcan)
distclean: clean
$(call DELFILE, Make.dep)

1
include/.gitignore vendored
View File

@ -1 +1,2 @@
/pcode
/uavcan