April 25, 2024, 09:15:12 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


ebmake v1.0.1

Started by ExMember001, June 02, 2007, 07:38:25 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ExMember001

June 02, 2007, 07:38:25 PM Last Edit: June 02, 2007, 10:30:18 PM by KrYpT
ebmake is a little tool made to compile and link an Ebasic Linux source file under Linux
just copy the file in the folder where your .eba file is and execute under terminal :

./ebmake


here's the source code:

$main
DEF filename as string
DEF filen as string
DEF goforit as CHAR
DEF startpath as string
startpath = getstartpath()

INPUT "Enter the filename to compile and link:  ",filename
filen = LEFT$(filename,len(filename)-4)
INPUT "Compile (Y/N)? ",goforit
IF (goforit = ASC("Y")) | (goforit = ASC("y"))
  gosub compile()
  INPUT "Create executable (Y/N)? ",goforit
  IF (goforit = ASC("Y")) | (goforit = ASC("y"))
    gosub link()
  ENDIF
ENDIF

system("nautilus", startpath)
END

sub compile()
def cmd as string
cmd = startpath + filename + " " + startpath + filen + ".o"
print "Compiling..."
system("ebparse", cmd)
endsub

sub link()
def cmd as string
cmd = "-lc -lgtk-x11-2.0 -o \"" + filen + "\" \"" + filen +".o\" " + "/usr/lib/libebasic.a --dynamic-linker /lib/ld-linux.so.2"
print "linking..."
system("ld", cmd)
endsub


a compiled version is attached.

ExMember001


Doc

works great!  :D

Thanks!

Rock Ridge Farm (Larry)

When I try to compile the code I get the following:
ebparse compile.eba compile.o
File: compile.eba (7) Warning: undeclared function 'getstartpath'
File: compile.eba (7) invalid assignment
File: compile.eba (9) syntax error - "
What am I doing wrong?

ExMember001

its mean there's some problem with your getstartpath function ;)
show the code pls

Doc

...the code compiles and works fine here on this end.  :-\

-Doc-

Ionic Wind Support Team

More likely you have your linker command wrong.  Remember to include libebasic.a

Paul.
Ionic Wind Support Team

Rock Ridge Farm (Larry)

Krypt - it is you code posted above.
I think nasm is .missing but I can not get it to download and load.
This is Ubuntu 7.04 just loaded tonight on an HP laptop.
apt-get install nasm gives me an error about not existing.

ExMember001

try with the synaptic manager for nasm

Rock Ridge Farm (Larry)

After much ker-finger-poken - I got it to almost work.
Had to do a total refresh of all packages.
Now just trying to figure out where the ebstd.incc file is supposed to go.
It is not finding it.

Ionic Wind Support Team

ebstd.incc goes in \usr\bin

The instuctions for installing are located in the first post of "Preview version instructions"

http://www.ionicwind.com/forums/index.php/topic,1689.0.html
Ionic Wind Support Team

Rock Ridge Farm (Larry)

Yup - figured out where .incc went.
Now I get an error about -lgtkx11-2.0 not being found.
Have not been able to locate that package yet.
Everything is working fine on the previous release of Ubunto on another box.
Just wanted the laptop working so I can sit on the back porch.

Ionic Wind Support Team

Should be a dash in there.

-lgtk-x11-2.0

And you should make sure the libgtk2.0-0 package is installed
Ionic Wind Support Team

Rock Ridge Farm (Larry)

Package is installed - it just complains about the x11 lib.
I just typo'd the name in the post.

Rock Ridge Farm (Larry)

re-loaded everything and now it is all working - strange.