Trying to compile a program
- From: Terry A Haimann <terry@xxxxxxxxxxxxxx>
- Date: Tue, 12 Dec 2006 14:47:05 GMT
I have some source code I would like to compile & run under linux. It is
mostly in c and fortran. I believe this program comes from the Unix world.
It has a compile script that I assume is recursive, but I don't know how
it works:
/************************************/
a= `echo `
n=`wcomp -c`
while (test -n $1) do
w=`wcomp $1`
if (test $w != $n) then
echo $w $a $1
$w -c -g $1
fi
shift
done
/***********************************/
The slash * I have added to show where it starts and ends. I assuming
that the "wcomp" I need to change to gcc, is that correct?
And the following I believe compiles the fortran:
/******************************************/
Program WCOMP
c--- Return name of compiler given source file name
Character SFILE*50,CCHAR*2
Integer*4 NARG,LSF
NARG = Iargc ()
LSF = -1
If (NARG .gt. 0) Then
Call Getarg (1,SFILE)
Do 10 I = 50, 1, -1
If (SFILE(I:I) .ne. ' ') Then
LSF = I
Go to 20
Endif
10 Continue
20 If (LSF .lt. 0) Then
Write(*,*) 'WCOMP: Not a source file: ',SFILE
Stop
Else
CCHAR = SFILE(LSF-1:LSF)
If (CCHAR .eq. '.f') Then
Write(*,*) 'f77'
Elseif (CCHAR .eq. '.c') Then
Write(*,*) 'cc'
Else
Write(*,*) 'none'
Endif
Endif
Endif
End
/***********************************************/
Is there anything in here I need to change?
.
- Follow-Ups:
- Re: Trying to compile a program
- From: Tommy Reynolds
- Re: Trying to compile a program
- Prev by Date: Re: Red Hat Linux 8 & NTFS Issues...
- Next by Date: Re: Red Hat Linux 8 & NTFS Issues...
- Previous by thread: Red Hat Linux 8 & NTFS Issues...
- Next by thread: Re: Trying to compile a program
- Index(es):
Relevant Pages
|