source: mainline/build_all.sh@ d3357e9

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

Make building bootable images optional

  • Property mode set to 100755
File size: 1.8 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
27for profile in $PROFILES; do
28 if [ -f ${profile}/build.ninja ]; then
29 ninja -C ${profile} build.ninja || exit 1
30 continue
31 fi
32
33 echo "Configuring profile ${profile}"
34
35 # Let HelenOS config tool write out Makefile.config and config.h.
36 mkdir -p ${profile} || exit 1
37 cd ${profile} || exit 1
38 ${SOURCE_DIR}/tools/config.py ${CONFIG_RULES} ${CONFIG_DEFAULTS} hands-off ${profile} || exit 1
39 cd -
40
41
42 if [ "$profile" = 'special/abs32le' ]; then
43 cross_target='ia32'
44 else
45 cross_target=`dirname $profile`
46 if [ "$cross_target" = '.' ]; then
47 cross_target=$profile
48 fi
49 fi
50
51 meson ${SOURCE_DIR} ${profile} --cross-file ${SOURCE_DIR}/meson/cross/${cross_target} || exit 1
52done
53
54echo
55echo "###################### Building all profiles ######################"
56
57for profile in $PROFILES; do
58 ninja -C ${profile} || exit 1
59done
60
61
62if [ "$#" -eq 1 ] && [ "$1" = 'images' ]; then
63 echo "###################### Building all images ######################"
64
65 for profile in $PROFILES; do
66 ninja -C ${profile} image_path || exit 1
67 done
68else
69 echo
70 echo "Bootable images not built."
71 echo "Run '$0 images' to build them as well."
72fi
Note: See TracBrowser for help on using the repository browser.