2021-03-02 18:58:11 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copyright maxcodehack, 2021
|
|
|
|
# gcc options for build for KolibriOS
|
|
|
|
|
|
|
|
# We start w/o param?
|
|
|
|
if [ -z "$*" ]
|
|
|
|
then
|
|
|
|
echo -e "\033[1;31mfatal error: \033[0mno input files"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# KLIBC variable exists?
|
|
|
|
if [ -z "$KLIBC" ]
|
|
|
|
then
|
|
|
|
echo -e "\033[1;31mfatal error: \033[0mKLIBC variable not set"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# GCC Flags for KolibriOS
|
|
|
|
FLAGS="-c -m32 -nostdinc -fno-common -fno-builtin -fno-leading-underscore -fno-pie -fno-stack-protector -fno-stack-check -mpreferred-stack-boundary=2"
|
2021-03-04 20:46:14 +01:00
|
|
|
KOS_PLATFORM="-Ulinux -U__linux -U__linux__ -U__gnu_linux__ -U__unix__ -U__unix -Uunix -Dkolibri -D__kolibri -D__kolibri__"
|
2021-03-02 18:58:11 +01:00
|
|
|
|
|
|
|
# And, execute gcc:
|
2021-03-04 20:46:14 +01:00
|
|
|
gcc $FLAGS $KOS_PLATFORM -I$KLIBC/source/include $*
|