~ubuntu-branches/ubuntu/trusty/c++-annotations/trusty

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
#!/usr/bin/icmake -qt/tmp/cppannotations

#include "INSTALL.im"

#define ECHO_COMMANDS       1
#define COPT                "-Wall -O2 -g"
#define CPPOPT              "--std=c++0x -Wall -O2 -g"

string
    g_cwd;              // current WD

#include "icmake/run"
#include "icmake/clean"
#include "icmake/programs"
#include "icmake/man"
#include "icmake/docs"
#include "icmake/pre"
#include "icmake/install"
#include "icmake/distclean"
#include "icmake/zips"
#include "icmake/examples"

void main(int argc, list argv, list envp)
{
    string option;

    echo(ECHO_COMMANDS);

    option = element(1, argv);
    g_cwd = chdir(".");

    setLocations();     // from INSTALL.im

    if (option == "clean")
        clean(1);

    if (option == "examples")
        examples();

    if (option == "programs")
    {
        programs(0);
        programs(1);
        exit(0);
    }

    if (option == "distclean")
        distclean();

    if (option == "pre")
        pre();

    if (option == "docs")
        docs();

    if (option == "zips")
        zips();

    if (option == "man")
    {
        man();
        exit(0);
    }

    if (option == "install")
        install(0, element(2, argv));

    if (option == "cinstall")
        install(1, element(2, argv));

    printf("Usage: build what [x]\n"
        "Where `what' is one of:\n"
        "   clean           - clean up remnants of previous compilations\n"
        "   cinstall <base> - to install the C++ Annotations in the "
                                                                "locations\n"
        "                     defined in the INSTALL.im file, optionally\n"
        "                     below <base>\n"
        "   distclean       - clean remnants of locally run ./bin/ scripts\n"
        "   docs            - construct the C++ Annotations\n"
        "   examples        - compile all examples\n"
        "   install <base>  - to install the C++ Annotations in the "
                                                                "locations\n"
        "                     defined in the INSTALL.im file, optionally\n"
        "                     below <base>\n"
        "   man             - build the manual page (requires Yodl)\n"
        "   pre             - prepare files for independent `docs' call\n"
        "   programs        - build support programs\n"
        "   zips            - zip archives (after doc)\n"
        "\n"
    );
    exit(1);
}