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
|
#!/usr/bin/icmake -qt/tmp/bisonc++
#include "icmconf"
#include "icmake/setopt"
#include "icmake/run"
#include "icmake/md"
#include "icmake/special"
#include "icmake/clean"
#include "icmake/manpage"
#include "icmake/install"
string g_cwd = chdir(""); // initial working directory
void main(int argc, list argv)
{
string option;
string strip;
option = argv[1];
if (option == "clean")
clean(0);
if (option == "distclean")
clean(1);
if (option == "install")
install(argv[2], argv[3]);
if (option != "")
special();
if (option == "sourceforge")
exit(0);
if (option == "man")
manpage();
if (option == "library")
{
system("icmbuild library");
exit(0);
}
if (argv[2] == "strip")
strip = "strip";
if (option == "program")
{
system("icmbuild program " + strip);
exit(0);
}
if (option == "oxref")
{
system("icmbuild program " + strip);
run("oxref -fxs tmp/lib" LIBRARY ".a > " PROGRAM ".xref");
exit(0);
}
printf("Usage: build [-p] what\n"
"Where `what' is one of:\n"
" clean - clean up remnants of previous "
"compilations\n"
" distclean - clean + fully remove tmp/\n"
" library - build " PROGRAM "'s library\n"
" man - build the man-page (requires Yodl)\n"
" program [strip] - build " PROGRAM " (optionally strip the\n"
" executable)\n"
" oxref [strip] - same a `program', also builds xref file\n"
" using oxref\n"
" install program [path] - install the program at `path'\n"
" (by default below `" BINARY "')\n"
" install man [base] - install the man pages below `base'\n"
" (by default below `" MAN "')\n"
" install std [base] - install standard docs below `base'\n"
" (by default below `" STD "')\n"
" sourceforge - prepare sourceforge's index update\n"
"\n"
"If the environment variable DRYRUN is defined, no commands are\n"
"actually executed\n"
"\n"
);
exit(1);
}
|