perform can execute methods
[k8lst.git] / 0build.sh
blobe61e276164e1377a336785bbfba9812f9ee498bd
1 #!/bin/sh
2 CC="gcc -pipe"
3 OPT="-O2 -Wall"
4 DEFS="-DLST_COMPACT_WRITE_WORD -DLST_USE_SOCKET=1 -DLST_USE_FFI=1"
5 INCS="-Isrc/lstcore -I./src"
7 rm lst imgbuilder
8 rm -Rf ./_build
9 mkdir -p ./_build/lib
11 $CC -c -o ./_build/lst_imgio.o $OPT $DEFS $INCS src/lstcore/lst_imgio.c
12 $CC -c -o ./_build/lst_interp.o $OPT $DEFS $INCS src/lstcore/lst_interp.c
13 ar ru ./_build/lib/liblstcore.a ./_build/lst_imgio.o ./_build/lst_interp.o
14 ranlib ./_build/lib/liblstcore.a
15 rm -f ./_build/lst_imgio.o ./_build/lst_interp.o
16 $CC -c -o ./_build/lstpl_stdlib.o $OPT $DEFS -Isrc/primlib/stdlib -I./src src/primlib/stdlib/lstpl_stdlib.c
17 ar ru ./_build/lib/liblstpl_stdlib.a ./_build/lstpl_stdlib.o
18 ranlib ./_build/lib/liblstpl_stdlib.a
19 rm -f ./_build/lstpl_stdlib.o
20 $CC -c -o ./_build/lstpl_ffi.o $OPT $DEFS -Isrc/primlib/ffi -I./src src/primlib/ffi/lstpl_ffi.c
21 ar ru ./_build/lib/liblstpl_ffi.a ./_build/lstpl_ffi.o
22 ranlib ./_build/lib/liblstpl_ffi.a
23 rm -f ./_build/lstpl_ffi.o
24 $CC -c -o ./_build/lstpl_socket.o $OPT $DEFS -Isrc/primlib/socket -I./src src/primlib/socket/lstpl_socket.c
25 ar ru ./_build/lib/liblstpl_socket.a ./_build/lstpl_socket.o
26 ranlib ./_build/lib/liblstpl_socket.a
27 rm -f ./_build/lstpl_socket.o
29 $CC -c -o ./_build/hsregexp.o $OPT $DEFS -Isrc/primlib/relib -I./src src/primlib/relib/hsregexp.c
30 ar ru ./_build/lib/libhsrelib.a ./_build/hsregexp.o
31 ranlib ./_build/lib/libhsrelib.a
32 rm -f ./_build/hsregexp.o
34 $CC -c -o ./_build/trex.o $OPT $DEFS -Isrc/primlib/relib -I./src src/primlib/relib/trex.c
35 ar ru ./_build/lib/libtrex.a ./_build/trex.o
36 ranlib ./_build/lib/libtrex.a
37 rm -f ./_build/trex.o
39 $CC -c -o ./_build/lstpl_regexp.o $OPT $DEFS -Isrc/primlib/relib -I./src src/primlib/relib/lstpl_regexp.c
40 ar ru ./_build/lib/liblstpl_relib.a ./_build/lstpl_regexp.o
41 ranlib ./_build/lib/liblstpl_relib.a
42 rm -f ./_build/lstpl_regexp.o
45 $CC -c -o ./_build/main.o $OPT $DEFS -Isrc -I./src src/main.c
46 $CC -s -o lst ./_build/main.o ./_build/lib/liblstcore.a ./_build/lib/liblstpl_stdlib.a \
47 ./_build/lib/liblstpl_ffi.a ./_build/lib/liblstpl_socket.a \
48 ./_build/lib/liblstpl_relib.a ./_build/lib/libhsrelib.a ./_build/lib/libtrex.a \
49 -ldl
50 chmod 755 lst
51 $CC -c -o ./_build/imgbuild.o $OPT $DEFS -Isrc/builder -I./src src/builder/imgbuild.c
52 $CC -s -o imgbuilder ./_build/imgbuild.o
53 chmod 755 imgbuilder
55 ./imgbuilder