File: build

package info (click to toggle)
c%2B%2B-annotations 13.02.01-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,580 kB
  • sloc: cpp: 25,297; makefile: 1,520; ansic: 165; sh: 126; perl: 90; fortran: 27
file content (165 lines) | stat: -rwxr-xr-x 4,221 bytes parent folder | download
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
#!/usr/bin/icmake -t.

// /tmp/cppannotations

#define LOGENV "CPPANNOT"       

#include "VERSION"
#include "INSTALL.im"
#include "compilers.im"

list    g_log;
string  
    g_logPath = getenv(LOGENV)[1],
    g_logMark,          // unique-marker for g_log entries
    g_cwd = chdir(".");         // current WD, including trailing /

int g_echo = ON;
int g_installing;       // set to 1 by install.
int g_lognr;            // unique-marker number counter for g_log entries


#include "icmake/cuteoln"
#include "icmake/backtick"

#include "icmake/run"
#include "icmake/mark"
#include "icmake/md"

#include "icmake/md5sum"
#include "icmake/log"
#include "icmake/logzipr"
#include "icmake/logzip"

#include "icmake/writelog"
#include "icmake/findall"
#include "icmake/loglink"
#include "icmake/loginstall"

#include "icmake/clean"
#include "icmake/programs"
#include "icmake/man"
#include "icmake/docs"
#include "icmake/latex"
#include "icmake/pre"
#include "icmake/install"
#include "icmake/distclean"
#include "icmake/zips"
#include "icmake/examples"
#include "icmake/verify"
#include "icmake/gitlab"

#include "icmake/readlog"
#include "icmake/remove"
#include "icmake/removedir"
#include "icmake/uninstall"

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

    if (argv[1] == "-q")
    {
        g_echo = OFF;
        argv -= (list)"-q";
    }

    echo(g_echo);

    option = argv[1];

    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();

    putenv("FORCE_SOURCE_DATE=1");  // to ensure reproducible builds
    putenv("SOURCE_DATE_EPOCH=0");  // for LaTeX documents

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

    if (option == "html")
        runhtml();

    if (option == "latex")
        latex();

    if (option == "ps")
        runps();

    if (option == "txt")
        runtxt();

    if (option == "verify")
        verify();

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

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

    if (option == "gitlab")
        gitlab();

    if (option == "uninstall")
        uninstall();

    if (option == "install")
        install(argv[2]);


    printf("Usage: build [-q] what\n"
        "Where\n"
        "   [-q]:   run quietly, do not show executed commands\n"
        "`what' is one of:\n"
        "   clean           - clean up remnants of previous compilations\n"
        "   distclean       - clean remnants of locally run ./bin/ scripts\n"
        "\n"
        "   docs            - construct the C++ Annotations\n"
        "                     Run 'build programs' and 'build pre' at least\n"
        "                     once before 'build docs'\n"
        "\n"
        "   examples        - compile all examples\n"
        "   install [base]  - install the C++ Annotations in the locations\n"
        "                     defined in the INSTALL.im file, optionally\n"
        "                     below 'base'\n"
        "   html            - force the html construction\n"
        "   latex           - force the latex construction, (cf 'verify')\n"
        "   man             - build the manual page (requires Yodl)\n"
        "   pre             - prepare files for independent `docs' call\n"
        "   ps              - create .ps/.pdf files afer 'build latex'\n"
        "   programs        - build support programs\n"
        "   txt             - force the txt construction\n"
        "   verify          - run after `build docs' to find overfull boxes\n"
        "                     or undefined references in\n"
        "                     tmp/docs/latex/cplusplus.log\n"
        "   zips            - zip archives (after doc)\n"
        "   uninstall       - remove installed files and empty directories\n"
        "   gitlab          - prepare gitlab's gh-pages / zips update\n"
        "                     (internal use only. The update script also\n"
        "                      installs the zips at git/annotations-zip)\n"
        "\n"
    );
    exit(1);
}