[comp.sys.atari.st] Help with Sozobon||

T6M-RIIT@FINTUVM.BITNET (01/16/90)

Hi everybody!

I'm trying to learn C with Sozobon. I already got my *first* program
written and I've been trying to compile it with no remarkable success.

1)  Tried cc:
        cc hello
    (why do the first programs always say hello?...)
    A comment returned: can't find library 'HELLO'
    No library found? Well, let's name one..
        cc hello libm
    - got the same line again.
    OK, I'll give up.

2)  Let's try the other way, do it piecewise.
        hcc hello.c
    goes fine. Got a nice assembly language file hello.s. But it sure
    could use some optimization:
        top hello.s
    Yap, the file sure looks prettier (and a whole lotta shorter). Now
    let's assemble it to hello.o.
        jas hello.s
    ...the program spits out words of warning:
        usage: as [-N] source [-o object]
    and dammit that's just what I gave 'im, ain't it? (except the spelling
    error - Joe's missing?)

3)  Well well, there is still the make utility (the doc of which I just
    can't understand and got no UNIX manual at hand). I cook up a file
    called MAKEFILE with
        hello.tos: hello.o
            cc -o hello.tos hello.o
    in it - copied straight from a USENET news article sometime in August.
    Wonder if there's any sense in this... well, type make.
    "No targets provided near line 2". I take the monitor and smash it on
    the wall and eat the ST and go hang myself.

Now what the *ell (this does not mean Bell - hee haw haw..) am I doing
wrong? I am running a shell, PCommand, with environment variables LIB=
d:\sozobon\lib and INCLUDE=d:\sozobon\include (these shouldn't even be
needed if I got it right) and search path set to d:\sozobon;d:\sozobon\bin.
(\ is of course backslash no matter what it looks like to you).

Is there some kind soul who could shed some light on my ignorance;
especially about make.


                                            Jari



----------------- this message was authored by --------------------------------
      Jari Riitala                  still:     t6m-riit@mammutti.utu.fi
                                    also:      jriitala@kontu.utu.fi
-------------------------------------------------------------------------------

powers@engles.enet.dec.com (Bill Powers) (01/17/90)

In article <1037T6M-RIIT@FINTUVM>, T6M-RIIT@FINTUVM.BITNET writes:
> 
> Now what the *ell (this does not mean Bell - hee haw haw..) am I doing
> wrong? I am running a shell, PCommand, with environment variables LIB=
> d:\sozobon\lib and INCLUDE=d:\sozobon\include (these shouldn't even be
> needed if I got it right) and search path set to d:\sozobon;d:\sozobon\bin.
> (\ is of course backslash no matter what it looks like to you).
> 
> Is there some kind soul who could shed some light on my ignorance;

     The shell pcommand capitalizes all command line arguments. It is
a Messy-Dross command.com act alike command shell.  I would assume that
sozobon is having problems with some of your switches because it is
looking for lowercase ones.  On the environment variables, try including
a last '\' (backslash) some programs won't automatically add one I don't 
use sozobon, so I don't know if this is happening. 

Hope this helps

Bill Powers
----
Digital Equipment Corp. - Advanced Service Delivery Systems - Stow MA
The opinions expressed above are my own, not my employers, so there.
TELEPHONE - (508) 496 - 8725
E-MAIL - powers@harpo.enet.dec.com
       - ...!decwrl!harpo!powers

steve@thelake.mn.org (Steve Yelvington) (01/17/90)

[In article <1037T6M-RIIT@FINTUVM>, T6M-RIIT@FINTUVM.BITNET writes:]

> I'm trying to learn C with Sozobon. I already got my *first* program
> written and I've been trying to compile it with no remarkable success.
> 
> 1)  Tried cc:
>         cc hello
>     (why do the first programs always say hello?...)
>     A comment returned: can't find library 'HELLO'
>     No library found? Well, let's name one..
>         cc hello libm
>     - got the same line again.
>     OK, I'll give up.

You gave up two keystrokes too quickly. Try "cc hello.c".

If cc sees a filename with no .ext, or with .a, or with .lib, it thinks
it's a library. You said "cc hello" and cc looked for a library named
hello. It didn't find one.

> 
> 2)  Let's try the other way, do it piecewise.
>         hcc hello.c
>     goes fine. Got a nice assembly language file hello.s. But it sure
>     could use some optimization:
>         top hello.s
>     Yap, the file sure looks prettier (and a whole lotta shorter). 

Yeach, the raw, unoptimized output from hcc looks pretty bizarre. :-)

> Now
>     let's assemble it to hello.o.
>         jas hello.s
>     ...the program spits out words of warning:
>         usage: as [-N] source [-o object]
>     and dammit that's just what I gave 'im, ain't it? (except the spelling
>     error - Joe's missing?)

This one has me stumped; I "jas source.s" all the time without any trouble.
If jas is getting a filename, it should assemble it.

As Bill Powers <powers@engles.enet.dec.com> pointed out, Pcommand may be
the culprit. It does some goofy things. Try gulam.
 
> 3)  Well well, there is still the make utility (the doc of which I just
>     can't understand and got no UNIX manual at hand). I cook up a file
>     called MAKEFILE with
>         hello.tos: hello.o
>             cc -o hello.tos hello.o
>     in it - copied straight from a USENET news article sometime in August.
>     Wonder if there's any sense in this... well, type make.
>     "No targets provided near line 2". I take the monitor and smash it on
>     the wall and eat the ST and go hang myself.

This, of course, is the primary purpose of make. By causing budding
programmers to smash monitors and hang themselves, the supply of
programmers is restricted, and salaries can be kept high.

Seriously, using make to maintain a program with fewer than half a dozen
source files is just a pain in the gazoo. Forget about make until you've
got C under control.

[In article <7503@shlump.nac.dec.com>,
     powers@engles.enet.dec.com (Bill Powers) writes ... ]
> On the environment variables, try including
> a last '\' (backslash) some programs won't automatically add one I don't 
> use sozobon, so I don't know if this is happening. 

Sozobon C expects that paths will NOT end in a backslash.

The source code for cc indicates these default search paths:

/*
 * Default paths for executables and libraries
 *
 * Always check the root of the current drive first.
 */
#define	DEFPATH		"\\bin,\\sozobon\\bin"
#define	DEFLIB		"\\lib,\\sozobon\\lib"
#define	DEFTMP		""

... so if the programs and libraries are on the current drive, you usually
don't have to define the environment variables. I often compile on D:
while the Sozobon directories are on C:, so I have set up:
PATH=.,\bin,c:\bin
INCLUDE=c:\sozobon\include
LIB=c:\sozobon\lib
-- 
   Steve Yelvington at the (thin ice today*) lake in Minnesota
   UUCP path: ... umn-cs.cs.umn.edu!thelake!steve
   
   *16 cars through the ice so far this year! Yes, you, too, can
    have that sinking feeling....