source: mainline/build_all.sh@ 2670afc

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 2670afc 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
RevLine 
[56440a5]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
[d3357e9]24echo
25echo "###################### Configuring all profiles ######################"
[56440a5]26
[8183b35]27echo "Configuring profiles" $PROFILES
28
[56440a5]29for profile in $PROFILES; do
[8183b35]30 # echo "Configuring profile ${profile}"
[56440a5]31
32 mkdir -p ${profile} || exit 1
[18b1643]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 &
[8183b35]34 echo "$!" >"${profile}/configure.pid"
[56440a5]35done
36
[8183b35]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
[d3357e9]57echo
58echo "###################### Building all profiles ######################"
[56440a5]59
60for profile in $PROFILES; do
[18b1643]61 echo
[d3357e9]62 ninja -C ${profile} || exit 1
[56440a5]63done
[d3357e9]64
65
66if [ "$#" -eq 1 ] && [ "$1" = 'images' ]; then
[f69d5a8]67 echo
[d3357e9]68 echo "###################### Building all images ######################"
69
70 for profile in $PROFILES; do
[18b1643]71 echo
[d3357e9]72 ninja -C ${profile} image_path || exit 1
73 done
[18b1643]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
[d3357e9]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.