[build] Detect compiler; force color output in clang
This commit is contained in:
parent
1f4b7c68b6
commit
fe9b4d5cbb
9
Makefile
9
Makefile
@ -1,5 +1,6 @@
|
||||
#CC = gcc-4.3
|
||||
CC = clang
|
||||
# ToAruOS Primary Build Script
|
||||
# This script will pull either clang (with -fcolor-diagnostics), gcc (with no extra options), or cc
|
||||
CC = `util/compiler`
|
||||
# Sometimes we just have to use GCC
|
||||
GCC = gcc
|
||||
# CFLAGS for core components
|
||||
@ -21,8 +22,8 @@ DD = dd conv=notrunc
|
||||
BEG = util/mk-beg
|
||||
END = util/mk-end
|
||||
INFO = util/mk-info
|
||||
ERRORS = 2>>/tmp/.build-errors
|
||||
ERRORSS = >>/tmp/.build-errors
|
||||
ERRORS = 2>>/tmp/.build-errors || util/mk-error
|
||||
ERRORSS = >>/tmp/.build-errors || util/mk-error
|
||||
|
||||
BEGRM = util/mk-beg-rm
|
||||
ENDRM = util/mk-end-rm
|
||||
|
9
util/compiler
Executable file
9
util/compiler
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [[ -n `which clang` ]] ; then
|
||||
echo "clang -fcolor-diagnostics"
|
||||
elif [[ -n `which gcc` ]] ; then
|
||||
echo "gcc"
|
||||
else
|
||||
echo "cc"
|
||||
fi
|
6
util/mk-error
Executable file
6
util/mk-error
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo -e "\033[1;31m! Fatal error encountered.\033[0m"
|
||||
cat /tmp/.build-errors
|
||||
|
||||
exit 1
|
Loading…
Reference in New Issue
Block a user