File: clean

package info (click to toggle)
xd 3.11.0-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 304 kB
  • ctags: 102
  • sloc: cpp: 703; makefile: 139
file content (47 lines) | stat: -rw-r--r-- 738 bytes parent folder | download | duplicates (2)
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
string remove1;
string remove2;
string remove3;

void setRemovals()
{
    // always:
        remove1 = 
            "debian/*substvars* debian/xd build-stamp configure-stamp";

    // unless `minimal':
        remove2 = "tmp o */o release.yo libxd.a ";

    // in ./documentation:
        remove3 = "man/*.1 man/*.html";
}

void clean(int dist)
{
    setRemovals();

    run("rm -rf " + remove1);

    if (!dist && my_getenv("BISONCPP") == "minimal")
    {
        printf("\n"
            "WARNING: PERFORMED MINIMAL CLEANUP\n");
        exit(0);
    }

    run("rm -rf " + remove2);

    chdir("documentation");
    run("rm -rf " + remove3);

    if (dist)
    {
        chdir("..");
        run("rm -rf tmp");
    }

    exit(0);
}