Under Unix, the make facility is the best method for compiling and linking. Shown below is a simple Makefile that builds the example executable included with the Muon Analysis DST library for DASH. See the Unix man page on make for more information; also  is a good general reference.
# Makefile for "example"- example program using MAD and DASH MADDIR = /macro/users/kearns/mad DASHDIR = /macro/users/kearns/dash CERNDIR = /sgibin/cernlib/cern/pro/lib FFLAGS = -g -O0 -static LOADLIBES = -L$(MADDIR) -lmad \ -L$(DASHDIR) -ldash \ -L$(CERNDIR) -lpacklib -lkernlib FOBJS = example.f example: $(FOBJS) $(FC) -g -o example $(FOBJS) $(LOADLIBES)
Under VMS, the linking can be handled by the DASHLINK command, which is created as a symbol if you execute DASH_SETUP.COM in the DASH directory. Alternatively, you may create your own com-file to handle linking. If you do use DASHLINK, you provide an options file that lists all the code (modules, private libraries) you wish to link in (as explained in section 4.1. The rather trivial options file for the example program consists of:
DASHLINK.COM takes two arguments. The first is the name of the executable to create and the second is the options file:
$ LOCDIR = F$PARSE(``''P1''',,,''DEVICE'')+F$PARSE(``''P1''',,,''DIRECTORY'') $ LINK/DEB/EXE='P1' - 'LOCDIR''P2'/OPT, - DASH$LIBRARY:DASHLIB/L,CERN_ROOT:[LIB]PACKLIB/L,KERNLIB/L