File: icm_bootstrap

package info (click to toggle)
icmake 7.18.00-2
  • links: PTS
  • area: main
  • in suites: wheezy
  • size: 2,840 kB
  • sloc: ansic: 7,784; makefile: 3,811; sh: 319; cpp: 83
file content (107 lines) | stat: -rwxr-xr-x 2,781 bytes parent folder | download
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#!/bin/bash

GLB=-DHAVE_GLOB

if [ "$#" == "0" ] ; then
echo "
    Usage: bootstrap root-directory

    root-directory: directory under which all icmake files will be
    installed. For a normal system-installation use, e.g., /

    This script assumes that the GCC compiler is available, and that
    the function glob() is available in the gcc-runtime library.
    If that's not the case, remove the -DHAVE_GLOB define from the 
    gcc flags at the top of $0.

    Furthermore, it assumes that the parser files parser.c and parser.h have
    already been generated from the file parser and that the file lexer.c has
    already been generated from the file lexer.
"                                     
    exit 1
fi

try()
{
    echo $*
    $* || exit 1
}

. icm_prepare

if [ "${CFLAGS}" == "" ] ; then CFLAGS="-O2 -g"; fi
  
echo Creating tmp/libicrss.a

try cd rss
try gcc -c -Wall ${CFLAGS} ${GLB} *.c
try ar rs ../tmp/libicrss.a *.o
rm *.o
cd ..

echo Creating tmp/${BINDIR}/icmake${EXTENSION}
try cd make
try gcc -Wall  ${CFLAGS} ${GLB} \
        -o ../tmp/${BINDIR}/icmake${EXTENSION} *.c ../tmp/libicrss.a \
        ${LDFLAGS}
cd ..

echo Creating tmp/${BINDIR}/icmun${EXTENSION}
try cd un
try gcc -Wall ${GLB}  ${CFLAGS} \
        -o ../tmp/${BINDIR}/icmun${EXTENSION} *.c ../tmp/libicrss.a \
        ${LDFLAGS}
cd ..  

echo Creating tmp/${LIBDIR}/icm-pp${EXTENSION}
try cd pp
try gcc -Wall ${GLB} ${CFLAGS} \
        -o ../tmp/${LIBDIR}/icm-pp${EXTENSION} *.c ../tmp/libicrss.a \
        ${LDFLAGS}
cd ..

echo Creating tmp/${LIBDIR}/icm-comp${EXTENSION}
try cd comp
try gcc -Wall ${GLB} ${CFLAGS} \
        -o ../tmp/${LIBDIR}/icm-comp${EXTENSION} *.c ../tmp/libicrss.a \
        ${LDFLAGS}
cd ..

echo Creating tmp/${LIBDIR}/icm-exec${EXTENSION}
try cd exec
try gcc -Wall ${CFLAGS} ${GLB} -c *.c 
for x in auks var virtual int list string stack opcodefun builtin
do
    try cd $x
    try gcc -Wall ${GLB} ${CFLAGS} -c *.c
    try cd ..
done
try gcc -o ../tmp/${LIBDIR}/icm-exec${EXTENSION} *.o \
            */*.o ../tmp/libicrss.a ${LDFLAGS}
rm *.o */*.o
cd ..

echo Copying icmbuild/icmstart from scripts to tmp
cp scripts/icmbuild.in scripts/icmstart.in tmp/

echo Copying the skeleton files in usr/share/icmake/
try cp -r usr/share/icmake/* tmp/${SKELDIR}

echo Copying the configuration files in etc/icmake/
try cp -r etc/icmake/* tmp/${CONFDIR}

echo Copying the man-pages from doc/
try cp doc/*.1 tmp/${MANDIR}/man1
try cp doc/*.7 tmp/${MANDIR}/man7

echo Copying additional documentation to doc/
try mkdir -p tmp/${DOCDIR}/
try cp changelog tmp/${DOCDIR}/

echo Copying additional documentation to doc-doc/
try cp -r examples doc/icmake.doc doc/icmake.ps doc/README.icmbuild tmp/${DOCDOCDIR}

echo Copying etc files to etc/
try cp -r etc  tmp/

echo Done.