mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 22:42:41 +01:00
explicitly. If you forget a dependency, it's simply not visible to the compiler, and so the compilation fails. This is a big plus over conventional Make.
18 lines
360 B
Bash
18 lines
360 B
Bash
. $stdenv/setup
|
|
|
|
mainName=$(basename $main | cut -c34-)
|
|
ln -s $main $mainName
|
|
|
|
echo "compiling $mainName..."
|
|
|
|
localIncludes=($localIncludes)
|
|
n=0
|
|
while test $n -lt ${#localIncludes[*]}; do
|
|
source=${localIncludes[n]}
|
|
target=${localIncludes[$((n+1))]}
|
|
ln -s $source $target
|
|
n=$((n + 2))
|
|
done
|
|
|
|
mkdir $out
|
|
gcc -Wall -c $mainName -o $out/$mainName.o
|