[comp.sys.apollo] send me a Makefile for fortran source on DN10000

jlhaferman@l_cae02.icaen.uiowa.edu (Jeff Haferman) (06/04/91)

Could someone send me a makefile to compile and link F77
source code on a DN10000?  I simply would like to use
it as a template for my own makefile.  I would like the
makefile to produce object files with the highest level
of optimization.

Thanks a lot.



Jeff Haferman                            internet: jlhaferman@icaen.uiowa.edu
Department of Mechanical Engineering     DoD 0186  BMWMOA 44469  AMA 460140
University of Iowa
Iowa City IA  52242                                  '76 R90S

system@alchemy.chem.utoronto.ca (System Admin (Mike Peterson)) (06/04/91)

In article <6325@ns-mx.uiowa.edu> jlhaferman@l_cae02.icaen.uiowa.edu (Jeff Haferman) writes:
>Could someone send me a makefile to compile and link F77
>source code on a DN10000?

I will giving a talk on UNIX "Dot" files at ADUS in San Diego (if the
powers that be approve it), which will cover this, C/Bourne/Korn shell
startup files, X/Motif startup files, and booting a node to use X
Windows. It will be similar to last years talk on the same topic, and
includes complete listings of all our startup files (which are also
in the ADUS library).

Every new account on our system gets the following "Makefile", and
the environment variable "FLOAT" is set to:

   setenv FLOAT '-A cpu,a88k'			DN10000
   setenv FLOAT '-A cpu,fpa1 -W0,-frnd'		DN4500/fpa
   setenv FLOAT '-A cpu,3000 -W0,-frnd'		everything else

#
# Makefile file - used for C and/or Fortran compilations.
# Version: 1991/02/15.
#
# This Makefile expects an environment variable $FLOAT, which should
# be set in your ~/.cshrc or ~/.profile file to the appropriate string
# to activate any desired floating point options that need to be passed
# to the compilers. On the Apollo, the valid possibilities are:
#	$FLOAT = '-A cpu,3000'	- compile for any 680x0-based node.
#	$FLOAT = '-A cpu,fpa1'	- compile for a 680x0+fpa node.
#	$FLOAT = '-A cpu,a88k'	- compile for any PRISM-based node.
# You may want to incorporate the above option into any user-written
# Makefiles (via CFLAGS/FFLAGS below) to take maximum advantage
# of the system you use.
#
# Expected naming conventions:
# *.a - archive files.
# *.c - C source files.
# *.e - Efl source files.
# *.f - Fortran source files.
# *.h - Header (include) source files.
# *.l - Lex source files.
# *.o - object files.
# *.r - Ratfor source files.
# *.s - Assembler source files.
# *.y - Yacc-C source files.
# *   - executable files (no suffix).
#
# Set desired default options here:
# $(CFLAGS): C compilation options.
# $(FFLAGS): Fortran compilation options.
# $(PFLAGS): Pascal compilation options.
# $(LFLAGS): Lex options.
# $(MFLAGS): Command line options.
# $(YFLAGS): Yacc options.
# $(LDFLAGS): Loader options.
#
# Activate the following for debugging of your code (add -C to the
# FFLAGS for subscript checking at execution time):
#
CFLAGS = -g $$FLOAT
FFLAGS = -g $$FLOAT
#
# Activate the following for optimization of your code (make sure
# your code works properly with no optimization first):
#
#CFLAGS = -O $$FLOAT
#FFLAGS = -O $$FLOAT
#
# Activate the following for super-optimization of your code (make sure
# your code works properly with no optimization first, and don't use
# this for code to be put into libraries since the compiler will in-line
# your subroutines):
#
#CFLAGS = -W0,'-opt,4' $$FLOAT
#FFLAGS = -W0,'-opt 4' $$FLOAT
#
# You can set ld flags here, or add to the list of libraries.
#
LDFLAGS =
#
# Activate the following line if you have personal libraries, and have
# defined the environment variable $LIBDIR to point to the directory
# that contains them (e.g. "~/lib"). Put your libraries at the end
# in the form '-lname':
#
#LDFLAGS = -L$$LIBDIR
#
# Default action: do nothing.
#
nothing:
	@echo "No make target specified - nothing made."
	@echo "Usage: make foo"
	@echo "or     make 'CFLAGS=... %%FLOAT' foo"
	@echo "or     make 'FFLAGS=... %%FLOAT' foo"
	@echo "where the '%' are replaced by '$$'."
