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
6eb4d015
Commit
6eb4d015
authored
9 years ago
by
Lorenz Meier
Browse files
Options
Downloads
Patches
Plain Diff
Bring back user-friendly Makefile for non-Ubuntu users
parent
7c3de9bc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Makefile
+80
-12
80 additions, 12 deletions
Makefile
with
80 additions
and
12 deletions
Makefile
+
80
−
12
View file @
6eb4d015
...
...
@@ -31,18 +31,86 @@
#
############################################################################
CONFIGS
:=
$(
shell
ls
cmake/configs |
sed
-e
"s~.*/~~"
|
sed
-e
"s~
\.
.*~~"
)
# 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:
#
# 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
))
# Functions
# --------------------------------------------------------------------
# define a make function to describe how to build a cmake config
define
cmake-build
mkdir
-p
$(PWD)/build_$@
&&
cd
$(PWD)/build_$@
&&
cmake
..
-DCONFIG
=
$(
1
)
make
-C
$(PWD)/build_$@
-s
$(ARGS)
endef
# ADD CONFIGS HERE
# --------------------------------------------------------------------
# Do not put any spaces between function arguments.
px4fmu-v2_default
:
$(
call cmake-build,nuttx_px4fmu-v2_default
)
px4fmu-v2_simple
:
$(
call cmake-build,nuttx_px4fmu-v2_simple
)
$(CONFIGS)
:
@
mkdir
-p
Build/
$@
@
cd
Build/
$@
&&
cmake ../..
-DCONFIG
=
$@
@
cd
Build/
$@
&&
make
nuttx_sim_simple
:
$(
call cmake-build,
$@
)
clean-all
:
@
rm
-rf
Build/
*
posix_sitl_simple
:
$(
call cmake-build,
$@
)
help
:
@
echo
@
echo
"Type 'make ' and hit the tab key twice to see a list of the available"
@
echo
"build configurations."
@
echo
qurt_eagle_travis
:
$(
call cmake-build,
$@
)
# Other targets
# --------------------------------------------------------------------
# explicity set default build target
all
:
px4fmu-v2_default
clean
:
rm
-rf
build_
*
/
# targets handled by cmake
test
:
;
upload
:
;
package
:
;
package_source
:
;
.PHONY
:
clean test upload package package_source
CONFIGS
:=
$(
shell
ls
cmake/configs |
sed
-e
"s~.*/~~"
|
sed
-e
"s~
\.
.*~~"
)
# Future:
#$(CONFIGS):
## @cd Build/$@ && cmake ../.. -DCONFIG=$@
# @cd Build/$@ && make
#
#clean-all:
# @rm -rf Build/*
#
#help:
# @echo
# @echo "Type 'make ' and hit the tab key twice to see a list of the available"
# @echo "build configurations."
# @echo
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