forked from ghaerr/elks
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathenv.sh
More file actions
executable file
·40 lines (26 loc) · 784 Bytes
/
env.sh
File metadata and controls
executable file
·40 lines (26 loc) · 784 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/bin/bash
# Set up the build environment
# Must be executed with top directory /elks as the current one
if [ ! -e "env.sh" ]; then
echo "ERROR: You did not sourced this script from the top directory.";
echo " Set the top directory of ELKS as the current one,";
echo " then source this script again.";
return 1;
fi
export TOPDIR="$(pwd)"
echo TOPDIR set to $TOPDIR
export CROSSDIR="$TOPDIR/cross"
echo "CROSSDIR set to $CROSSDIR"
add_path () {
if [[ ":$PATH:" != *":$1:"* ]]; then
export PATH="$1:$PATH"
fi
}
add_path "$CROSSDIR/bin"
# Set up internal ELKS tools path
ELKSTOOLSDIR="$TOPDIR/elks/tools"
add_path "$ELKSTOOLSDIR/bin"
echo PATH set to $PATH
# May inject some Make options
export MAKEFLAGS="$MAKEFLAGS"
echo MAKEFLAGS set to $MAKEFLAGS