[EMAIL PROTECTED] schrieb:
> Just installed Plan 9 from a plan9.iso CD image.  However, once
> installed tried running cc but that did not result in it being found
> (nor 8c etc).  Tried google'ing and looking at the Plan 9 site but
> have come up dry.  This seems to easy, so I'm sure I'm missing
> something obvious.  Please help.  If there are any links to a download
> that'll be necessary please provide, thanks.
>
>
>
>   
Dear qwertyp9q,
I was heavily beaten as I ascertained some lack of documentation for
starters with plan9. (Write code - not mails! Plan 9 is for programmers
only. Load it down and you have the whole bunch......etc.) But Michael
A. Covington (Univ. of Georgia) sent me a link to his "A plan 9 Newbie's
Guide" (many thanks to him). Follow this link
http://plan9.escet.urjc.es/newbie-guide.pdf. There is an example on page 14:

The names of the compiler and linker are dependent on the CPU
architecture. For the 386 they are 8c and 8l (a lower case L!). In his
example it goes like this:
~> 8c myprog.c
~> 8l -o myprog myprog.8
~> myprog
............
As he points out, you do not have to write ./myprog, because in Plan 9
the current directory is in the path by default.

One might make a file mk, here for instance for a sparc machine:
#mk_easy: the easy mkfile
myprog.k:  myprog.c myprog.h
    kc myprog.c
myprog: myprog.k
    kl -o myprog myprog.k


A more sophisticated way for different architectures to support seems to
me a little batch mkfile roughly like this:

#mk_noarch: architecture independent mkfile
< /$objtype/mkfile
$=O.myprog: myprog.$O
    $LD $CFLAGS -o $O.myprog myprog.$O
myprog.$O: myprog.c myprog.h
    $CC myprog.c

mk reads environmetal variables as macros and with the < that will be
added in a mkfile. The varable objtype will be set to cputype as plan 9
starts. One may change this easily to compile to another architecture.
$O is a variable that will be initialized in /$objtype/mkfile. You may
check the settings by
~> cat /$objtype/mkfile
....... here a list of will follow
The variable CPUS will show the supported architectures.
With this variable will be set the architecture dependencys
automatically. A compilation for a sparc machine than goes like that:
~> mk -f mk_noarch
kc myprog.c
kl  -o k.myprog myprog.k

To compile this to another architecture one has to set objtype to the
name of the architecture. For instance for a mips machine:
~> objtype=mips mk -f mk_noarch
vc myprog.c
vl  -o v.myprog myprog.v


Hope that helps for a good start! And have fun with the machine!

BB





Reply via email to