Mercurial > hg > aboriginal
comparison build.sh @ 984:9840847885e8
Add export_if_blank and make lots of build paths overrideable.
author | Rob Landley <rob@landley.net> |
---|---|
date | Wed, 24 Feb 2010 10:08:38 -0600 |
parents | fc134a13357e |
children | bbcafba8a594 |
comparison
equal
deleted
inserted
replaced
983:2932487b59fa | 984:9840847885e8 |
---|---|
10 . sources/include.sh | 10 . sources/include.sh |
11 read_arch_dir | 11 read_arch_dir |
12 fi | 12 fi |
13 ARCH="$1" | 13 ARCH="$1" |
14 | 14 |
15 [ -z "$BUILD" ] && BUILD="build" | |
16 | |
15 # A function to skip stages that have already been done (because the | 17 # A function to skip stages that have already been done (because the |
16 # tarball they create is already there). | 18 # tarball they create is already there). |
17 | 19 |
18 not_already() | 20 not_already() |
19 { | 21 { |
20 if [ -f "build/$1-$ARCH.tar.bz2" ] | 22 if [ -f "$BUILD/$1-$ARCH.tar.bz2" ] |
21 then | 23 then |
22 echo "=== Skipping $1-$ARCH (already there)" | 24 echo "=== Skipping $1-$ARCH (already there)" |
23 return 1 | 25 return 1 |
24 fi | 26 fi |
25 | 27 |
42 | 44 |
43 if not_already simple-cross-compiler | 45 if not_already simple-cross-compiler |
44 then | 46 then |
45 # If we need to build cross compiler, assume root filesystem is stale. | 47 # If we need to build cross compiler, assume root filesystem is stale. |
46 | 48 |
47 rm -rf "build/root-filesystem-$ARCH.tar.bz2" | 49 rm -rf "$BUILD/root-filesystem-$ARCH.tar.bz2" |
48 time ./simple-cross-compiler.sh "$ARCH" || exit 1 | 50 time ./simple-cross-compiler.sh "$ARCH" || exit 1 |
49 fi | 51 fi |
50 | 52 |
51 # Optionally, we can build a statically linked compiler via canadian cross. | 53 # Optionally, we can build a statically linked compiler via canadian cross. |
52 | 54 |
72 | 74 |
73 # If this compiler exists, root-filesystem will pick it up and incorpoate it. | 75 # If this compiler exists, root-filesystem will pick it up and incorpoate it. |
74 | 76 |
75 if not_already native-compiler && [ -z "$NO_NATIVE_COMPILER" ] | 77 if not_already native-compiler && [ -z "$NO_NATIVE_COMPILER" ] |
76 then | 78 then |
77 rm -rf "build/root-filesystem-$ARCH.tar.bz2" | 79 rm -rf "$BUILD/root-filesystem-$ARCH.tar.bz2" |
78 | 80 |
79 BUILD_STATIC={$BUILD_STATIC:-1} ./native-compiler.sh "$ARCH" || exit 1 | 81 BUILD_STATIC={$BUILD_STATIC:-1} ./native-compiler.sh "$ARCH" || exit 1 |
80 fi | 82 fi |
81 | 83 |
82 # Do we need to build the root filesystem? | 84 # Do we need to build the root filesystem? |
84 if not_already root-filesystem | 86 if not_already root-filesystem |
85 then | 87 then |
86 | 88 |
87 # If we need to build root filesystem, assume system image is stale. | 89 # If we need to build root filesystem, assume system image is stale. |
88 | 90 |
89 rm -rf "build/system-image-$ARCH.tar.bz2" | 91 rm -rf "$BUILD/system-image-$ARCH.tar.bz2" |
90 time ./root-filesystem.sh "$ARCH" || exit 1 | 92 time ./root-filesystem.sh "$ARCH" || exit 1 |
91 fi | 93 fi |
92 | 94 |
93 if not_already system-image | 95 if not_already system-image |
94 then | 96 then |