Browse Source

export simplified, READMEs clarified

Alexander Shiryaev 11 years ago
parent
commit
ada4d8d390
3 changed files with 54 additions and 104 deletions
  1. 30 40
      README
  2. 15 5
      new/README
  3. 9 59
      new/export

+ 30 - 40
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 <outputDirectory>
 
-    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

+ 15 - 5
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 <outputDir>
+#
+# 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

+ 9 - 59
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