Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alberto Ruiz Garcia
Firmware
Commits
2c33f492
Commit
2c33f492
authored
9 years ago
by
James Goppert
Browse files
Options
Downloads
Patches
Plain Diff
Add makefile magic to simplify maintenance.
parent
2238c09b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
Makefile
+80
-50
80 additions, 50 deletions
Makefile
cmake/nuttx/px4_impl_nuttx.cmake
+1
-1
1 addition, 1 deletion
cmake/nuttx/px4_impl_nuttx.cmake
with
82 additions
and
52 deletions
CMakeLists.txt
+
1
−
1
View file @
2c33f492
...
...
@@ -240,7 +240,7 @@ foreach(module ${config_modules})
add_subdirectory
(
src/
${
module
}
)
px4_mangle_name
(
${
module
}
mangled_name
)
list
(
APPEND module_libraries
${
mangled_name
}
)
message
(
STATUS
"adding module:
${
module
}
"
)
#
message(STATUS "adding module: ${module}")
endforeach
()
add_subdirectory
(
src/firmware/
${
OS
}
)
...
...
This diff is collapsed.
Click to expand it.
Makefile
+
80
−
50
View file @
2c33f492
d
=
$(
PWD
)
all
:
nuttx_px4fmu-v2_default
############################################################################
#
# Copyright (c) 2015 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# 3. Neither the name PX4 nor the names of its contributors may be
# used to endorse or promote products derived from this software
# without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.
#
############################################################################
#----------------------------------------------------------------------------
# OS: nuttx BOARD: px4fmu-v2 LABEL: simple
# Help
# --------------------------------------------------------------------
# Don't be afraid of this makefile, it is just passing
# arguments to cmake to allow us to keep the wiki pages etc.
# that describe how to build the px4 firmware
# the same even when using cmake instead of make.
#
# Example usage:
#
nuttx_px4fmu-v2_simple
:
mkdir
-p
$d
/build_
$@
&&
cd
$d
/build_
$@
&&
\
cmake ..
-DCMAKE_TOOLCHAIN_FILE
=
../cmake/toolchains/Toolchain-arm-none-eabi.cmake
\
-DOS
=
nuttx
-DBOARD
=
px4fmu-v2
-DLABEL
=
simple
&&
\
make
-s
&&
ctest
-V
&&
cpack
-G
ZIP
nuttx_px4fmu-v2_simple_upload
:
nuttx_px4fmu-v2_simple
make
-C
build_
$<
upload
nuttx_px4fmu-v2_simple_test
:
nuttx_px4fmu-v2_simple
make
-C
build_
$<
test
# make px4fmu-v2_default (builds)
# make px4fmu-v2_default upload (builds and uploads)
# make px4fmu-v2_default test (builds and tests)
#
# This tells cmake to build the nuttx px4fmu-v2 default config in the
# directory build_nuttx_px4fmu-v2_default and then call make
# in that directory with the target upload.
# Parsing
# --------------------------------------------------------------------
# assume 1st argument passed is the main target, the
# rest are arguments to pass to the makefile generated
# by cmake in the subdirectory
ARGS
:=
$(
wordlist 2,
$(
words
$(
MAKECMDGOALS
))
,
$(
MAKECMDGOALS
))
#----------------------------------------------------------------------------
# OS: nuttx BOARD: px4fmu-v2 LABEL: default
#
nuttx_px4fmu-v2_default
:
mkdir
-p
$d
/build_
$@
&&
cd
$d
/build_
$@
&&
\
cmake ..
-DCMAKE_TOOLCHAIN_FILE
=
../cmake/toolchains/Toolchain-arm-none-eabi.cmake
\
-DOS
=
nuttx
-DBOARD
=
px4fmu-v2
-DLABEL
=
default
&&
\
make
-s
&&
ctest
-V
&&
cpack
-G
ZIP
nuttx_px4fmu-v2_default_upload
:
nuttx_px4fmu-v2_default
make
-C
build_
$<
upload
nuttx_px4fmu-v2_default_test
:
nuttx_px4fmu-v2_default
make
-C
build_
$<
test
# Functions
# --------------------------------------------------------------------
# define a make function to describe how to build a cmake config
define
cmake-build
mkdir
-p
$(PWD)/build_$@
&&
cd
$(PWD)/build_$@
&&
\
cmake
..
-DCMAKE_TOOLCHAIN_FILE
=
../cmake/toolchains/
$(
1
)
.cmake
\
-DOS
=
$(
2
)
-DBOARD
=
$(
3
)
-DLABEL
=
$(
4
)
&&
\
make
-s
$(
ARGS
)
endef
# ADD CONFIGS HERE
# --------------------------------------------------------------------
px4fmu-v2_default
:
$(
call cmake-build,Toolchain-arm-none-eabi,nuttx,px4fmu-v2,default
)
px4fmu-v2_simple
:
$(
call cmake-build,Toolchain-arm-none-eabi,nuttx,px4fmu-v2,default
)
#----------------------------------------------------------------------------
# OS: nuttx BOARD: sim LABEL: simple
#
nuttx_sim_simple
:
mkdir
-p
$d
/build_
$@
&&
cd
$d
/build_
$@
&&
\
cmake ..
-DCMAKE_TOOLCHAIN_FILE
=
../cmake/toolchains/Toolchain-native.cmake
\
-DOS
=
nuttx
-DBOARD
=
sim
-DLABEL
=
simple
&&
\
make
-s
&&
ctest
-V
&&
cpack
-G
ZIP
$(
call cmake-build,Toolchain-native,nuttx,sim,default
)
#----------------------------------------------------------------------------
# OS: posix BOARD: sitl LABEL: simple
#
posix_sitl_simple
:
mkdir
-p
$d
/build_
$@
&&
cd
$d
/build_
$@
&&
\
cmake ..
-DCMAKE_TOOLCHAIN_FILE
=
../cmake/toolchains/Toolchain-posix-clang-native.cmake
\
-DOS
=
posix
-DBOARD
=
sitl
-DLABEL
=
simple
&&
\
make
-s
&&
ctest
-V
&&
cpack
-G
ZIP
$(
call cmake-build,Toolchain-posix-clang-native,posix,sitl,simple
)
#----------------------------------------------------------------------------
# OS: qurt BOARD: hil LABEL: simple
#
qurt_eagle_travis
:
mkdir
-p
$d
/build_
$@
&&
cd
$d
/build_
$@
&&
\
cmake ..
-DCMAKE_TOOLCHAIN_FILE
=
../cmake/toolchains/Toolchain-hexagon.cmake
\
-DOS
=
qurt
-DBOARD
=
eagle
-DLABEL
=
travis
&&
\
make
-s
&&
ctest
-V
&&
cpack
-G
ZIP
$(
call cmake-build,Toolchain-hexagon,qurt,eagle,travis
)
# Other targets
# --------------------------------------------------------------------
# explicity set default build target
all
:
px4fmu-v2_default
#----------------------------------------------------------------------------
# misc targets
#
clean
:
rm
-rf
build_
*
/
...
...
This diff is collapsed.
Click to expand it.
cmake/nuttx/px4_impl_nuttx.cmake
+
1
−
1
View file @
2c33f492
...
...
@@ -148,7 +148,7 @@ function(px4_nuttx_generate_builtin_commands)
set
(
builtin_apps_decl_string
)
set
(
command_count 0
)
foreach
(
module
${
MODULE_LIST
}
)
message
(
"generating builtin for:
${
module
}
"
)
#
message("generating builtin for: ${module}")
# default
set
(
MAIN_DEFAULT MAIN-NOTFOUND
)
set
(
STACK_DEFAULT 1024
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment