From b33d093a7ae6c2d5bc570534859335253d6cb353 Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Sun, 15 May 2011 14:54:24 +0300 Subject: [PATCH] OP-483: update Windows build system, provide install replacement Since msysGit lacks the install command, simple cp -f replacement is provided. Don't forget to copy it into the msysGit bin subdirectory. Introduced CLEAN_BUILD=NO make option to test packaging w/o cleaning. Recommended for test builds only, not for production run. make -j works great after PyMite dependency fix by commit 0005729056e0980a859a990455f4823960851449 So comment is updated as well. --- make/winx86/README.txt | 7 ++++--- make/winx86/bin/install | 15 +++++++++++++++ make/winx86/bin/make | 4 +++- make/winx86/cmd/make.sh | 8 ++++++++ make/winx86/cmd/sh.cmd | 3 ++- release/Makefile | 12 ++++++------ 6 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 make/winx86/bin/install diff --git a/make/winx86/README.txt b/make/winx86/README.txt index 6024dd118..fb383fa17 100644 --- a/make/winx86/README.txt +++ b/make/winx86/README.txt @@ -37,17 +37,18 @@ locations (but any other locations are fine as well): - QtSDK in C:\Qt\2010.05 - msysGit in %ProgramFiles%\Git - Unicode NSIS in %ProgramFiles%\NSIS\Unicode + - OpenOCD in C:\OpenOCD\0.4.0\bin Also it is assumed that you have the C:\Program Files\Git\cmd\ directory in the PATH. Usually this is the case for msysGit installation if you have chosen the 2nd option: put only git and gitk in the PATH (it is recommended option). -Now you need to copy two files to your msysGit installation folders. +Now you need to copy few files to your msysGit installation folders. Assuming that you installed the msysGit into C:\Program Files\Git\, you have to copy: - make\winx86\bin\make -> C:\Program Files\Git\bin\ - make\winx86\cmd\sh.cmd -> C:\Program Files\Git\cmd\ + make\winx86\bin\* -> C:\Program Files\Git\bin\ + make\winx86\cmd\* -> C:\Program Files\Git\cmd\ If you have msysGit installed into another directory, you need to update paths accordingly. Also if you have tools installed into different directories and diff --git a/make/winx86/bin/install b/make/winx86/bin/install new file mode 100644 index 000000000..fae28bf23 --- /dev/null +++ b/make/winx86/bin/install @@ -0,0 +1,15 @@ +#!/bin/sh +# +# simple install command replacement for Windows +# +# This file should be put into C:\Program Files\Git\bin\ subdirectory +# (or similar, depeding on where the msysGit package was installed) +# to provide a make command to unix-like build environment on Windows. +# +# See also: +# README.txt +# http://wiki.openpilot.org/display/Doc/GCS+Development+on+Windows +# http://wiki.openpilot.org/display/Doc/Firmware+Development+on+Windows +# + +cp -f $* diff --git a/make/winx86/bin/make b/make/winx86/bin/make index 4d475bff6..d4bf11224 100644 --- a/make/winx86/bin/make +++ b/make/winx86/bin/make @@ -1,6 +1,8 @@ #!/bin/sh # -# This file is to be put into C:\Program Files\Git\bin\ subdirectory +# make command replacement for Windows +# +# This file should be put into C:\Program Files\Git\bin\ subdirectory # (or similar, depeding on where the msysGit package was installed) # to provide a make command to unix-like build environment on Windows. # diff --git a/make/winx86/cmd/make.sh b/make/winx86/cmd/make.sh index 70ff64114..a2ae771d5 100644 --- a/make/winx86/cmd/make.sh +++ b/make/winx86/cmd/make.sh @@ -1 +1,9 @@ +# +# make command replacement to run from command prompt under bash +# +# This file should be put into C:\Program Files\Git\cmd\ subdirectory +# (or similar, depeding on where the msysGit package was installed) +# to provide a shell prompt in the unix-like build environment on Windows. +# + exec /bin/make $* diff --git a/make/winx86/cmd/sh.cmd b/make/winx86/cmd/sh.cmd index b3b276fb2..d82c7ec99 100644 --- a/make/winx86/cmd/sh.cmd +++ b/make/winx86/cmd/sh.cmd @@ -1,6 +1,6 @@ @echo off rem -rem This file is to be put into C:\Program Files\Git\cmd\ subdirectory +rem This file should be put into C:\Program Files\Git\cmd\ subdirectory rem (or similar, depeding on where the msysGit package was installed) rem to provide a shell prompt in the unix-like build environment on Windows. rem @@ -56,6 +56,7 @@ call :which QTSDK "C:\Qt\2010.05\qt\bin" qmake.exe call :which CODESOURCERY "C:\CodeSourcery\bin" cs-make.exe call :which PYTHON "C:\Python27" python.exe call :which UNSIS "%ProgramFiles%\NSIS\Unicode" makensis.exe +call :which OPENOCDBIN "C:\OpenOCD\0.4.0\bin" openocd.exe if "%NOT_FOUND%" == "" goto set_path diff --git a/release/Makefile b/release/Makefile index a1a45de3b..bf9817b25 100644 --- a/release/Makefile +++ b/release/Makefile @@ -4,12 +4,8 @@ # Tried the best to support parallel (-j) builds. But since this Makefile # uses other Makefiles to build few targets which in turn have similar # dependencies on uavobjects and other generated files, it is difficult -# to support parallel builds perfectly. -# -# Looks like it works for -j8, but fails for -j (unlimited jobs). -# So probably not a bad idea is to build release in single thread. -# -#.NOTPARALLEL: +# to support parallel builds perfectly. But at least it was tested with +# -j (unlimited job number) on Windows and Linux. # Locate the root of the tree WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST))) @@ -41,9 +37,11 @@ help: @echo @echo " [Release build and packaging]" @echo " release - Build and package the OpenPilot release" + @echo " release_flight - Build and package the OpenPilot flight firmware" @echo @echo " Notes:" @echo " - the build directory will be removed first on every run" + @echo " unless CLEAN_BUILD=NO is defined (recommended for testing only)" @echo " - release packages will be placed in $(RELEASE_DIR)" @echo @@ -52,7 +50,9 @@ uavobjects: all_clean $(V1) $(MAKE) -C $(ROOT_DIR) $@ all_clean: +ifneq ($(CLEAN_BUILD), NO) $(V1) $(MAKE) -C $(ROOT_DIR) $@ +endif # Install template: # $1 = target