aboutsummaryrefslogtreecommitdiff
path: root/c++-libbu++/default.bld
blob: e6d1380dcb1694099bd6603e67bdd8f7df145796 (plain)
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
108
109
110

execute("mkdir -p tmp");

action "default"
{
    build: [targets("header-links"), "libgats.a", "gatsc"];
}

action "all"
{
    build: [targets("header-links"), "libgats.a", targets("headers"),
        targets()];
}

action "gatscon"
{
    build: [targets("header-links"), "libgats.a",
        targets("headers"), "gatscon"];
}

CXXFLAGS += "-ggdb -Wall";

target [files("src/*.h").replace("src/", "gats/"), "gats/version.h"]
{
    tag "header-links";
    display "symlink";
    input OUTPUT.replace("gats/","src/");
    profile "build"
    {
        execute("ln -s ../${INPUT} ${OUTPUT}");
    }
}

target "src/version.h"
{
    input ".svn";
    display "svnver";
    profile "build"
    {
        execute("echo Revision number:  `svnversion`; echo \\#ifndef LIBGATS_VC_ID > ${OUTPUT}; echo \\#define LIBGATS_VC_ID \\\"`svnversion`\\\" >> ${OUTPUT}; echo \\#endif >> ${OUTPUT}");
    }
}

target "libgats.a"
{
    rule "lib";
    input files("src/*.cpp");
    CXXFLAGS += "-I. -Ilibbu++ -fPIC";
}

target "gatsc"
{
    rule "exe";
    input files("src/gatsc/*.cpp");
    requires "libgats.a";
    CXXFLAGS += "-I. -Ilibbu++";
    LDFLAGS += "-L. -lgats -lbu++";
}

target files("src/tests/*.cpp").replace("src/","").replace(".cpp","")
{
    input "src/${OUTPUT}.cpp";
    rule "exe";
    tag ["tests", "general tests"];
    CXXFLAGS += "-I. -Ilibbu++";
    LDFLAGS += "-L. -lgats -Llibbu++ -lbu++";
}

target files("src/unit/*.unit").replace("src/","").replace(".unit","")
{
    input "src/${OUTPUT}.unit";
    rule "exe";
    requires "libbu++.a";
    tag ["tests", "unit tests"];
    CXXFLAGS += "-I.";
    LDFLAGS += "-L. -lgats -lbu++";
}

rule "unit"
{
    input "*.unit";
    output INPUT.replace(".unit", ".cpp");

    profile "build"
    {
        execute("../libbu++/mkunit \"${INPUT}\" \"${OUTPUT}\"");
    }
}

include "qt4.bld";

QTDIR = "/opt/qt-4";
MOC_DIR = "tmp";
RCC_DIR = "tmp";
UI_DIR = "tmp";

target "gatscon"
{
    input files("src/gatscon/*.h", "src/gatscon/*.cpp", "src/gatscon/*.ui");
    rule "exe";

    CXXFLAGS += qt_getCXXFLAGS();
    LDFLAGS += qt_getLDFLAGS();

    CXXFLAGS += "-Isrc/gatscon";
    
    CXXFLAGS += "-I. -Ilibbu++ -Itmp -Ilibzamui/src";
    LDFLAGS += "-L. -lgats -Llibbu++ -lbu++ -Llibzamui -lzamui";
}