summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Pouillard <np@nicolaspouillard.fr>2010-05-11 13:28:31 +0000
committerNicolas Pouillard <np@nicolaspouillard.fr>2010-05-11 13:28:31 +0000
commite9c19d4e100a3bfbc5e953b4cc1523c33b30f135 (patch)
tree93b6caa6cc432b1f8cddaf1242b82e2c6c2d799f
parent50864fb4b339a46295c56255c34a343c766815b0 (diff)
build: cleanup ocamlbuild build scripts
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10385 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rwxr-xr-xbuild/boot-c-parts-windows.sh23
-rwxr-xr-xbuild/boot-c-parts.sh45
-rwxr-xr-xbuild/fastworld.sh7
-rwxr-xr-xbuild/mkconfig.sh7
-rw-r--r--build/new-build-system9
-rwxr-xr-xbuild/world.sh22
6 files changed, 53 insertions, 60 deletions
diff --git a/build/boot-c-parts-windows.sh b/build/boot-c-parts-windows.sh
deleted file mode 100755
index 3e2ca3dc8..000000000
--- a/build/boot-c-parts-windows.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-# $Id$
-cd `dirname $0`/..
-set -ex
-
-. config/config.sh
-
-(cd byterun && make -f Makefile.nt)
-(cd asmrun && make -f Makefile.nt all meta.$O dynlink.$O)
-(cd yacc && make -f Makefile.nt)
-(cd win32caml && make)
-
-mkdir -p _build/boot
-cp -f byterun/ocamlrun.exe \
- byterun/libcamlrun.$A \
- asmrun/libasmrun.$A \
- yacc/ocamlyacc.exe \
- boot/ocamlc \
- boot/ocamllex \
- boot/ocamldep \
- _build/boot
-mkdir -p _build/byterun
-cp -f byterun/ocamlrun.exe boot
diff --git a/build/boot-c-parts.sh b/build/boot-c-parts.sh
index a38c16410..9999392e3 100755
--- a/build/boot-c-parts.sh
+++ b/build/boot-c-parts.sh
@@ -1,22 +1,37 @@
#!/bin/sh
-# $Id$
cd `dirname $0`/..
set -ex
-# Create a bunch of symlinks to _build/boot
+. config/config.sh
+
+if "$WINDOWS"; then
+ MAKEOPTS='-f Makefile.nt'
+ LINK='cp -f'
+else
+ MAKEOPTS=''
+ LINK='ln -s -f'
+fi
+
+(cd byterun && make $MAKEOPTS)
+(cd asmrun && make $MAKEOPTS all meta."$O" dynlink."$O")
+(cd yacc && make $MAKEOPTS)
+
+if "$WINDOWS"; then
+ (cd win32caml && make)
+fi
+
mkdir -p _build/boot
-ln -sf ../../byterun/ocamlrun \
- ../../byterun/libcamlrun.a \
- ../../asmrun/libasmrun.a \
- ../../asmrun/libasmrunp.a \
- ../../yacc/ocamlyacc \
- ../../boot/ocamlc \
- ../../boot/ocamllex \
- ../../boot/ocamldep \
- _build/boot
-[ -f boot/ocamlrun ] || ln -sf ../byterun/ocamlrun boot
+# Create a bunch of symlinks (or copies) to _build/boot
+(cd _build/boot &&
+$LINK ../../byterun/ocamlrun$EXE \
+ ../../byterun/libcamlrun.$A \
+ ../../asmrun/libasmrun.$A \
+ ../../yacc/ocamlyacc$EXE \
+ ../../boot/ocamlc \
+ ../../boot/ocamllex \
+ ../../boot/ocamldep \
+ . )
-(cd byterun && make)
-(cd asmrun && make all meta.o dynlink.o)
-(cd yacc && make)
+(cd boot &&
+[ -f boot/ocamlrun$EXE ] || $LINK ../byterun/ocamlrun$EXE . )
diff --git a/build/fastworld.sh b/build/fastworld.sh
index 5c08e1aae..10ffa812f 100755
--- a/build/fastworld.sh
+++ b/build/fastworld.sh
@@ -24,12 +24,7 @@ if [ -e ocamlbuild_mixed_mode ]; then
fi
./mkconfig.sh
./mkmyocamlbuild_config.sh
-. ../config/config.sh
-if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then
- ./boot-c-parts-windows.sh
-else
- ./boot-c-parts.sh
-fi
+./boot-c-parts.sh
./boot.sh $@
cd ..
diff --git a/build/mkconfig.sh b/build/mkconfig.sh
index 0eb693030..d7c2d91eb 100755
--- a/build/mkconfig.sh
+++ b/build/mkconfig.sh
@@ -1,5 +1,4 @@
#!/bin/sh
-# $Id$
cd `dirname $0`/..
@@ -8,3 +7,9 @@ sed -e 's/^\(.*\$([0-9]).*\)$/# \1/' \
-e 's/^FLEX.*$//g' \
-e 's/^\([^#=]*\)=\([^"]*\)$/if [ "x$\1" = "x" ]; then \1="\2"; fi/' \
config/Makefile > config/config.sh
+
+if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then
+ echo "WINDOWS=true" >> config/config.sh
+else
+ echo "WINDOWS=false" >> config/config.sh
+fi
diff --git a/build/new-build-system b/build/new-build-system
index b16f6deb8..690ea4ad1 100644
--- a/build/new-build-system
+++ b/build/new-build-system
@@ -12,17 +12,16 @@ utils/config.mlbuild # Should be renamed as utils/config.ml
build/
world.sh # Build all the OCaml world
+ world.byte.sh # Build the bytecode world
+ world.native.sh # Build the native world
+ world.all.sh # Build all the world the don't bootstrap
fastworld.sh # Same as above but faster
boot-c-parts.sh # Compile byterun, ocamlyacc and asmrun with the Makefiles
- boot-c-parts-windows.sh # Same as boot-c-parts.sh but for windows
boot.sh # Compile the stdlib and ocamlc
camlp4-targets.sh # Setup camlp4 targets
otherlibs-targets.sh # Setup otherlibs targets
targets.sh # All targets of the OCaml distribution
- world.byte.sh # Build the bytecode world
- world.native.sh # Build the native world
- world.all.sh # Build all the world the don't bootstrap
install.sh # Install all needed files
distclean.sh # Clean all generated files
@@ -34,7 +33,7 @@ build/
camlp4-bootstrap.sh
# Partial stuffs (just camlp4 and ocamlbuild)
- partial-boot.sh
+ mixed-boot.sh
camlp4-byte-only.sh
camlp4-native-only.sh
ocamlbuild-byte-only.sh
diff --git a/build/world.sh b/build/world.sh
index bbe1632a9..0b9a4b289 100755
--- a/build/world.sh
+++ b/build/world.sh
@@ -13,8 +13,6 @@
# #
#########################################################################
-# $Id$
-
cd `dirname $0`
set -e
if [ -e ocamlbuild_mixed_mode ]; then
@@ -22,13 +20,17 @@ if [ -e ocamlbuild_mixed_mode ]; then
echo 'please cleanup and re-launch (make clean ; ./build/distclean.sh)'
exit 1
fi
+case "$1" in
+ all|a|al) mode=all;;
+ byte|b|by|byt) mode=byte;;
+ native|na|nat|nati|nativ) mode=native;;
+ *) echo 'Unexpected target. Expected targets are: all,byte,native' \
+ >/dev/stderr
+ exit 1;;
+esac
+shift
./mkconfig.sh
./mkmyocamlbuild_config.sh
-. ../config/config.sh
-if [ "x$EXE" = "x.exe" -a "x$SYSTEM" != "xcygwin" ]; then
- ./boot-c-parts-windows.sh
-else
- ./boot-c-parts.sh
-fi
-./boot.sh $@
-./world.all.sh $@
+./boot-c-parts.sh
+./boot.sh "$@"
+./world."$mode".sh "$@"