FreeUSP: Algorithm Implementation and Testing

Makefile Template


# gmake makefile for a usp program.
# Changes:
# 09/27/89	Terri Fischer
# 09/10/90	Terri Fischer	updated

# get the initialization files from .../etc
#
# if you are doing a debug compile be sure to use the debug gmake.init
#include ${DEPTROOT}/usp/etc/gmake.init.db

include ${DEPTROOT}/usp/etc/gmake.init
include ${DEPTROOT}/etc/gmake.mathadv

#  the libraray names (e.g. "ut") get translated into full path names
#  via the info in the initialization files above
#
# if you are doing a workshop debug session requiring memory mapping
# or access checking be sure to use -Bdynamic to use dynamic load libraries
#Libes		:= ${Libes} -lut ${MathAdvO} -lieeeio -lfu -Bdynamic

Libes		:= ${Libes} -lut ${MathAdvO} -lieeeio -lfu 

#
# Add an architecture library variable which may be set in one of the gmake
# rules files referenced above. Initialized with SOLARIS port.. - jmw 8/9/93
#
Libes		:=	${Libes} ${${TArchDir}Libes}

#  define compiler flags.  The default optimization levels are set in the
#  gmake rules files.  If you need to change them do so here.

CCFlags		:=	${CCFlags}

# -O for optimized , -g for use with a debugger such as prism or xdbx
# once debugged set to -O for distribution

FCFlags		:=	${FCFlags}

F77Srcs		:= prgm_trace.F subs_trace.F

SafeFiles	:= ${AllSrcs} Makefile

# the ${LocalBin} entry will cause the code to appear in ~usp/bin/sun4
# which is not too useful while debugging.  To defeat this don't insert
# the ${LocalBin} until you are ready for installation of your routine in
# usp.  i.e. when you compile from ~usp/src/cmd/name, where name is the 
# name of your routine
PRGM		:= ${LocalBin}/prgm
#PRGM		:= ./prgm

targets : ${PRGM}

all :  safe targets remotes install

${PRGM}    :  ${F77Objs}
	${LinkF} -o $@ ${F77Objs} ${Libes}

# if debugging with ddd or equivalent and wanting to do
# memory and access checking then uncomment this line
# and comment out the above line.  When you link with 
# electric fence the code will abort anytime you walk
# outside allocated memory.  If you run the code in the
# debugger it will stop on the line where the offense 
# exists
#	${LinkF} -o -lefence $@ ${F77Objs} ${Libes}

#  do remote make (i.e. in our case the cray, hp, convex, etc...)

remotes:	RemoteCopies RemoteMakes

install:
	mancopy 1 prgm
	execopy  prgm
	shadowexec -v execopy prgm

RemoteCopies:	${SafeFiles}
	shadowcopy -v $? && touch RemoteCopies

RemoteMakes:	${SafeFiles}
	shadowexec -v ${MAKE} && touch RemoteMakes

safe:	.safe.Z

.safe.Z:	${SafeFiles}
	${MakeSafe}

include ${TArchDir}/included.files

#  generate include files
#  date stamp source

${TArchDir}/included.files: ${AllSrcs}
	usp_d_stamp
	${FindIncludes}