So, no "big" problems, just dunno how to compile it ;)
Here it goes, just follow how it was done...
[henkka@kotkapoika testit]$ ls -l total 2 -rwxrw-r-- 1 henkka henkka 61 heinä 4 21:50 compileIt -rw-rw-r-- 1 henkka henkka 68 heinä 4 21:47 test.c [henkka@kotkapoika testit]$ more compileIt g++ -c -O2 -fno-strength-reduce -o $1.o $1.c g++ -o $1 $1.o [henkka@kotkapoika testit]$ more test.c #includevoid main(void) { cout << "Hello World! \n"; } [henkka@kotkapoika testit]$ ./compileIt test [henkka@kotkapoika testit]$ ls -l total 10 -rwxrw-r-- 1 henkka henkka 61 heinä 4 21:50 compileIt -rwxrwxr-x 1 henkka henkka 6083 heinä 4 21:51 test -rw-rw-r-- 1 henkka henkka 68 heinä 4 21:47 test.c -rw-rw-r-- 1 henkka henkka 1192 heinä 4 21:51 test.o [henkka@kotkapoika testit]$ [henkka@kotkapoika testit]$ ./test Hello World! [henkka@kotkapoika testit]$
g++ -c -O2 -fno-strength-reduce -o $1.o $1.c
g++ -o $1 $1.o
Then we need to enable "eXecute"-bit:
chmod u+x compileIt
Then we create the source-file, here it was test.c with lines
#include
Then we just compile it:
./compileIt test
Notice that we just pass filename before the dot, not
after ! (So "test" is actually "test.c"...)
After that we should have actual "test" - executable, and we can run
that...
And here is more compicated example of "compileIt"-batchfile:
g++ -c -I/usr/lib/glib/include -O2 -fno-strength-reduce -o $1.o $1.c
g++ -L/usr/X11R6/lib -o $1 $1.o -lX11
So there was couple of include & library directories in it also.
Henry Palonen, 1999