From: Alexander Shiryaev Date: Sun, 16 Feb 2014 21:25:48 +0000 (+0400) Subject: export simplified, READMEs clarified X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=ada4d8d390a0076659ff4ad9f50079c5511918f0;p=bbcp.git export simplified, READMEs clarified --- diff --git a/README b/README index 8bc9c16..df987b3 100644 --- a/README +++ b/README @@ -1,51 +1,41 @@ -** Ducumentation (Russian): ** +Ducumentation (Russian): - http://gitlab.molpit.com/idenisov/blackbox-linux/wikis/home + http://gitlab.molpit.com/idenisov/blackbox-linux/wikis/home +Directories structure: -** Folders structure: ** + new/ + universal development environment + synchronized with original BlackBox 1.6 -./new/ - universal development environment - synchronized with original BlackBox 1.6 + examples/ (all axamples are not tested on `new` version yet) + server/ + static web-server as the example of an application for Linux OS + console/ + simple console application + fpstest/ + loop test -./examples/ (all axamples are not tested on `new` version yet) - /server/ - static web-server as the example of an application for Linux OS - /console/ - simple console application - /fpstest/ - loop test - -** Installation ** +To build BlackBox: -1. For creating links in development directory run: + cd new + ./switch-target `uname -s` GUI + ./build - cd ./new - ./README +To run BlackBox (after build): - To start: + cd new + ./run-BlackBox - ./run-BlackBox +To create BlackBox assembly (after build): -2. For creating assembly for target OS in development directory run: + cd ./new + ./export - cd ./new - ./export (Linux|OpenBSD|FreeBSD) (GUI|) - - Example for Linux: - - ./export Linux GUI - - Then: - - cd ../Linux_GUI - ./build - - To start with .so loader: - - ./run-BlackBox - - To start with .ELF loader - - ./run-BlackBox-2 +Example: build, create assembly in /tmp, run BlackBox from assembly: + cd new + ./switch-target `uname -s` GUI + ./build + ./export /tmp/BlackBox-`uname -s` + cd /tmp/BlackBox-`uname -s` + ./run-BlackBox diff --git a/new/README b/new/README index c157efd..f589760 100644 --- a/new/README +++ b/new/README @@ -1,10 +1,20 @@ -# For preparing the BlackBox for the target OS run: -# ./README +# To build BlackBox (for current operating system): +# ./switch-target `uname -s` GUI +# ./build +# +# To run BlackBox (after build): +# ./run-BlackBox +# +# To export BlackBox (after build): +# ./export +# +# To clean up: +# ./clean +# ./switch-target none +# +# Build and run BlackBox: echo "Please wait..." ./switch-target `uname -s` GUI ./build ./run-BlackBox - -# For clearing the folders before commit run -# ./switch-target none diff --git a/new/export b/new/export index 0d923c2..9ab4762 100755 --- a/new/export +++ b/new/export @@ -1,65 +1,15 @@ #!/bin/sh -mklinks () { - find "${1}" -mindepth ${2} -maxdepth ${2} \( -type f -o -type l \) -print | - while read l; do - to=`echo $l | sed "s/^${line}\///"` - mkdir -p `dirname "${4}/${to}"` - cp ${l} "${4}/${to}" - done -} - -dolinks () { - mkdir -p ../${1}_${2} - cp -R 'System' ../${1}_${2}/ - cp -R 'Code' ../${1}_${2}/ - cp -R 'Comm' ../${1}_${2}/ - cp -R 'Cons' ../${1}_${2}/ - cp -R 'Dev' ../${1}_${2}/ - cp -R 'Docu' ../${1}_${2}/ - cp -R 'Gtk2' ../${1}_${2}/ - cp -R 'Host' ../${1}_${2}/ - cp -R 'Lin' ../${1}_${2}/ - cp -R 'Obx' ../${1}_${2}/ - cp -R 'Sql' ../${1}_${2}/ - cp -R 'Std' ../${1}_${2}/ - cp -R 'Sym' ../${1}_${2}/ - cp -R 'Text' ../${1}_${2}/ - cp -R 'Xhtml' ../${1}_${2}/ - cp -R 'run-BlackBox' ../${1}_${2}/ - cp -R 'run-dev0' ../${1}_${2}/ - - lines1=`find . -mindepth 1 -maxdepth 1 -name "_*${1}*_" -print | sed 's/\.\///'` - lines2=`find . -mindepth 1 -maxdepth 1 -name "__*${2}*" -print | sed 's/\.\///'` - lines3=`find . -mindepth 1 -maxdepth 1 -name "_*"${1}"*_*${2}*" -print | sed 's/\.\///'` - for line in $lines1 $lines2 $lines3; do - find "${line}" -mindepth 1 -maxdepth 1 \( -type f -o -type l \) -print | - while read l; do - cp $l ../${1}_${2}/ - done - - mklinks "${line}" 3 ../.. ../${1}_${2} - mklinks "${line}" 4 ../../.. ../${1}_${2} - done -} - if [ $# -eq 1 ]; then - dolinks "${1}" Interp - echo "Export complite to the directory ../${1}_Interp!" - echo "For compiling BlackBox modules run:" - echo " cd ../${1}_Interp" - echo " ./build" -elif [ $# -eq 2 ]; then - dolinks "${1}" "${2}" - echo "Export complite to the directory ../${1}_${2}!" - echo "For compiling BlackBox modules run:" - echo " cd ../${1}_${2}" - echo " ./build" + outDir="${1}" + if [ ! -e "${outDir}" ]; then + mkdir "${outDir}" + pax -r -w -L -s ',^Lin/Mod/gen-.*,,' -s ',^Lin/Rsrc.*,,' `ls -p | grep -E "^[A-Z].+\/$" | grep -v "^${outDir}\/$"` libBB.so loader run-BlackBox "${outDir}" + else + echo "${outDir}: already exists" + exit 2 + fi else - echo "Exporting BlackBox from development to distribution form for target OS." - echo "Usage: `basename $0` OS [ configuration ]" - echo " OS: Linux | OpenBSD | FreeBSD" - echo " configuration: GUI" - echo "Example: ./export Linux GUI" + echo "usage: `basename $0` outputDirectory" exit 1 fi