WEIRDINT constant added -> for_ints() interator now accepts negative integers
[svn/Cll1h/.git] / tools / bake
CommitLineData
04a13a6f 1#!/bin/bash
25a3f430 2CONF="/etc/bake.conf"
04a13a6f 3CLL1CC=`which gcc`
25a3f430 4CFLAGS="-std=c99 -Wall"
04a13a6f 5EXE=`basename $1 .c`
6DEBUG=n
7
8function debugecho
9{
10 if [ $DEBUG == y ]
11 then
12 echo $1
13 fi
14}
15
16if [ "$1" == "" ] || [ "$EXE" == "$1" ]
17then
18 echo "Usage: bake filename.c"
19 exit
20else
21 debugecho "Filename: $1"
22fi
23
24LIBNAMES=`grep "^#define" $1|grep USE_LIBRARY_|cut -f 2 -d " "`
25if ! [ -z "$LIBNAMES" ]
26then
27 debugecho "Libraries: $LIBNAMES"
28 LIBS=""
29 for F in $LIBNAMES
30 do
31 LIBS="$LIBS `grep $F $CONF|cut -f 2 -d \ `"
32 done
33fi
34
35PRENAMES=`grep "^#define" $1|grep USE_PREPROCESSOR_|cut -f 2 -d " "`
36if ! [ -z "$PRENAMES" ]
37then
38 debugecho "Precompilers: $PRENAMES"
39 for F in $PRENAMES
40 do
41 CMD=`grep $F $CONF|cut -f 2 -d " "`
42 gecho "$CMD"
43 $CMD
44 done
45fi
46
25a3f430 47CMD="$CLL1CC $1 -o $EXE $CFLAGS $LIBS"
04a13a6f 48echo "$CMD"
49$CMD
This page took 0.188177 seconds and 4 git commands to generate.