diff --git a/conf/Makefile.stm32 b/conf/Makefile.stm32 index 00f1cb69137..707d8678611 100644 --- a/conf/Makefile.stm32 +++ b/conf/Makefile.stm32 @@ -44,10 +44,6 @@ TOOLCHAIN_DIR=$(shell dirname $(TOOLCHAIN)) GCC_BIN_DIR=$(TOOLCHAIN_DIR)/bin GCC_LIB_DIR=$(TOOLCHAIN_DIR)/arm-none-eabi/lib -# Detect if we are using the new libopencm3 or the old libopenstm32 -LIBOPENCM3_LIB=$(shell if [ -e "$(GCC_LIB_DIR)/libopencm3_stm32f1.a" ]; then echo "opencm3_stm32f1"; else echo "opencm3_stm32"; fi) -LIBOPENCM3_DEFS=$(shell if [ -e "$(GCC_LIB_DIR)/libopencm3_stm32f1.a" ]; then echo "-DSTM32F1"; fi) - # Define programs and commands. GCC_BIN_PREFIX=$(GCC_BIN_DIR)/arm-none-eabi CC = $(GCC_BIN_PREFIX)-gcc @@ -66,9 +62,14 @@ CP = $(shell which arm-none-eabi-objcopy) DMP = $(shell which arm-none-eabi-objdump) NM = $(shell which arm-none-eabi-nm) SIZE = $(shell which arm-none-eabi-size) +RM = rm GCC_LIB_DIR=$(shell dirname `which arm-none-eabi-gcc`)/../arm-none-eabi/lib endif +# Detect if we are using the new libopencm3 or the old libopenstm32 +LIBOPENCM3_LIB=$(shell if [ -e "$(GCC_LIB_DIR)/libopencm3_stm32f1.a" ]; then echo "opencm3_stm32f1"; else echo "opencm3_stm32"; fi) +LIBOPENCM3_DEFS=$(shell if [ -e "$(GCC_LIB_DIR)/libopencm3_stm32f1.a" ]; then echo "-DSTM32F1"; fi) + #first try to find OpenOCD in the path OOCD = $(shell which openocd) #if OpenOCD could not be found in the path, try the toolchain dir diff --git a/sw/tools/gen_aircraft.ml b/sw/tools/gen_aircraft.ml index 72b25931d4a..a9391293267 100644 --- a/sw/tools/gen_aircraft.ml +++ b/sw/tools/gen_aircraft.ml @@ -232,7 +232,10 @@ let parse_firmware = fun makefile_ac firmware -> (* print makefile for this target *) fprintf makefile_ac "\n###########\n# -target: '%s'\n" (Xml.attrib target "name"); fprintf makefile_ac "ifeq ($(TARGET), %s)\n" (Xml.attrib target "name"); - try fprintf makefile_ac "BOARD_PROCESSOR = %s\n" (Xml.attrib target "processor") with _ -> (); + begin (* Check for "processor" attribute *) + try fprintf makefile_ac "BOARD_PROCESSOR = %s\n" (Xml.attrib target "processor") + with _ -> () + end; List.iter (print_firmware_configure makefile_ac) config; List.iter (print_firmware_configure makefile_ac) t_config; List.iter (print_firmware_define makefile_ac) defines;