source: mainline/build_all.sh@ 971849b1

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 971849b1 was 18b1643, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 6 years ago

Add standalone configure.sh script

  • Property mode set to 100755
File size: 2.0 KB
Line 
1#!/bin/sh
2
3# Find out the path to the script.
4SOURCE_DIR=`which -- "$0" 2>/dev/null`
5# Maybe we are running bash.
6[ -z "$SOURCE_DIR" ] && SOURCE_DIR=`which -- "$BASH_SOURCE"`
7[ -z "$SOURCE_DIR" ] && exit 1
8SOURCE_DIR=`dirname -- "$SOURCE_DIR"`
9SOURCE_DIR=`cd $SOURCE_DIR && echo $PWD`
10
11# Make sure we don't make a mess in the source root.
12if [ "$PWD" = "$SOURCE_DIR" ]; then
13 mkdir -p build_all
14 cd build_all
15fi
16
17CONFIG_RULES="${SOURCE_DIR}/HelenOS.config"
18CONFIG_DEFAULTS="${SOURCE_DIR}/defaults"
19
20# Find all the leaf subdirectories in the defaults directory.
21PROFILES=`find ${CONFIG_DEFAULTS} -type d -links 2 -printf "%P\n" | sort`
22
23
24echo
25echo "###################### Configuring all profiles ######################"
26
27echo "Configuring profiles" $PROFILES
28
29for profile in $PROFILES; do
30 # echo "Configuring profile ${profile}"
31
32 mkdir -p ${profile} || exit 1
33 script -q -e /dev/null -c "cd '${profile}' && '${SOURCE_DIR}/configure.sh' '${profile}' && ninja build.ninja" </dev/null >"${profile}/configure_output.log" 2>&1 &
34 echo "$!" >"${profile}/configure.pid"
35done
36
37failed='no'
38
39for profile in $PROFILES; do
40 if ! wait `cat "${profile}/configure.pid"`; then
41 failed='yes'
42 cat "${profile}/configure_output.log"
43 echo
44 echo "Configuration of profile ${profile} failed."
45 echo
46 fi
47done
48
49if [ "$failed" = 'yes' ]; then
50 echo
51 echo "Some configuration jobs failed."
52 exit 1
53else
54 echo "All profiles configured."
55fi
56
57echo
58echo "###################### Building all profiles ######################"
59
60for profile in $PROFILES; do
61 echo
62 ninja -C ${profile} || exit 1
63done
64
65
66if [ "$#" -eq 1 ] && [ "$1" = 'images' ]; then
67 echo
68 echo "###################### Building all images ######################"
69
70 for profile in $PROFILES; do
71 echo
72 ninja -C ${profile} image_path || exit 1
73 done
74
75 echo
76 for profile in $PROFILES; do
77 path=`cat ${profile}/image_path`
78
79 if [ ! -z "$path" ]; then
80 echo "built ${profile}/${path}"
81 fi
82 done
83else
84 echo
85 echo "Bootable images not built."
86 echo "Run '$0 images' to build them as well."
87fi
Note: See TracBrowser for help on using the repository browser.