2006-09-04 10:26:34 +02:00
|
|
|
#!/usr/bin/icmake -qt/tmp/cppannotations
|
|
|
|
|
|
|
|
#include "INSTALL.im"
|
|
|
|
|
|
|
|
#define ECHO_COMMANDS 1
|
|
|
|
#define COPT "-Wall -O2 -g"
|
2009-09-03 21:49:03 +02:00
|
|
|
#define CPPOPT "--std=c++0x -Wall -O2 -g"
|
2006-09-04 10:26:34 +02:00
|
|
|
|
|
|
|
string
|
|
|
|
g_cwd; // current WD
|
|
|
|
|
|
|
|
#include "icmake/run"
|
|
|
|
#include "icmake/clean"
|
|
|
|
#include "icmake/programs"
|
|
|
|
#include "icmake/man"
|
|
|
|
#include "icmake/docs"
|
|
|
|
#include "icmake/install"
|
2007-07-30 12:47:25 +02:00
|
|
|
#include "icmake/svnclean"
|
2006-09-04 10:26:34 +02:00
|
|
|
|
|
|
|
void main(int argc, list argv, list envp)
|
|
|
|
{
|
|
|
|
string option;
|
|
|
|
|
|
|
|
echo(ECHO_COMMANDS);
|
|
|
|
|
|
|
|
option = element(1, argv);
|
|
|
|
g_cwd = chdir(".");
|
|
|
|
|
|
|
|
setLocations(); // from INSTALL.im
|
|
|
|
|
|
|
|
if (option == "clean")
|
|
|
|
clean();
|
|
|
|
|
|
|
|
if (option == "programs")
|
|
|
|
{
|
|
|
|
programs();
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
2007-07-30 12:47:25 +02:00
|
|
|
if (option == "svnclean")
|
|
|
|
svnclean();
|
|
|
|
|
2006-09-04 10:26:34 +02:00
|
|
|
if (option == "docs")
|
|
|
|
docs();
|
|
|
|
|
|
|
|
if (option == "man")
|
|
|
|
{
|
|
|
|
man();
|
|
|
|
exit(0);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (option == "install")
|
2006-09-04 21:15:07 +02:00
|
|
|
install(0, element(2, argv));
|
|
|
|
|
|
|
|
if (option == "cinstall")
|
|
|
|
install(1, element(2, argv));
|
2006-09-04 10:26:34 +02:00
|
|
|
|
|
|
|
printf("Usage: build what\n"
|
|
|
|
"Where `what' is one of:\n"
|
|
|
|
" clean - clean up remnants of previous compilations\n"
|
2006-09-04 21:15:07 +02:00
|
|
|
" cinstall <base> - to install the C++ Annotations in the "
|
|
|
|
"locations\n"
|
|
|
|
" defined in the INSTALL.im file, optionally\n"
|
|
|
|
" below <base>\n"
|
2006-09-04 10:26:34 +02:00
|
|
|
" docs - construct the C++ Annotations\n"
|
2006-09-04 21:15:07 +02:00
|
|
|
" install <base> - to install the C++ Annotations in the "
|
|
|
|
"locations\n"
|
2006-09-04 10:26:34 +02:00
|
|
|
" defined in the INSTALL.im file, optionally\n"
|
|
|
|
" below <base>\n"
|
|
|
|
" man - build the manual page (requires Yodl)\n"
|
|
|
|
" programs - build support programs\n"
|
2007-07-30 12:47:25 +02:00
|
|
|
" svnclean - clean remnants of locally run ./bin/ scripts\n"
|
2006-09-04 10:26:34 +02:00
|
|
|
"\n"
|
|
|
|
);
|
|
|
|
exit(1);
|
|
|
|
}
|