]> rtime.felk.cvut.cz Git - omk.git/blob - tests/libraries
Rework libraries and shlibs tests
[omk.git] / tests / libraries
1 #!/bin/bash
2
3 . ./wvtest.sh
4
5 WVSTART "Static library"
6 cat > 'funca.c' <<EOF
7 #include <mylib.h>
8 int funca(int a) {return a+1;}
9 EOF
10 cat > 'funcb.c' <<EOF
11 #include <mylib.h>
12 int funcb(int b) {return b*2;}
13 EOF
14 cat > 'mylib.h' <<EOF
15 int funca(int a);
16 int funcb(int b);
17 EOF
18 cat > 'test.c' <<EOF
19 #include <mylib.h>
20 int main() {
21   funca(10);
22   funcb(20);
23   return 0;
24 }
25 EOF
26 cat > 'Makefile.omk' <<EOF
27 lib_LIBRARIES = mylib
28 mylib_SOURCES = funca.c funcb.c
29 include_HEADERS = mylib.h
30
31 bin_PROGRAMS = test
32 test_SOURCES = test.c
33 test_LIBS = mylib
34 EOF
35 needs_valid_CC
36 WVPASS make
37 WVPASS test -f _compiled/lib/libmylib.a