]> rtime.felk.cvut.cz Git - omk.git/blob - tests/programs
Update wvtool
[omk.git] / tests / programs
1 #!/bin/bash
2
3 . ./wvtest.sh
4
5
6 WVSTART "Compile a single source C program"
7 cat > 'test.c' <<'EOF'
8 int main() { return 0; }
9 EOF
10 cat > 'Makefile.omk' <<'EOF' # OMK manual includes this file - do not modify it
11 bin_PROGRAMS = test
12 test_SOURCES = test.c
13 EOF
14 needs_valid_CC
15 WVPASS make V=1
16
17 WVSTART "Compile a multiple source C program"
18 cat > 'func.c' <<< "void func() { }"
19 cat > 'test.c' <<< "void func(); int main() { func(); return 0; }"
20 cat > 'Makefile.omk' <<'EOF'
21 bin_PROGRAMS = test
22 test_SOURCES = test.c func.c
23 EOF
24 needs_valid_CC
25 WVPASS make V=1
26
27 WVSTART "Two programs sharing a source"
28 cat > 'func.c' <<< "void func() { }"
29 cat > 'p1.c' <<< "void func(); int main() { func(); return 0; }"
30 cat > 'p2.c' <<< "void func(); int main() { func(); return 0; }"
31 cat > 'Makefile.omk' <<'EOF'
32 bin_PROGRAMS = p1 p2
33 p1_SOURCES = p1.c func.c
34 p2_SOURCES = p2.c func.c
35 EOF
36 needs_valid_CC
37 WVPASS make
38
39
40 WVSTART "Generated sources"
41 cat > 'Makefile.omk' <<'EOF'
42 bin_PROGRAMS = p
43 p_GEN_SOURCES = gen.c
44
45 gen.c:
46         echo "int main() { return 0; }" > $@
47 EOF
48 needs_valid_CC
49 WVPASS make
50
51 WVSTART "Compile a single source C program twice"
52 cat > 'test.c' <<'EOF'
53 int main() { return 0; }
54 EOF
55 cat > 'Makefile.omk' <<'EOF' # OMK manual includes this file - do not modify it
56 bin_PROGRAMS = test
57 test_SOURCES = test.c
58 EOF
59 needs_valid_CC
60 WVPASS make
61 touch test.c
62 WVPASS make