#
# Clean *.o and core files from the current directory.
# Usage: make clean.
#
clean:
	-rm -f *.o core


Note that as of SR10.3 the Apollo-supplied '/usr/lib/make/local',
which  is  a  link  to '/usr/lib/make/standard', has switched the
usual UNIX "FFLAGS"  to  "F77FLAGS"  and  put  some  Aegis  'ftn'
options  into  "FFLAGS". This causes many UNIX Makefiles to fail,
and is not compatible with the SR10.2 (and before) behaviour.  To
fix  this,  we  change all the rules involving "F77" so that both
"FFLAGS" and "F77FLAGS" are used, and remove the Aegis definition
in "FFLAGS" (since we don't use Aegis, this affects no one).

  1 # U/Toronto Chemistry default make rules, version 1991/02/15.
  2 # Modified from HP/Apollo standard make rules.
  3 #
  4 # @(#)standard      1.3 - 90/01/19
  5 #
  6 # DO NOT EDIT THIS FILE, which is /usr/lib/make/standard
  7 # These are the default make rules (we support no others)
  8 # If /usr/lib/make/local is still a link to standard,
  9 # change 'local' to a copy and edit 'local' instead of 'standard'.
 10 #
    .
    .
    .
 33 F77=f77
 34 F77FLAGS=
 35 FFLAGS=
 36 FTN=ftn
    .
    .
    .
189 #
190 # Rules for fortran 77 compiler.
191 #
192 .f .r .F:
193     $(F77) $(FFLAGS) $(F77FLAGS) $< -o $@ $(LDFLAGS)
194     -$(RM) -f $*.o
195 .f.o .r.o .F.o:
196     $(F77) $(FFLAGS) $(F77FLAGS) $(RFLAGS) -c $<
197 .f.a .r.a .F.a:
198     $(F77) $(FFLAGS) $(F77FLAGS) -c $<
199     $(AR) $(ARFLAGS) $@ $*.o
200     -$(RM) -f $*.o
201 .f~:
202     $(GET) $(GFLAGS) $<
203     $(F77) $(FFLAGS) $(F77FLAGS) $*.f -o $* $(LDFLAGS)
204     -$(RM) -f $*.f
205 .r~:
206     $(GET) $(GFLAGS) $<
207     $(F77) $(FFLAGS) $(F77FLAGS) $*.r -o $* $(LDFLAGS)
208     -$(RM) -f $*.r
209 .F~:
210     $(GET) $(GFLAGS) $<
211     $(F77) $(FFLAGS) $(F77FLAGS) $*.F -o $* $(LDFLAGS)
212     -$(RM) -f $*.F
213 .f~.o:
214     $(GET) $(GFLAGS) $<
215     $(F77) $(FFLAGS) $(F77FLAGS) -c $*.f
216     -$(RM) -f $*.f
217 .r~.o:
218     $(GET) $(GFLAGS) $<
219     $(F77) $(FFLAGS) $(F77FLAGS) -c $*.r
220     -$(RM) -f $*.r
221 .F~.o:
222     $(GET) $(GFLAGS) $<
223     $(F77) $(FFLAGS) $(F77FLAGS) -c $*.F
224     -$(RM) -f $*.F
225 .f~.a:
226     $(GET) $(GFLAGS) $<
227     $(F77) $(FFLAGS) $(F77FLAGS) -c $*.f
228     $(AR) $(ARFLAGS) $@ $*.o
229     -$(RM) -f $*.[fo]
230 .r~.a:
231     $(GET) $(GFLAGS) $<
232     $(F77) $(FFLAGS) $(F77FLAGS) -c $*.r
233     $(AR) $(ARFLAGS) $@ $*.o
234     -$(RM) -f $*.[ro]
235 .F~.a:
236     $(GET) $(GFLAGS) $<
237     $(F77) $(FFLAGS) $(F77FLAGS) -c $*.F
238     $(AR) $(ARFLAGS) $@ $*.o
239     -$(RM) -f $*.[Fo]
    .
    .
    .
-- 
Mike Peterson, System Administrator, U/Toronto Department of Chemistry
E-mail: system@alchemy.chem.utoronto.ca
Tel: (416) 978-7094                  Fax: (416) 978-8775