From 48b811f6fa28df928147853a1e987b85cd48c04b Mon Sep 17 00:00:00 2001 From: James Goppert Date: Fri, 30 Sep 2011 16:55:27 -0400 Subject: [PATCH] Updated cmake. --- CMakeLists.txt | 44 ++ apo/Makefile | 774 ++++++++++++++++++++++++++++++- apo/apo.pde | 8 +- cmake/modules/FindArduino.cmake | 27 +- cmake/toolchains/Arduino.cmake | 22 +- libraries/APO/APO_DefaultSetup.h | 2 +- 6 files changed, 850 insertions(+), 27 deletions(-) create mode 100644 CMakeLists.txt diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..e229bb6c28 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,44 @@ +cmake_minimum_required(VERSION 2.8) + +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) +set(CMAKE_TOOLCHAIN_FILE ${CMAKE_SOURCE_DIR}/cmake/toolchains/Arduino.cmake) + +# modify flags from default toolchain flags +set(APM_OPT_FLAGS "-Os -Wformat -Wall -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Wformat=2 -Wno-reorder") + +set(ARDUINO_C_FLAGS "${APM_OPT_FLAGS} -mcall-prologues -ffunction-sections -fdata-sections") +set(ARDUINO_CXX_FLAGS "${APM_OPT_FLAGS} -mcall-prologues -ffunction-sections -fdata-sections -fno-exceptions") +set(ARDUINO_LINKER_FLAGS "${APM_OPT_FLAGS} -Wl,--gc-sections") + + + +project(ArduPilotMega C CXX) + +# set default cmake build type to RelWithDebInfo (None Debug Release RelWithDebInfo MinSizeRel) +if( NOT DEFINED CMAKE_BUILD_TYPE ) + set( CMAKE_BUILD_TYPE "RelWithDebInfo" ) +endif() + +#set (CMAKE_CXX_SOURCE_FILE_EXTENSIONS pde) + +find_package(Arduino 22 REQUIRED) + +# determine board being used +if (NOT DEFINED BOARD) + message(STATUS "board not defined, assuming mega, use cmake -DBOARD=mega2560 , etc. to specify") + set(BOARD "mega") +endif() +message(STATUS "Board configured as: ${BOARD}") + +# apo +set(apo_ASFLAGS "-assembler-with-cpp") +set(apo_BOARD ${BOARD}) +set(apo_LIBS + c + m) +set(apo_SRCS + apo/apo.cpp + ) + +set(GCS_MAVLink_RECURSE False) +generate_arduino_firmware(apo) diff --git a/apo/Makefile b/apo/Makefile index 1d9b6a022d..ac3ddd1972 100644 --- a/apo/Makefile +++ b/apo/Makefile @@ -1 +1,773 @@ -include ../libraries/AP_Common/Arduino.mk +# CMAKE generated file: DO NOT EDIT! +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 + +# Default target executed when no arguments are given to make. +default_target: all +.PHONY : default_target + +#============================================================================= +# Special targets provided by cmake. + +# Disable implicit rules so canoncical targets will work. +.SUFFIXES: + +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + +.SUFFIXES: .hpux_make_needs_suffix_list + +# Suppress display of executed commands. +$(VERBOSE).SILENT: + +# A target that is always out of date. +cmake_force: +.PHONY : cmake_force + +#============================================================================= +# Set environment variables for the build. + +# The shell in which to execute make rules. +SHELL = /bin/sh + +# The CMake executable. +CMAKE_COMMAND = /usr/bin/cmake + +# The command to remove a file. +RM = /usr/bin/cmake -E remove -f + +# The top-level source directory on which CMake was run. +CMAKE_SOURCE_DIR = /hsl/homes/jgoppert/Projects/ardupilot-mega/apo + +# The top-level build directory on which CMake was run. +CMAKE_BINARY_DIR = /hsl/homes/jgoppert/Projects/ardupilot-mega/apo + +#============================================================================= +# Targets provided globally by CMake. + +# Special rule for the target edit_cache +edit_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..." + /usr/bin/cmake -i . +.PHONY : edit_cache + +# Special rule for the target edit_cache +edit_cache/fast: edit_cache +.PHONY : edit_cache/fast + +# Special rule for the target install +install: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install + +# Special rule for the target install +install/fast: preinstall/fast + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Install the project..." + /usr/bin/cmake -P cmake_install.cmake +.PHONY : install/fast + +# Special rule for the target install/local +install/local: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing only the local directory..." + /usr/bin/cmake -DCMAKE_INSTALL_LOCAL_ONLY=1 -P cmake_install.cmake +.PHONY : install/local + +# Special rule for the target install/local +install/local/fast: install/local +.PHONY : install/local/fast + +# Special rule for the target install/strip +install/strip: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Installing the project stripped..." + /usr/bin/cmake -DCMAKE_INSTALL_DO_STRIP=1 -P cmake_install.cmake +.PHONY : install/strip + +# Special rule for the target install/strip +install/strip/fast: install/strip +.PHONY : install/strip/fast + +# Special rule for the target list_install_components +list_install_components: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Available install components are: \"Unspecified\"" +.PHONY : list_install_components + +# Special rule for the target list_install_components +list_install_components/fast: list_install_components +.PHONY : list_install_components/fast + +# Special rule for the target package +package: preinstall + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool..." + /usr/bin/cpack --config ./CPackConfig.cmake +.PHONY : package + +# Special rule for the target package +package/fast: package +.PHONY : package/fast + +# Special rule for the target package_source +package_source: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Run CPack packaging tool for source..." + /usr/bin/cpack --config ./CPackSourceConfig.cmake /hsl/homes/jgoppert/Projects/ardupilot-mega/apo/CPackSourceConfig.cmake +.PHONY : package_source + +# Special rule for the target package_source +package_source/fast: package_source +.PHONY : package_source/fast + +# Special rule for the target rebuild_cache +rebuild_cache: + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache + +# Special rule for the target rebuild_cache +rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast + +# The main all target +all: cmake_check_build_system + $(CMAKE_COMMAND) -E cmake_progress_start /hsl/homes/jgoppert/Projects/ardupilot-mega/apo/CMakeFiles /hsl/homes/jgoppert/Projects/ardupilot-mega/apo/CMakeFiles/progress.marks + $(MAKE) -f CMakeFiles/Makefile2 all + $(CMAKE_COMMAND) -E cmake_progress_start /hsl/homes/jgoppert/Projects/ardupilot-mega/apo/CMakeFiles 0 +.PHONY : all + +# The main clean target +clean: + $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean + +# The main clean target +clean/fast: clean +.PHONY : clean/fast + +# Prepare targets for installation. +preinstall: all + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall + +# Prepare targets for installation. +preinstall/fast: + $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast + +# clear depends +depend: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend + +#============================================================================= +# Target rules for targets named apo + +# Build rule for target. +apo: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 apo +.PHONY : apo + +# fast build rule for target. +apo/fast: + $(MAKE) -f CMakeFiles/apo.dir/build.make CMakeFiles/apo.dir/build +.PHONY : apo/fast + +#============================================================================= +# Target rules for targets named apo-serial + +# Build rule for target. +apo-serial: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 apo-serial +.PHONY : apo-serial + +# fast build rule for target. +apo-serial/fast: + $(MAKE) -f CMakeFiles/apo-serial.dir/build.make CMakeFiles/apo-serial.dir/build +.PHONY : apo-serial/fast + +#============================================================================= +# Target rules for targets named apo-upload + +# Build rule for target. +apo-upload: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 apo-upload +.PHONY : apo-upload + +# fast build rule for target. +apo-upload/fast: + $(MAKE) -f CMakeFiles/apo-upload.dir/build.make CMakeFiles/apo-upload.dir/build +.PHONY : apo-upload/fast + +#============================================================================= +# Target rules for targets named upload + +# Build rule for target. +upload: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 upload +.PHONY : upload + +# fast build rule for target. +upload/fast: + $(MAKE) -f CMakeFiles/upload.dir/build.make CMakeFiles/upload.dir/build +.PHONY : upload/fast + +#============================================================================= +# Target rules for targets named AP_ADC + +# Build rule for target. +AP_ADC: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_ADC +.PHONY : AP_ADC + +# fast build rule for target. +AP_ADC/fast: + $(MAKE) -f libs/AP_ADC/CMakeFiles/AP_ADC.dir/build.make libs/AP_ADC/CMakeFiles/AP_ADC.dir/build +.PHONY : AP_ADC/fast + +#============================================================================= +# Target rules for targets named mega_CORE + +# Build rule for target. +mega_CORE: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 mega_CORE +.PHONY : mega_CORE + +# fast build rule for target. +mega_CORE/fast: + $(MAKE) -f libs/AP_ADC/CMakeFiles/mega_CORE.dir/build.make libs/AP_ADC/CMakeFiles/mega_CORE.dir/build +.PHONY : mega_CORE/fast + +#============================================================================= +# Target rules for targets named AP_Common + +# Build rule for target. +AP_Common: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_Common +.PHONY : AP_Common + +# fast build rule for target. +AP_Common/fast: + $(MAKE) -f libs/AP_Common/CMakeFiles/AP_Common.dir/build.make libs/AP_Common/CMakeFiles/AP_Common.dir/build +.PHONY : AP_Common/fast + +#============================================================================= +# Target rules for targets named AP_Compass + +# Build rule for target. +AP_Compass: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_Compass +.PHONY : AP_Compass + +# fast build rule for target. +AP_Compass/fast: + $(MAKE) -f libs/AP_Compass/CMakeFiles/AP_Compass.dir/build.make libs/AP_Compass/CMakeFiles/AP_Compass.dir/build +.PHONY : AP_Compass/fast + +#============================================================================= +# Target rules for targets named AP_DCM + +# Build rule for target. +AP_DCM: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_DCM +.PHONY : AP_DCM + +# fast build rule for target. +AP_DCM/fast: + $(MAKE) -f libs/AP_DCM/CMakeFiles/AP_DCM.dir/build.make libs/AP_DCM/CMakeFiles/AP_DCM.dir/build +.PHONY : AP_DCM/fast + +#============================================================================= +# Target rules for targets named AP_EEPROMB + +# Build rule for target. +AP_EEPROMB: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_EEPROMB +.PHONY : AP_EEPROMB + +# fast build rule for target. +AP_EEPROMB/fast: + $(MAKE) -f libs/AP_EEPROMB/CMakeFiles/AP_EEPROMB.dir/build.make libs/AP_EEPROMB/CMakeFiles/AP_EEPROMB.dir/build +.PHONY : AP_EEPROMB/fast + +#============================================================================= +# Target rules for targets named AP_GPS + +# Build rule for target. +AP_GPS: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_GPS +.PHONY : AP_GPS + +# fast build rule for target. +AP_GPS/fast: + $(MAKE) -f libs/AP_GPS/CMakeFiles/AP_GPS.dir/build.make libs/AP_GPS/CMakeFiles/AP_GPS.dir/build +.PHONY : AP_GPS/fast + +#============================================================================= +# Target rules for targets named AP_IMU + +# Build rule for target. +AP_IMU: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_IMU +.PHONY : AP_IMU + +# fast build rule for target. +AP_IMU/fast: + $(MAKE) -f libs/AP_IMU/CMakeFiles/AP_IMU.dir/build.make libs/AP_IMU/CMakeFiles/AP_IMU.dir/build +.PHONY : AP_IMU/fast + +#============================================================================= +# Target rules for targets named AP_Math + +# Build rule for target. +AP_Math: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_Math +.PHONY : AP_Math + +# fast build rule for target. +AP_Math/fast: + $(MAKE) -f libs/AP_Math/CMakeFiles/AP_Math.dir/build.make libs/AP_Math/CMakeFiles/AP_Math.dir/build +.PHONY : AP_Math/fast + +#============================================================================= +# Target rules for targets named APM_BMP085 + +# Build rule for target. +APM_BMP085: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 APM_BMP085 +.PHONY : APM_BMP085 + +# fast build rule for target. +APM_BMP085/fast: + $(MAKE) -f libs/APM_BMP085/CMakeFiles/APM_BMP085.dir/build.make libs/APM_BMP085/CMakeFiles/APM_BMP085.dir/build +.PHONY : APM_BMP085/fast + +#============================================================================= +# Target rules for targets named mega_Wire + +# Build rule for target. +mega_Wire: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 mega_Wire +.PHONY : mega_Wire + +# fast build rule for target. +mega_Wire/fast: + $(MAKE) -f libs/APM_BMP085/CMakeFiles/mega_Wire.dir/build.make libs/APM_BMP085/CMakeFiles/mega_Wire.dir/build +.PHONY : mega_Wire/fast + +#============================================================================= +# Target rules for targets named APM_PerfMon + +# Build rule for target. +APM_PerfMon: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 APM_PerfMon +.PHONY : APM_PerfMon + +# fast build rule for target. +APM_PerfMon/fast: + $(MAKE) -f libs/APM_PerfMon/CMakeFiles/APM_PerfMon.dir/build.make libs/APM_PerfMon/CMakeFiles/APM_PerfMon.dir/build +.PHONY : APM_PerfMon/fast + +#============================================================================= +# Target rules for targets named APM_PI + +# Build rule for target. +APM_PI: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 APM_PI +.PHONY : APM_PI + +# fast build rule for target. +APM_PI/fast: + $(MAKE) -f libs/APM_PI/CMakeFiles/APM_PI.dir/build.make libs/APM_PI/CMakeFiles/APM_PI.dir/build +.PHONY : APM_PI/fast + +#============================================================================= +# Target rules for targets named APM_RC + +# Build rule for target. +APM_RC: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 APM_RC +.PHONY : APM_RC + +# fast build rule for target. +APM_RC/fast: + $(MAKE) -f libs/APM_RC/CMakeFiles/APM_RC.dir/build.make libs/APM_RC/CMakeFiles/APM_RC.dir/build +.PHONY : APM_RC/fast + +#============================================================================= +# Target rules for targets named AP_Navigation + +# Build rule for target. +AP_Navigation: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_Navigation +.PHONY : AP_Navigation + +# fast build rule for target. +AP_Navigation/fast: + $(MAKE) -f libs/AP_Navigation/CMakeFiles/AP_Navigation.dir/build.make libs/AP_Navigation/CMakeFiles/AP_Navigation.dir/build +.PHONY : AP_Navigation/fast + +#============================================================================= +# Target rules for targets named APO + +# Build rule for target. +APO: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 APO +.PHONY : APO + +# fast build rule for target. +APO/fast: + $(MAKE) -f libs/APO/CMakeFiles/APO.dir/build.make libs/APO/CMakeFiles/APO.dir/build +.PHONY : APO/fast + +#============================================================================= +# Target rules for targets named AP_OpticalFlow + +# Build rule for target. +AP_OpticalFlow: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_OpticalFlow +.PHONY : AP_OpticalFlow + +# fast build rule for target. +AP_OpticalFlow/fast: + $(MAKE) -f libs/AP_OpticalFlow/CMakeFiles/AP_OpticalFlow.dir/build.make libs/AP_OpticalFlow/CMakeFiles/AP_OpticalFlow.dir/build +.PHONY : AP_OpticalFlow/fast + +#============================================================================= +# Target rules for targets named AP_PID + +# Build rule for target. +AP_PID: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_PID +.PHONY : AP_PID + +# fast build rule for target. +AP_PID/fast: + $(MAKE) -f libs/AP_PID/CMakeFiles/AP_PID.dir/build.make libs/AP_PID/CMakeFiles/AP_PID.dir/build +.PHONY : AP_PID/fast + +#============================================================================= +# Target rules for targets named AP_RangeFinder + +# Build rule for target. +AP_RangeFinder: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_RangeFinder +.PHONY : AP_RangeFinder + +# fast build rule for target. +AP_RangeFinder/fast: + $(MAKE) -f libs/AP_RangeFinder/CMakeFiles/AP_RangeFinder.dir/build.make libs/AP_RangeFinder/CMakeFiles/AP_RangeFinder.dir/build +.PHONY : AP_RangeFinder/fast + +#============================================================================= +# Target rules for targets named AP_RC + +# Build rule for target. +AP_RC: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_RC +.PHONY : AP_RC + +# fast build rule for target. +AP_RC/fast: + $(MAKE) -f libs/AP_RC/CMakeFiles/AP_RC.dir/build.make libs/AP_RC/CMakeFiles/AP_RC.dir/build +.PHONY : AP_RC/fast + +#============================================================================= +# Target rules for targets named AP_RC_Channel + +# Build rule for target. +AP_RC_Channel: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 AP_RC_Channel +.PHONY : AP_RC_Channel + +# fast build rule for target. +AP_RC_Channel/fast: + $(MAKE) -f libs/AP_RC_Channel/CMakeFiles/AP_RC_Channel.dir/build.make libs/AP_RC_Channel/CMakeFiles/AP_RC_Channel.dir/build +.PHONY : AP_RC_Channel/fast + +#============================================================================= +# Target rules for targets named DataFlash + +# Build rule for target. +DataFlash: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 DataFlash +.PHONY : DataFlash + +# fast build rule for target. +DataFlash/fast: + $(MAKE) -f libs/DataFlash/CMakeFiles/DataFlash.dir/build.make libs/DataFlash/CMakeFiles/DataFlash.dir/build +.PHONY : DataFlash/fast + +#============================================================================= +# Target rules for targets named mega_SPI + +# Build rule for target. +mega_SPI: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 mega_SPI +.PHONY : mega_SPI + +# fast build rule for target. +mega_SPI/fast: + $(MAKE) -f libs/DataFlash/CMakeFiles/mega_SPI.dir/build.make libs/DataFlash/CMakeFiles/mega_SPI.dir/build +.PHONY : mega_SPI/fast + +#============================================================================= +# Target rules for targets named FastSerial + +# Build rule for target. +FastSerial: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 FastSerial +.PHONY : FastSerial + +# fast build rule for target. +FastSerial/fast: + $(MAKE) -f libs/FastSerial/CMakeFiles/FastSerial.dir/build.make libs/FastSerial/CMakeFiles/FastSerial.dir/build +.PHONY : FastSerial/fast + +#============================================================================= +# Target rules for targets named GCS_MAVLink + +# Build rule for target. +GCS_MAVLink: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 GCS_MAVLink +.PHONY : GCS_MAVLink + +# fast build rule for target. +GCS_MAVLink/fast: + $(MAKE) -f libs/GCS_MAVLink/CMakeFiles/GCS_MAVLink.dir/build.make libs/GCS_MAVLink/CMakeFiles/GCS_MAVLink.dir/build +.PHONY : GCS_MAVLink/fast + +#============================================================================= +# Target rules for targets named GCS_SIMPLE + +# Build rule for target. +GCS_SIMPLE: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 GCS_SIMPLE +.PHONY : GCS_SIMPLE + +# fast build rule for target. +GCS_SIMPLE/fast: + $(MAKE) -f libs/GCS_SIMPLE/CMakeFiles/GCS_SIMPLE.dir/build.make libs/GCS_SIMPLE/CMakeFiles/GCS_SIMPLE.dir/build +.PHONY : GCS_SIMPLE/fast + +#============================================================================= +# Target rules for targets named GPS_IMU + +# Build rule for target. +GPS_IMU: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 GPS_IMU +.PHONY : GPS_IMU + +# fast build rule for target. +GPS_IMU/fast: + $(MAKE) -f libs/GPS_IMU/CMakeFiles/GPS_IMU.dir/build.make libs/GPS_IMU/CMakeFiles/GPS_IMU.dir/build +.PHONY : GPS_IMU/fast + +#============================================================================= +# Target rules for targets named GPS_MTK + +# Build rule for target. +GPS_MTK: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 GPS_MTK +.PHONY : GPS_MTK + +# fast build rule for target. +GPS_MTK/fast: + $(MAKE) -f libs/GPS_MTK/CMakeFiles/GPS_MTK.dir/build.make libs/GPS_MTK/CMakeFiles/GPS_MTK.dir/build +.PHONY : GPS_MTK/fast + +#============================================================================= +# Target rules for targets named GPS_NMEA + +# Build rule for target. +GPS_NMEA: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 GPS_NMEA +.PHONY : GPS_NMEA + +# fast build rule for target. +GPS_NMEA/fast: + $(MAKE) -f libs/GPS_NMEA/CMakeFiles/GPS_NMEA.dir/build.make libs/GPS_NMEA/CMakeFiles/GPS_NMEA.dir/build +.PHONY : GPS_NMEA/fast + +#============================================================================= +# Target rules for targets named GPS_UBLOX + +# Build rule for target. +GPS_UBLOX: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 GPS_UBLOX +.PHONY : GPS_UBLOX + +# fast build rule for target. +GPS_UBLOX/fast: + $(MAKE) -f libs/GPS_UBLOX/CMakeFiles/GPS_UBLOX.dir/build.make libs/GPS_UBLOX/CMakeFiles/GPS_UBLOX.dir/build +.PHONY : GPS_UBLOX/fast + +#============================================================================= +# Target rules for targets named memcheck + +# Build rule for target. +memcheck: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 memcheck +.PHONY : memcheck + +# fast build rule for target. +memcheck/fast: + $(MAKE) -f libs/memcheck/CMakeFiles/memcheck.dir/build.make libs/memcheck/CMakeFiles/memcheck.dir/build +.PHONY : memcheck/fast + +#============================================================================= +# Target rules for targets named ModeFilter + +# Build rule for target. +ModeFilter: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 ModeFilter +.PHONY : ModeFilter + +# fast build rule for target. +ModeFilter/fast: + $(MAKE) -f libs/ModeFilter/CMakeFiles/ModeFilter.dir/build.make libs/ModeFilter/CMakeFiles/ModeFilter.dir/build +.PHONY : ModeFilter/fast + +#============================================================================= +# Target rules for targets named PID + +# Build rule for target. +PID: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 PID +.PHONY : PID + +# fast build rule for target. +PID/fast: + $(MAKE) -f libs/PID/CMakeFiles/PID.dir/build.make libs/PID/CMakeFiles/PID.dir/build +.PHONY : PID/fast + +#============================================================================= +# Target rules for targets named RC_Channel + +# Build rule for target. +RC_Channel: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 RC_Channel +.PHONY : RC_Channel + +# fast build rule for target. +RC_Channel/fast: + $(MAKE) -f libs/RC_Channel/CMakeFiles/RC_Channel.dir/build.make libs/RC_Channel/CMakeFiles/RC_Channel.dir/build +.PHONY : RC_Channel/fast + +#============================================================================= +# Target rules for targets named Waypoints + +# Build rule for target. +Waypoints: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 Waypoints +.PHONY : Waypoints + +# fast build rule for target. +Waypoints/fast: + $(MAKE) -f libs/Waypoints/CMakeFiles/Waypoints.dir/build.make libs/Waypoints/CMakeFiles/Waypoints.dir/build +.PHONY : Waypoints/fast + +#============================================================================= +# Target rules for targets named Trig_LUT + +# Build rule for target. +Trig_LUT: cmake_check_build_system + $(MAKE) -f CMakeFiles/Makefile2 Trig_LUT +.PHONY : Trig_LUT + +# fast build rule for target. +Trig_LUT/fast: + $(MAKE) -f libs/Trig_LUT/CMakeFiles/Trig_LUT.dir/build.make libs/Trig_LUT/CMakeFiles/Trig_LUT.dir/build +.PHONY : Trig_LUT/fast + +apo.obj: apo.cpp.obj +.PHONY : apo.obj + +# target to build an object file +apo.cpp.obj: + $(MAKE) -f CMakeFiles/apo.dir/build.make CMakeFiles/apo.dir/apo.cpp.obj +.PHONY : apo.cpp.obj + +apo.i: apo.cpp.i +.PHONY : apo.i + +# target to preprocess a source file +apo.cpp.i: + $(MAKE) -f CMakeFiles/apo.dir/build.make CMakeFiles/apo.dir/apo.cpp.i +.PHONY : apo.cpp.i + +apo.s: apo.cpp.s +.PHONY : apo.s + +# target to generate assembly for a file +apo.cpp.s: + $(MAKE) -f CMakeFiles/apo.dir/build.make CMakeFiles/apo.dir/apo.cpp.s +.PHONY : apo.cpp.s + +# Help Target +help: + @echo "The following are some of the valid targets for this Makefile:" + @echo "... all (the default if no target is provided)" + @echo "... clean" + @echo "... depend" + @echo "... apo" + @echo "... apo-serial" + @echo "... apo-upload" + @echo "... edit_cache" + @echo "... install" + @echo "... install/local" + @echo "... install/strip" + @echo "... list_install_components" + @echo "... package" + @echo "... package_source" + @echo "... rebuild_cache" + @echo "... upload" + @echo "... AP_ADC" + @echo "... mega_CORE" + @echo "... AP_Common" + @echo "... AP_Compass" + @echo "... AP_DCM" + @echo "... AP_EEPROMB" + @echo "... AP_GPS" + @echo "... AP_IMU" + @echo "... AP_Math" + @echo "... APM_BMP085" + @echo "... mega_Wire" + @echo "... APM_PerfMon" + @echo "... APM_PI" + @echo "... APM_RC" + @echo "... AP_Navigation" + @echo "... APO" + @echo "... AP_OpticalFlow" + @echo "... AP_PID" + @echo "... AP_RangeFinder" + @echo "... AP_RC" + @echo "... AP_RC_Channel" + @echo "... DataFlash" + @echo "... mega_SPI" + @echo "... FastSerial" + @echo "... GCS_MAVLink" + @echo "... GCS_SIMPLE" + @echo "... GPS_IMU" + @echo "... GPS_MTK" + @echo "... GPS_NMEA" + @echo "... GPS_UBLOX" + @echo "... memcheck" + @echo "... ModeFilter" + @echo "... PID" + @echo "... RC_Channel" + @echo "... Waypoints" + @echo "... Trig_LUT" + @echo "... apo.obj" + @echo "... apo.i" + @echo "... apo.s" +.PHONY : help + + + +#============================================================================= +# Special targets to cleanup operation of make. + +# Special rule to run CMake to check the build system integrity. +# No rule that depends on this can have commands that come from listfiles +# because they might be regenerated. +cmake_check_build_system: + $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system + diff --git a/apo/apo.pde b/apo/apo.pde index dd67215691..d960de6681 100644 --- a/apo/apo.pde +++ b/apo/apo.pde @@ -1,4 +1,5 @@ // Libraries +#include #include #include #include @@ -19,4 +20,9 @@ #include "PlaneEasystar.h" // ArduPilotOne Default Setup -#include "APO_DefaultSetup.h" +//#include "APO_DefaultSetup.h" +void setup() { +}; + +void loop() { +}; diff --git a/cmake/modules/FindArduino.cmake b/cmake/modules/FindArduino.cmake index a8cc4ae63e..1d57edbf26 100644 --- a/cmake/modules/FindArduino.cmake +++ b/cmake/modules/FindArduino.cmake @@ -188,31 +188,23 @@ function(GENERATE_ARDUINO_FIRMWARE TARGET_NAME) endif() message(STATUS "Generating ${TARGET_NAME}") - message(STATUS "Sketches ${INPUT_SKETCHES}") - + set(ALL_LIBS) - set(ALL_SRCS ${INPUT_SKETCHES} ${INPUT_SRCS} ${INPUT_HDRS} ) - #set(ALL_SRCS ${INPUT_SRCS} ${INPUT_HDRS} ) - - #set compile flags and file properties for pde files - #SET_SOURCE_FILES_PROPERTIES(${INPUT_SKETCHES} PROPERTIES LANGUAGE CXX) - #SET_SOURCE_FILES_PROPERTIES(${INPUT_SKETCHES} PROPERTIES COMPILE_FLAGS "-x c++" ) - - setup_arduino_compiler(${INPUT_BOARD}) + set(ALL_SRCS ${INPUT_SRCS} ${INPUT_HDRS}) + + setup_arduino_compiler(${INPUT_BOARD}) setup_arduino_core(CORE_LIB ${INPUT_BOARD}) #setup_arduino_sketch(SKETCH_SRCS ${INPUT_SKETCHES}) if(INPUT_AUTOLIBS) - setup_arduino_libraries(ALL_LIBS ${INPUT_BOARD} "${ALL_SRCS}") + setup_arduino_libraries(ALL_LIBS ${INPUT_BOARD} "${ALL_SRCS}") endif() list(APPEND ALL_LIBS ${CORE_LIB} ${INPUT_LIBS}) - + setup_arduino_target(${TARGET_NAME} "${ALL_SRCS}" "${ALL_LIBS}") - #SET_TARGET_PROPERTIES(${TARGET_NAME} PROPERTIES LINKER_LANGUAGE CXX) - #setup_arduino_target(${TARGET_NAME} "${INPUT_SKETCHES}" ${INPUT_HDRS} "${ALL_LIBS}") if(INPUT_PORT) setup_arduino_upload(${INPUT_BOARD} ${TARGET_NAME} ${INPUT_PORT}) @@ -322,8 +314,11 @@ function(find_arduino_libraries VAR_NAME SRCS) foreach(SRC_LINE ${SRC_CONTENTS}) if("${SRC_LINE}" MATCHES "^ *#include *[<\"](.*)[>\"]") get_filename_component(INCLUDE_NAME ${CMAKE_MATCH_1} NAME_WE) - foreach(LIB_SEARCH_PATH ${ARDUINO_LIBRARIES_PATH} ${CMAKE_CURRENT_SOURCE_DIR}) - if(EXISTS ${LIB_SEARCH_PATH}/${INCLUDE_NAME}/${CMAKE_MATCH_1}) + get_property(LIBRARY_SEARCH_PATH + DIRECTORY # Property Scope + PROPERTY LINK_DIRECTORIES) + foreach(LIB_SEARCH_PATH ${LIBRARY_SEARCH_PATH} ${ARDUINO_LIBRARIES_PATH} ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/libraries) + if(EXISTS ${LIB_SEARCH_PATH}/${INCLUDE_NAME}/${CMAKE_MATCH_1}) list(APPEND ARDUINO_LIBS ${LIB_SEARCH_PATH}/${INCLUDE_NAME}) break() endif() diff --git a/cmake/toolchains/Arduino.cmake b/cmake/toolchains/Arduino.cmake index 616c7b9160..68c58a72e9 100644 --- a/cmake/toolchains/Arduino.cmake +++ b/cmake/toolchains/Arduino.cmake @@ -6,27 +6,33 @@ set(CMAKE_CXX_COMPILER avr-g++) #=============================================================================# # C Flags # #=============================================================================# -set(ARDUINO_C_FLAGS "-ffunction-sections -fdata-sections") +if (NOT DEFINED ARDUINO_C_FLAGS) + set(ARDUINO_C_FLAGS "-ffunction-sections -fdata-sections") +endif() set(CMAKE_C_FLAGS "-g -Os ${ARDUINO_C_FLAGS}" CACHE STRING "") set(CMAKE_C_FLAGS_DEBUG "-g ${ARDUINO_C_FLAGS}" CACHE STRING "") set(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG ${ARDUINO_C_FLAGS}" CACHE STRING "") -set(CMAKE_C_FLAGS_RELEASE "-Os -DNDEBUG -w ${ARDUINO_C_FLAGS}" CACHE STRING "") -set(CMAKE_C_FLAGS_RELWITHDEBINFO "-Os -g -w ${ARDUINO_C_FLAGS}" CACHE STRING "") +set(CMAKE_C_FLAGS_RELEASE "-0s -DNDEBUG -w ${ARDUINO_C_FLAGS}" CACHE STRING "") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "-0s -g -w ${ARDUINO_C_FLAGS}" CACHE STRING "") #=============================================================================# # C++ Flags # #=============================================================================# -set(ARDUINO_CXX_FLAGS "${ARDUINO_C_FLAGS} -fno-exceptions") +if (NOT DEFINED ARDUINO_CXX_FLAGS) + set(ARDUINO_CXX_FLAGS "${ARDUINO_C_FLAGS} -fno-exceptions") +endif() set(CMAKE_CXX_FLAGS "-g -Os ${ARDUINO_CXX_FLAGS}" CACHE STRING "") -set(CMAKE_CXX_FLAGS_DEBUG "-g -Os ${ARDUINO_CXX_FLAGS}" CACHE STRING "") +set(CMAKE_CXX_FLAGS_DEBUG "-g ${ARDUINO_CXX_FLAGS}" CACHE STRING "") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG ${ARDUINO_CXX_FLAGS}" CACHE STRING "") -set(CMAKE_CXX_FLAGS_RELEASE "-Os -DNDEBUG ${ARDUINO_CXX_FLAGS}" CACHE STRING "") -set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-Os -g ${ARDUINO_CXX_FLAGS}" CACHE STRING "") +set(CMAKE_CXX_FLAGS_RELEASE "-0s -DNDEBUG ${ARDUINO_CXX_FLAGS}" CACHE STRING "") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-0s -g ${ARDUINO_CXX_FLAGS}" CACHE STRING "") #=============================================================================# # Executable Linker Flags # #=============================================================================# -set(ARDUINO_LINKER_FLAGS "-Wl,--gc-sections -lc -lm") +if (NOT DEFINED ARDUINO_LINKER_FLAGS) + set(ARDUINO_LINKER_FLAGS "-Wl,--gc-sections") +endif() set(CMAKE_EXE_LINKER_FLAGS "${ARDUINO_LINKER_FLAGS}" CACHE STRING "") set(CMAKE_EXE_LINKER_FLAGS_DEBUG "${ARDUINO_LINKER_FLAGS}" CACHE STRING "") set(CMAKE_EXE_LINKER_FLAGS_MINSIZEREL "${ARDUINO_LINKER_FLAGS}" CACHE STRING "") diff --git a/libraries/APO/APO_DefaultSetup.h b/libraries/APO/APO_DefaultSetup.h index a270081d94..5e13201ca7 100644 --- a/libraries/APO/APO_DefaultSetup.h +++ b/libraries/APO/APO_DefaultSetup.h @@ -158,4 +158,4 @@ void loop() { autoPilot->update(); } -#endif _APO_COMMON_H +#endif //_APO_COMMON_H