File tree Expand file tree Collapse file tree
sduino/hardware/sduino/tools/wrapper Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- #! /bin/dash
1+ #! /bin/bash
22
3+ VERBOSE=0
4+ USE_COLOR=0
5+ if [ " $1 " == " -v" ]; then
6+ VERBOSE=1;
7+ shift
8+ elif [ " $1 " == " -vv" ]; then
9+ VERBOSE=2
10+ # USE_COLOR=1
11+ set -x
12+ shift
13+ fi
14+
15+
16+ if [ $USE_COLOR -gt 0 ]; then
317# ANSI color codes to beautify the output:
418BLACK=' \033[0;30m'
519RED=' \033[0;31m'
@@ -18,10 +32,13 @@ LPURPLE='\033[1;35m'
1832LCYAN=' \033[1;36m'
1933WHITE=' \033[1;37m'
2034OFF=' \033[0m'
35+ fi
2136
2237
2338# echo the full command line in cyan:
24- >&2 echo " ${CYAN}${@ }${OFF} "
39+ >&2 echo -ne " ${CYAN} "
40+ >&2 echo -n " ${@ } "
41+ >&2 echo -e " ${OFF} "
2542
2643# echo the mark id in green and the compiler call in white:
2744SDAR=$1
@@ -30,7 +47,9 @@ OBJ=${3%.o}.rel
3047MARK=$4
3148shift 4
3249
33- >&2 echo " ${GREEN} Mark $MARK :${OFF} " " $SDAR " " $@ " " $LIB " " $OBJ "
50+ >&2 echo -ne " ${GREEN} Mark $MARK :${OFF} "
51+ >&2 echo " $SDAR " " $@ " " $LIB " " $OBJ "
52+
3453" $SDAR " " $@ " " $LIB " " $OBJ "
3554ERR=$?
3655cp -a " $LIB " " ${LIB% .a} .lib"
Original file line number Diff line number Diff line change 22
33# usage: sdcc-link [.lib and .rel files] re5 [other flags and files]
44
5+ VERBOSE=0
6+ USE_COLOR=0
7+ if [ " $1 " == " -v" ]; then
8+ VERBOSE=1;
9+ shift
10+ elif [ " $1 " == " -vv" ]; then
11+ VERBOSE=2
12+ # USE_COLOR=1
13+ set -x
14+ shift
15+ fi
16+
17+
18+ if [ $USE_COLOR -gt 0 ]; then
519# ANSI color codes to beautify the output:
620BLACK=' \033[0;30m'
721RED=' \033[0;31m'
@@ -20,28 +34,38 @@ LPURPLE='\033[1;35m'
2034LCYAN=' \033[1;36m'
2135WHITE=' \033[1;37m'
2236OFF=' \033[0m'
37+ fi
2338
2439SDCC=" $1 "
2540shift
2641
27- # echo the full command line in cyan:
28- >&2 echo -e " ${CYAN}${@ }${OFF} "
42+ if [ $VERBOSE ]; then
43+ # echo the full command line in cyan:
44+ >&2 echo -ne " ${CYAN} "
45+ >&2 echo -n " ${@ } "
46+ >&2 echo -e " ${OFF} "
47+ fi
2948
3049declare -a OBJS
3150while [ $# -gt 0 ]; do
3251 echo $1
3352 FILE=$1
34- if [[ $FILE == * .a ]]; then
53+ if [[ " $FILE " == * .a ]]; then
3554 FILE=${FILE% .a} .lib
3655 cp -a " $1 " " $FILE "
3756 fi
38- if [[ $FILE == * .o ]]; then
57+ if [[ " $FILE " == * .o ]]; then
3958 FILE=${FILE% .o} .rel
4059 fi
41- OBJS+=(${FILE} )
60+ OBJS+=(" ${FILE} " )
4261 shift
4362done
44- echo " $SDCC " " ${OBJS[@]} "
63+
64+ if [ $VERBOSE ]; then
65+ echo -ne " cmd: ${ORANGE} "
66+ echo -n " $SDCC " " ${OBJS[@]} "
67+ echo -e " ${OFF} "
68+ fi
4569" $SDCC " " ${OBJS[@]} "
4670
4771# propagate the sdcc exit code
Original file line number Diff line number Diff line change 1- #! /bin/dash
1+ #! /bin/bash
22
33# wrapper around SDCC to let the external interface look more gcc-alike
44#
1111# dependency checker on following builds
1212
1313
14+ VERBOSE=0
15+ USE_COLOR=0
16+ if [ " $1 " == " -v" ]; then
17+ VERBOSE=1;
18+ shift
19+ elif [ " $1 " == " -vv" ]; then
20+ VERBOSE=2
21+ # USE_COLOR=1
22+ set -x
23+ shift
24+ fi
25+
26+
27+ if [ $USE_COLOR -gt 0 ]; then
1428# ANSI color codes to beautify the output:
1529BLACK=' \033[0;30m'
1630RED=' \033[0;31m'
@@ -29,10 +43,13 @@ LPURPLE='\033[1;35m'
2943LCYAN=' \033[1;36m'
3044WHITE=' \033[1;37m'
3145OFF=' \033[0m'
46+ fi
3247
3348
3449# echo the full command line in cyan:
35- >&2 echo " ${CYAN}${@ }${OFF} "
50+ >&2 echo -ne " ${CYAN} "
51+ >&2 echo -n " ${@ } "
52+ >&2 echo -e " ${OFF} "
3653
3754# echo the mark id in green and the compiler call in white:
3855SDCC=$1
@@ -41,14 +58,15 @@ OBJ=$3
4158REL=${OBJ% .o} .rel
4259MARK=$4
4360shift 4
44- >&2 echo " ${GREEN} Mark $MARK :${OFF} " " $SDCC " " $@ " " $SRC " -o " $OBJ "
61+ >&2 echo -ne " ${GREEN} Mark $MARK :${OFF} "
62+ >&2 echo " $SDCC " " $@ " " $SRC " -o " $OBJ "
4563
4664case " $SRC " in
4765 * .cpp)
4866 # rename .cpp to .c and compile
49- >&2 echo " ${RED} cpp gefunden${OFF} " ;
67+ >&2 echo -e " ${RED} cpp gefunden${OFF} " ;
5068 CSRC=" ${SRC% pp} "
51- cp -av " $SRC " " $CSRC "
69+ cp -a " $SRC " " $CSRC "
5270 " $SDCC " " $@ " " $CSRC " -o " $OBJ "
5371 ERR=$?
5472 rm -f " $CSRC "
You can’t perform that action at this time.
0 commit comments