1
#!/usr/bin/icmake -qt/tmp/oxref
1
#!/usr/bin/icmake -qt/tmp/bisonc++
5
#include "icmake/setopt"
5
6
#include "icmake/run"
7
#include "icmake/getenv"
8
8
#include "icmake/special"
9
10
#include "icmake/clean"
10
11
#include "icmake/manpage"
11
#include "icmake/library"
12
#include "icmake/program"
13
12
#include "icmake/install"
14
#include "icmake/xref"
16
void main(int argc, list argv, list envp)
14
string g_cwd = chdir(""); // initial working directory
16
void main(int argc, list argv)
23
setLocations(); // from INSTALL.im
28
option = element(1, argv);
29
if (element(2, argv) == "strip")
32
23
if (option == "clean")
38
29
if (option == "install")
39
install(element(2, argv), 1);
41
if (option == "installprog")
42
install(element(2, argv), 0);
30
install(argv[2], argv[3]);
35
if (option == "sourceforge")
44
38
if (option == "man")
47
if (option == "sourceforge")
53
41
if (option == "library")
43
system("icmbuild library");
47
if (argv[2] == "strip")
56
50
if (option == "program")
52
system("icmbuild program " + strip);
56
if (option == "oxref")
58
system("icmbuild program " + strip);
59
run("oxref -fxs tmp/lib" LIBRARY ".a > " PROGRAM ".xref");
63
if (option == "scanner")
66
system("flexc++ lexer");
68
system("icmbuild program " + strip);
69
72
printf("Usage: build [-p] what\n"
70
73
"Where `what' is one of:\n"
71
" clean - clean up remnants of previous compilations\n"
72
" distclean - clean + fully remove tmp/\n"
73
" library - build oxref's library\n"
74
" man - build the man-page (requires Yodl)\n"
75
" program [strip] - build oxref (optionally strip the\n"
77
" install <base> - install the software in the locations "
79
" in the INSTALL.im file, optionally "
81
" installprog <base> - only install the program\n"
82
" sourceforge - create a new release.yo for sourceforge\n"
83
" xref [strip] - create oxref's cross-reference file\n"
84
" (when needed create an optionally stripped\n"
85
" executable first)\n"
74
" clean - clean up remnants of previous "
76
" distclean - clean + fully remove tmp/\n"
77
" library - build " PROGRAM "'s library\n"
78
" man - build the man-page (requires Yodl)\n"
79
" manual - build the manual (requires Yodl)\n"
80
" program [strip] - build " PROGRAM " (optionally strip the\n"
82
" oxref [strip] - same a `program', also builds xref file\n"
84
" install program [path] - install the program at `path'\n"
85
" (by default below `" PROGRAM "')\n"
86
" install man [base] - install the man pages below `base'\n"
87
" (by default below `" MAN "')\n"
88
" install std [base] - install standard docs below `base'\n"
89
" (by default below `" STD "')\n"
90
" sourceforge - prepare sourceforge's index update\n"
87
92
"If the environment variable DRYRUN is defined, no commands are\n"
88
93
"actually executed\n"