% This is a template for a standard DSAP Makefile.
% You should edit it to keep the lines which pertain to what
% you want, and delete the rest, including all the lines beginning with %.

% Binary targets which can be "installed".
BIN=		# commands to be placed in bin
LIB=		# libraries to be placed in lib
DLIB=$(LIB:.a=$(DSUFFIX)) # uncomment when creating a dynamic library
DATADIR=	# directory under $(DSAP)/data in which to put $(DATA) files
DATA=		# data files to be placed in data/$(DATADIR)
INCLUDE=	# include files to be placed in include

% Man pages for the command or library -- EVERY 
% command, and every external routine in a library
% should have a man page.
MAN1=		# man pages for commands
MAN3=		# man pages for library routines
MAN5=		# man pages for file formats

CLEAN= 		# Extra files which should be removed during a "make clean"

% Extra non-standard options to be added to the corresponding
% uppercase options:
cflags=		# -g or -O is the most common option here and in fflags
fflags= 	# 
ldflags= 	# flags to linker/loader
ldlibs=		# libraries to link in.

include $(DSAPMAKE)  	# This line must appear following the definitions above, 
			# and before the DIRS definition below..
DIRS=			# Omit this line to run make in subdirectories, or
			# fill in to run make only in certain subdirectories

% In general, you must write the rule which builds your executable,
% library, or other target.  The suggestions below are adequate for most
% simple situations; you must fill in the OBJS macro, and substitute for
% target.  If you modify these examples more extensively, be sure to continue 
% to use the macros CC, FC, CFLAGS, FFLAGS, LDFLAGS, and LDLIBS.
%
% Special case: If your executable is constructed from a single
% source file with the same basename, you need not write any rule at all.
% Just fill in the appropriate macros above (BIN, LIB, MANn, cflags, fflags, ..)

% For a command with a c main routine, and multiple source files, 
% modify the following lines to suit:
OBJS=	# list all the object files which must be compiled and linked.
$(BIN) : $(OBJS)
	$(CC) $(CFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)

% For a command with a fortran main routine, and multiple source files, 
% modify the following lines to suit:
OBJS=	# list all the object files which must be compiled and linked.
$(BIN) : $(OBJS)
	$(FC) $(FFLAGS) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)

% For a static library:
OBJS=	# list all objects to put into the library
$(LIB) : $(OBJS)
	rm -f $@
	$(AR) $(ARFLAGS) $@ $(LORDER) $(OBJS) $(TSORT)
	$(RANLIB) $@

% For a dynamic library:
$(DLIB) : $(OBJS)
	$(DLD) $(DLDFLAGS) -o $(DLIB) $(LORDER) $(OBJS) $(TSORT)
