[comp.unix.shell] question about compiling

cshort@nmsu.edu (SpamG*D lord of potted meat products) (01/08/91)

hi. 

since my acount size is small, i would like to set up source
code in a /tmp then compile it into my dir. how would i do this?
also is the a make toggle that would delete the souce files
when it is done with them?

thanks

chris
cshort@nmsu.edu

quan@sol.surv.utas.oz (Stephen Quan) (01/08/91)

cshort@nmsu.edu (SpamG*D lord of potted meat products) writes:
>since my acount size is small, i would like to set up source
>code in a /tmp then compile it into my dir. how would i do this?
>also is the a make toggle that would delete the souce files
>when it is done with them?

You could make a symbolic link in /tmp to your directory.
eg. ln -s ~/myrunfile /tmp/myrunfile

That way, when you overwrite /tmp/myrunfile you are really
overwritting ~/myrunfile.

A cleaner solution would to get a large account size :).

oyang@bruce.cs.monash.OZ.AU (Kai Shing O'Yang) (01/08/91)

In <quan.663309881@sol> quan@sol.surv.utas.oz (Stephen Quan) writes:

>cshort@nmsu.edu (SpamG*D lord of potted meat products) writes:
>>since my acount size is small, i would like to set up source
>>code in a /tmp then compile it into my dir. how would i do this?
>>also is the a make toggle that would delete the souce files
>>when it is done with them?

>You could make a symbolic link in /tmp to your directory.
>eg. ln -s ~/myrunfile /tmp/myrunfile

>That way, when you overwrite /tmp/myrunfile you are really
>overwritting ~/myrunfile.

>A cleaner solution would to get a large account size :).

This is a dangerous practice. If your machine crashes, you may lose
your files because /tmp is the first place to clear.
If you insist on using /tmp, I would advise to name your directory as 
.mydir because this wouldn't be deleted by rm -*.
-- 
- Kai S O'Yang, Dept of Comp Sci, Monash Uni, Clayton VIC 3168, Australia  
- AARNET: oyang@bruce.cs.monash.edu.au         - Voice : +(61) 3 565 5778
- ARPA : oyang@bruce.cs.monash.edu.au@uunet.uu.net                       
------

rbr@bonnie.ATT.COM (4197,ATTT) (01/08/91)

In article <CSHORT.91Jan7152814@haywire.nmsu.edu> cshort@nmsu.edu (SpamG*D lord of potted meat products) writes:
>
>hi. 
>
>since my acount size is small, i would like to set up source
>code in a /tmp then compile it into my dir. how would i do this?
>also is the a make toggle that would delete the souce files
>when it is done with them?
>
>thanks
>
>chris
>cshort@nmsu.edu

I assume that the source code normally resides in a protected place and
will not get removed if you crash.  To put the output in your account:

	cc <compile opts> -o ~/<objdir>/<pgm-name>  <pgm_name>.c

The trick here is the "-o" option. I use "cc -O -s -o ~/bin/$PGM  $PGM.c" in
my compiles.

Bob Rager

rbr@bonnie.ATT.COM (4197,ATTT) (01/08/91)

In article <CSHORT.91Jan7152814@haywire.nmsu.edu> cshort@nmsu.edu (SpamG*D lord of potted meat products) writes:
>
>hi. 
>
>since my acount size is small, i would like to set up source
>code in a /tmp then compile it into my dir. how would i do this?
>also is the a make toggle that would delete the souce files
>when it is done with them?
>
>thanks
>
>chris
>cshort@nmsu.edu

Use the "-o" option as in:

	cc -O -s -o ~/bin/$PGM $PGM.c

which I use for simple C compilations.

Bob Rager