forked from vicgeralds/vitetris
-
Notifications
You must be signed in to change notification settings - Fork 0
/
src-conf.sh
executable file
·37 lines (37 loc) · 773 Bytes
/
src-conf.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#! /bin/sh
# generate src/src-conf.mk
TEXT=
case "$1" in
def) TEXT="D$2 = -D$2=1" ;;
obj) TEXT="$2_obj = $2.o" ;;
lib) TEXT="$2_lib = $2.a" ;;
set) TEXT="$2 = $3"
shift
esac
if [ -n "$TEXT" ]
then
[ -z "$2$3" ] && exit
if [ -n "$3" ] && [ "x$4" = x-a ]
then shift; shift
fi
if [ "x$3" = x-z ] && [ -n "$4" ]
then TEXT="#$TEXT"
elif [ -z "$3" ]
then TEXT="#$TEXT"
fi
echo $TEXT >> src/src-conf.mk
exit
fi
cd src
if [ -n "$1" ]
then echo CC = $1 > src-conf.mk
else echo > src-conf.mk
fi
echo 'CCFLAGS = $(CFLAGS) $(CPPFLAGS)' >> src-conf.mk
echo '#CFLAGS = -O2 -Wall -pedantic -Wno-parentheses' >> src-conf.mk
if [ -n "$2" ]
then echo CFLAGS = $2 >> src-conf.mk
else echo CFLAGS = -O2 >> src-conf.mk
fi
[ -n "$3" ] && echo CPPFLAGS = $3 >> src-conf.mk
cd ..