From 61e5de4e8d264c9cf758556c28f8dd945f7f7a51 Mon Sep 17 00:00:00 2001 From: Philippe Renon Date: Wed, 18 Oct 2017 23:41:50 +0200 Subject: [PATCH] remove obsolete winx86 scripts and utilities --- make/winx86/README.txt | 200 ----------------------------------- make/winx86/bin/install | 15 --- make/winx86/bin/make | 15 --- make/winx86/cmd/make.sh | 9 -- make/winx86/cmd/sh.cmd | 135 ----------------------- make/winx86/shell_script.reg | 19 ---- 6 files changed, 393 deletions(-) delete mode 100644 make/winx86/README.txt delete mode 100644 make/winx86/bin/install delete mode 100644 make/winx86/bin/make delete mode 100644 make/winx86/cmd/make.sh delete mode 100644 make/winx86/cmd/sh.cmd delete mode 100644 make/winx86/shell_script.reg diff --git a/make/winx86/README.txt b/make/winx86/README.txt deleted file mode 100644 index d9a10d10a..000000000 --- a/make/winx86/README.txt +++ /dev/null @@ -1,200 +0,0 @@ -This set of scripts is to provide a unix-like build environment on Windows. ---------------------------------------------------------------------------- - -1. Why do I need it? -2. How to install? -3. How to use it? -3.1. Interactive mode -3.2. Batch mode -4. Advanced usage -5. Limitations of use -6. Credits and license - - -1. Why do I need it? --------------------- -It allows to use the "Big Hammer", that is, to build whole OpenPilot system -with a single command "make all" using the top level Makefile originally -written for Linux and Mac only. - -Also any routine task automation could use the same set of scripts and commands -on all platforms (Linux, Mac and Windows) if scripts are written in the shell -language. It is particularly important for cross-paltform projects like the -OpenPilot. - - -2. How to install? ------------------- -Fortunately, it requires only few small text files since all others components -should already be installed on your system as parts of msysGit, QtSDK and -Arm compiler packages required to build the OpenPilot. - -It is expected that you have the following tools installed into the listed -locations (but any other locations are fine as well): - - - Python in C:\Python27 - - QtSDK in C:\QtSDK (depending on SDK version) - - CodeSourcery G++ in %ProgramFiles%\CodeSourcery\Sourcery G++ Lite - - msysGit in %ProgramFiles%\Git - - Unicode NSIS in %ProgramFiles%\NSIS\Unicode - - OpenOCD in C:\OpenOCD\0.4.0\bin (optional) - -The SDL and SSL libraries and headers should be installed into Qt directories to -build the GCS. Check the wiki or ground/gcs/copydata.pro for details. - -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 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\* -> 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 -they are not in the PATH, then you may want to update paths in the sh.cmd -script too (it is self-documented). - -Note for Windows 64-bit users: 64-bit systems use %ProgramFiles(x86)% folder -as default for program files instead of %ProgramFiles%. You have to check where -your tools are installed and update paths above accordingly. - - -3. How to use it? ------------------ - -3.1. Interactive mode ---------------------- - -1) Type: - - C:\> sh - -and the bash prompt should appear: - - user@pc / - $ - -2) Enter your OpenPilot directory: - - user@pc / - $ cd D:/Work/OpenPilot/git - - user@pc /d/Work/OpenPilot/git (master) - $ - -Note the current git branch in parentheses (master), if it exists. The path -format is also printed according to MSYS notation. And you have to use forward -slashes in paths, not backslashes. - -3) Enter make command with required options and target list: - - user@pc /d/Work/OpenPilot/git (master) - $ make all - -The building should be started, and you will have full system including ground -software and flight firmware built in the end. - -4) To build parts of the system you can use, for example, such commands: - - user@pc /d/Work/OpenPilot/git (master) - $ make -j2 GCS_BUILD_CONF=release gcs coptercontrol - -or to completely remove the build directory: - - user@pc /d/Work/OpenPilot/git (master) - $ make all_clean - - -3.2. Batch mode ---------------- - -1) Create a shell script file containing all required commands, for instance: - - #!/bin/sh - # This is the cc_make_release.sh file used to build CC release software - cd D:/Work/OpenPilot/git - make -j2 GCS_BUILD_CONF=release gcs coptercontrol - echo RC=$? - -2) Run it typing: - - C:\> sh cc_make_release.sh - -3) Of course, a lot of other shell commands can be used in scripts. - - -4. Advanced usage ------------------ - -It is possible to go further and integrate shell scripting into Windows system -like any other executables. This allows: - - - double click on any .sh file in the Explorer window to execute it; - - type name of .sh file with any arguments on the command line to run script; - - omit .sh extension typing names since it is now recognized automatically; - - call .sh scripts even from .bat and .cmd files as Windows command; - - execute scripts which are in any directory in the PATH; - - return and check exit code from .sh scripts to .bat or .cmd batch files. - -In short, you may have quite powerful and cross-platform bash scripting on -Windows. - -In order to integrate bash scripting into Windows system you need to: - - - double click on the included shell_script.reg file to register .sh - extension in the system. Thus, any click on .sh script will execute it - automatically assuming that the sh.cmd is in the PATH; - - register .sh extension as an executable file type, so you can omit the - .sh typing commands. To do so open "My Computer" properties dialog, choose - the "Advanced" tab, "Environment variables", in the "System variables" - find the variable called "PATHEXT". It contains the list of "executable" - file extensions separated by semicolon. You want to add a ";.SH" to the - end of its value. Then click OK to apply. - -Now any .sh script can be run just by typing its name, optionally with -parameters. - -As an example, you can create a shell script named make.sh in the cmd/ -subdirectory of Git installation with the following content: - - exec /bin/make $* - -and then build the OpenPilot software typing - - make all - -directly from Windows command line or from a batch file. - -You also may want to rename or remove "C:\Program Files\Git\etc\motd" file -to get rid of git bash welcome message on every script invocation. - - -5. Limitations of use ---------------------- - -Currently there may be some problems running scripts which contain spaces in -file names or located in directories which contain spaces in full paths. -It results in strange "file not found" or other errors. - -It is recommended to avoid using such names with spaces. - - -6. Credits and license ----------------------- - -This set of scripts uses the MSYS package included into the msysGit -distribution and MinGW make included into the QtSDK package. - -The sh.cmd, shell_script.reg and this README.txt files were written -by Oleg Semyonov (os@openpilot.org) for the OpenPilot project and -are licensed under CC-BY-SA terms: - - http://creativecommons.org/licenses/by-sa/3.0/ - -Feel free to contact me for additions and improvements. - -Happy bashing! diff --git a/make/winx86/bin/install b/make/winx86/bin/install deleted file mode 100644 index fae28bf23..000000000 --- a/make/winx86/bin/install +++ /dev/null @@ -1,15 +0,0 @@ -#!/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 deleted file mode 100644 index d4bf11224..000000000 --- a/make/winx86/bin/make +++ /dev/null @@ -1,15 +0,0 @@ -#!/bin/sh -# -# 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. -# -# See also: -# README.txt -# http://wiki.openpilot.org/display/Doc/GCS+Development+on+Windows -# http://wiki.openpilot.org/display/Doc/Firmware+Development+on+Windows -# - -mingw32-make.exe $* diff --git a/make/winx86/cmd/make.sh b/make/winx86/cmd/make.sh deleted file mode 100644 index bcea06681..000000000 --- a/make/winx86/cmd/make.sh +++ /dev/null @@ -1,9 +0,0 @@ -# -# 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 deleted file mode 100644 index 7c2259150..000000000 --- a/make/winx86/cmd/sh.cmd +++ /dev/null @@ -1,135 +0,0 @@ -@echo off -rem -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 -rem Currently supported on NT-class systems only (Windows XP and above). -rem -rem See also: -rem README.txt -rem http://wiki.openpilot.org/display/Doc/GCS+Development+on+Windows -rem http://wiki.openpilot.org/display/Doc/Firmware+Development+on+Windows -rem -rem Based on the msys.bat file from the MSYS package -rem http://www.mingw.org/wiki/msys -rem - -rem Shared directories for toolchains -rem set DL_DIR=C:/LibrePilot/downloads -rem set TOOLS_DIR=C:/LibrePilot/tools - -rem this should let run MSYS shell on x64 -if "%PROCESSOR_ARCHITECTURE%" == "AMD64" ( - SET COMSPEC=%WINDIR%\SysWOW64\cmd.exe -) - -rem some MSYS environment variables -if "x%MSYSTEM%" == "x" set MSYSTEM=MINGW32 -if not "x%DISPLAY%" == "x" set DISPLAY= - -rem -------------------------------------------------------------------------- -rem To build the OpenPilot software we need few tools in the PATH. -rem Here we attempt to guess tools location searching in the given -rem directories first, and in the PATH last, if not found where expected. -rem -rem Please note that if you have few similar tools installed somewhere but -rem not in the expected location, and they are in the PATH, then the script -rem can detect wrong directories. For instance, if you have QtSDK installed -rem on the D: drive, but have separately installed MinGW toolkit which is -rem in the PATH, then this script detects this MinGW instead of QtSDK's one. -rem As a result, the SDL headers will not be found, if they were copied into -rem QtSDK's MinGW directory. In that case make sure that you have correct -rem directories specified here. -rem -rem Also the SDL should be installed into Qt directories to build the GCS. -rem Check the wiki or ground/gcs/copydata.pro for details. -rem -rem Also you can add any paths below just by adding extra 'call :which' -rem lines with the following parameters: -rem - environment variable which will be set to the tool location, if found; -rem - expected directory for the executable which will be searched first; -rem - any executable file which will be searched in the given directory -rem or in the PATH, if not found where expected. -rem All they will be added to the PATH in order of appearance. -rem -------------------------------------------------------------------------- - -set NOT_FOUND= -set PATH_DIRS= - -rem Replace %ProgramFiles% by %ProgramFiles(x86)% for 64bit system -call :which MSYSGIT "%ProgramFiles%\Git\bin" git.exe -call :which QTMINGW "C:\QtSDK\mingw\bin" mingw32-make.exe -call :which QTSDK "C:\QtSDK\Desktop\Qt\4.8.1\mingw\bin" qmake.exe -call :which ARMGCC "C:\OpenPilot\gcc-arm-none-eabi-4_6-2012q4\bin" arm-none-eabi-gcc.exe -call :which PYTHON "C:\Python27" python.exe -call :which UNSIS "%ProgramFiles%\NSIS\Unicode" makensis.exe - -if "%NOT_FOUND%" == "" goto set_path - -echo: -echo Some tools were not found in the PATH or expected location: -for %%f in (%NOT_FOUND%) do echo %%f -echo You may want to install them and/or update paths in the %0 file. -echo: - -rem -------------------------------------------------------------------------- -rem Provide a clean environment for command line build. We remove the -rem msysGit cmd subdirectory as well, so no recursive sh call can occur. -rem -------------------------------------------------------------------------- - -:set_path -set PATH=%SYSTEMROOT%\system32;%SYSTEMROOT% -set PATH=%PATH_DIRS%;%PATH% -rem echo PATH: %PATH% - -rem -------------------------------------------------------------------------- -rem Start a shell. -rem Any shell script can be passed to it via command line of this batch file. -rem -------------------------------------------------------------------------- - -if not exist "%MSYSGIT%\bash.exe" goto no_bash -call "%MSYSGIT%\bash.exe" --login -i %* -goto :eof - -:no_bash -echo Cannot find bash, exiting with error -exit 1 - -rem -------------------------------------------------------------------------- -rem Attempt to find executable in the directory given or in the PATH -rem -------------------------------------------------------------------------- - -:which -rem search in the directory given first -for %%F in (%2) do set FP=%%~F\%3 -if exist "%FP%" goto found_directly - -rem search in the PATH last -for %%F in (%3) do set FP=%%~$PATH:F -if exist "%FP%" goto found_in_path - -:not_found -for %%F in (%2) do set FP=%%~F -rem echo %3: not found, expected in %FP% -set FP= -set NOT_FOUND=%NOT_FOUND% %3 -goto set - -:found_directly -for %%F in ("%FP%") do set FP=%%~dpsF -rem echo %3: found at: %FP% -goto set - -:found_in_path -for %%F in ("%FP%") do set FP=%%~dpsF -rem echo %3: found in the PATH: %FP% - -:set -rem set results regardless of was it found or not -set %1=%FP% -rem echo %1=%FP% -if "%FP%" == "" goto :eof -if not "%PATH_DIRS%" == "" set PATH_DIRS=%PATH_DIRS%; -set PATH_DIRS=%PATH_DIRS%%FP% -goto :eof diff --git a/make/winx86/shell_script.reg b/make/winx86/shell_script.reg deleted file mode 100644 index 547f2bf36..000000000 --- a/make/winx86/shell_script.reg +++ /dev/null @@ -1,19 +0,0 @@ -REGEDIT4 - -[HKEY_CLASSES_ROOT\.sh] -@="shfile" - -[HKEY_CLASSES_ROOT\shfile] -@="shell script" -"AlwaysShowExt"="" -"BrowserFlags"=dword:00000008 -"EditFlags"=dword:00000000 - -[HKEY_CLASSES_ROOT\shfile\shell] -@="" - -[HKEY_CLASSES_ROOT\shfile\shell\open] - -[HKEY_CLASSES_ROOT\shfile\shell\open\command] -@="cmd.exe /c call sh \"%1\" %*" -