makegcc 1.64 KB
Newer Older
1
2
#!/bin/sh

3

4
MYUNAME=${UNAME:-`uname`}
5
6
FR_PATH=`pwd`
FR_VERSION=`grep -e " VERSION " ../CMakeLists.txt|cut -c13-23`
7
MYCC="gcc -g -fPIC -O -Wall -DFR_PATH=\"${FR_PATH}\" -DFR_VERSION=\"${FR_VERSION}\" -D_XOPEN_SOURCE=700"
8

9
#--------------- special convention on alpha and Linux
10
if  [ $MYUNAME = "OSF1" ] 
11
then MYUNAME="alpha"
12
fi
13
14
15
if  [ $MYUNAME = "Linux" ] 
then MYUNAME=`uname`-`uname -m`
fi
16
17
18
19
20
21
22
23
24
25
26

FLAGS=" -I../src -I../src/zlib libFrame.a -lm"

echo " -------> This is $MYUNAME <--- We compile with $MYCC "
mkdir ../$MYUNAME 
cd ../$MYUNAME 

echo "----------------------------Delete existing *.o files"        
rm   -f  *.o

echo "----------------------------------Compile the library" 
27
${MYCC}  -c ../src/FrameL.c ../src/FrIO.c ../src/FrFilter.c ../src/zlib/*.c -I../src/zlib
28
29
30
31

echo "----------------------------Build the regular library"
rm  -f libFrame.a
ar   r libFrame.a  *.o
32
33
ranlib libFrame.a

34
echo "-----------------------------Build the shared Library"
35
${MYCC} -shared -g -fPIC -o libFrame.so  *.o 
36
37
38
39
40
41

echo "--------------------------------Compile the utilities"

${MYCC} -o FrDump      ../src/FrDump.c    ${FLAGS} 
${MYCC} -o FrCopy      ../src/FrCopy.c    ${FLAGS} 
${MYCC} -o FrCheck     ../src/FrCheck.c   ${FLAGS} 
42
43
44
ln -s FrDump  FrDump.exe
ln -s FrCopy  FrCopy.exe
ln -s FrCheck FrCheck.exe
45

46
echo "------------------Compile and Build the debug library"
47
${MYCC} -g  -c ../src/FrameL.c ../src/FrIO.c  ../src/FrFilter.c ../src/zlib/*.c -I../src/zlib
48
49
50
51
rm  -f libFrameDebug.a
ar   r libFrameDebug.a  *.o
ranlib libFrameDebug.a

52
echo "-------------------------------------Delete *.o files"        
53
54
rm   -f  *.o
ls -l
55
echo "--------------------------------------------All done"