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
|
#!/usr/bin/icmake -qt/tmp/bisonc++
#include "INSTALL.im"
#define ECHO_COMMANDS 1
#define COPT "-Itmp -Wall -O3"
#define PROJECT "BOBCAT"
#define DESTINATION "tmp"
#define LIBRARY "bobcat"
string
g_compiler, // actual compiler to use
g_cwd, // current WD
g_file, // used to store the name of a file from a list
g_copt, // compiler options
g_sources, // sources to be used
g_version, // The library's version from the file VERSION
g_tmplib, // Library compilation target
g_tmphdr, // Class header target
g_tmpbin, // Binary target
g_lcgen, // bobcat lcgen program name
g_lcgendefault, // default max size of the bobcat/lc structs
g_sharedLibReq; // libraries required by the shared lib
int
g_nClasses; // number of classes/subdirectories
list
g_classes; // list of classes/directories, listed in CLASSES
#include "icmake/run"
#include "icmake/getenv"
#include "icmake/clean"
#include "icmake/addclasses""
#include "icmake/special"
#include "icmake/man"
#include "icmake/library"
#include "icmake/libraries"
#include "icmake/bobcatlcgen"
#include "icmake/install"
void main(int argc, list argv, list envp)
{
string option;
string all;
string strip;
echo(ECHO_COMMANDS);
g_env = envp;
g_cwd = chdir(".");
g_tmplib = DESTINATION "/lib/";
g_tmphdr = DESTINATION "/" LIBRARY "/";
g_tmpbin = DESTINATION "/bin/";
g_lcgen = "bobcatlcgen";
g_lcgendefault = " 10 "; // KEEP THE BLANKS
setLocations(); // from INSTALL.im
getenvSF("DRYRUN");
g_dryrun = g_envvar;
option = element(1, argv);
if (option == "lcgen")
bobcatlcgen();
if (option == "clean")
clean();
if (option == "libraries")
{
all = element(2, argv);
if (all == "all")
strip = element(3, argv);
else
strip = all;
libraries("bobcat", all == "all", strip == "strip");
}
if (option == "man")
man();
if (option == "sourceforge")
{
special(0, 0);
exit(0);
}
if (option == "install")
install(element(2, argv), element(3, argv));
printf("Usage: build what\n"
"Where `what' is one of:\n"
" lcgen - build the bobcatlcgen program\n"
" clean - clean up remnants of previous compilations\n"
" install <rss dev> - to install the software in the locations\n"
" defined in the INSTALL.im file,\n"
" optionally below <rss> (run-time package)\n"
" and <dev> (development package)\n"
" By default all is installed. To configure\n"
" Unset #defines in INSTALL.im\n"
" man - build the manual page (requires Yodl)\n"
" libraries [all] [strip] - build the bobcat(-dev) libraries\n"
" (optionally add optional classes,\n"
" optionally strip the libraries)\n"
" sourceforge - preliminaries required for SourceForge\n"
"\n"
"If the environment variable DRYRUN is defined, no commands are\n"
"actually executed\n"
);
exit(1);
}
|