

#COML = f77 -s -c 
#LINK = f77
COML = gfortran -c 
LINK = gfortran 
CFL = 
CCFL = 
#for mingw
#PGFLAG = -Wl,--subsystem,console -mwindows
#for osX
#PGFLAG = -L/usr/lib -lgcc -L/usr/X11R6/lib -lX11
#for linux
PGFLAG =   /usr/X11R6/lib/libX11.6.dylib
# for sgi
#PGFLAG = -lX11

all: ampl anadat ananas ancos2 anlips ansmoo anspec anpoly\
     areg colin col42xml colrow cont detec\
     detd16 dirrun effdef  g2x g2xfull grund inillp1 inxmlp1 inxml2gin iqpsi mill mplot \
     monbug mpolly pchead pdqheads\
     pdqtitle pdqpg pdqpt polymer\
     postcard rcard rfit rguim \
     ralread rlist rmask\
     rnd16 rnd16s rnils rplot rreg rundex sasfit4 sasmpl\
     smorger snils splots spolly tbplot windet red16

#Note, for fl32, exe name is derived from first obj in input list by default...
#must use /link /OUT:name where not current case

#Note CASE SENSITIVE SWITCHES everywhere!
ampl: ampl.o $(LIBR) $(LIBP)
        $(LINK) -o ampl ampl.o $(LIBR) $(LIBP) $(PGFLAG)
ampl.o:
        $(COML) $(SRC)ampl.f
anadat: $(SRC)anadat.f
        $(LINK) -o anadat $(SRC)anadat.f
ananas: ananas.o inpd.o grundd.o $(LIBR) 
        $(LINK) -o ananas ananas.o inpd.o grundd.o $(LIBR)
ananas.o: $(SRC)ananas.f
        $(COML) $(SRC)ananas.f
ancos2: ancos2.o inpd.o grundd.o $(LIBR)
        $(LINK) -o ancos2 ancos2.o inpd.o grundd.o $(LIBR)
ancos2.o: $(SRC)ancos2.f
        $(COML) $(SRC)ancos2.f
anlips: anlips.o inpd.o grundd.o vc04a.o $(LIBR)
        $(LINK) -o anlips anlips.o inpd.o grundd.o vc04a.o $(LIBR) 
anlips.o: $(SRC)anlips.f
        $(COML) $(SRC)anlips.f
ansmoo: ansmoo.o $(LIBR)
        $(LINK) -o ansmoo ansmoo.o $(LIBR)
ansmoo.o: $(SRC)ansmoo.f 
        $(COML) $(SRC)ansmoo.f 
anpoly: anpoly.o inpd.o grundd.o  $(LIBR) 
        $(LINK) -o anpoly anpoly.o inpd.o grundd.o  $(LIBR) 
anpoly.o: $(SRC)anpoly.f 
        $(COML) $(SRC)anpoly.f 
anspec: anspec.o $(LIBR) $(LIBP) 
        $(LINK) -o anspec anspec.o $(LIBR) $(LIBP) $(PGFLAG)
anspec.o: $(SRC)anspec.f 
        $(COML) $(SRC)anspec.f 
areg: areg.o inpd.o grundd.o  $(LIBR) 
        $(LINK) -o areg areg.o inpd.o grundd.o  $(LIBR)
areg.o: $(SRC)areg.f
        $(COML) $(SRC)areg.f
colin: colin.o $(LIBR)
        $(LINK) -o colin colin.o $(LIBR)
colin.o: $(SRC)colin.f 
        $(COML) $(SRC)colin.f 
col42xml: col42xml.o $(LIBR)
        $(LINK) -o col42xml col42xml.o $(LIBR)
col42xml.o: $(SRC)col42xml.f 
        $(COML) $(SRC)col42xml.f 
colrow: colrow.o $(LIBR) $(LIBP)
        $(LINK) -o colrow colrow.o $(LIBR) $(LIBP) $(PGFLAG)
colrow.o: $(SRC)colrow.f 
        $(COML) $(SRC)colrow.f 
cont: cont.o $(LIBR) $(LIBP)
        $(LINK) -o cont cont.o $(LIBR) $(LIBP) $(PGFLAG)
cont.o: $(SRC)cont.f
        $(COML) $(SRC)cont.f
detec: detec.o setprp.o $(LIBR)
        $(LINK) -o detec detec.o setprp.o $(LIBR)
detec.o: $(SRC)detec.f
        $(COML) $(SRC)detec.f
dirrun: $(SRC)dirrun.f
        $(LINK) -o dirrun $(SRC)dirrun.f
setprp.o: $(SRC)setprp.f
        $(COML) $(SRC)setprp.f
detd16: detd16.o setprp.o $(LIBR)
        $(LINK) -o detd16 detd16.o setprp.o $(LIBR) 
detd16.o: $(SRC)detd16.f
        $(COML) $(SRC)detd16.f
effdef: effdef.o  grundd.o  $(LIBR) $(LIBP)  
        $(LINK) -o effdef effdef.o grundd.o  $(LIBR) $(LIBP) $(PGFLAG) 
effdef.o: $(SRC)effdef.f
        $(COML) $(SRC)effdef.f
fpr: fpr.o $(LIBR)
        $(LINK) -o fpr fpr.o $(LIBR)
fpr.o: $(SRC)fpr.f
        $(COML) $(SRC)fpr.f
g2x: $(SRC)g2x.f
        $(LINK) -o g2x $(SRC)g2x.f $(LIBR)
g2xfull: $(SRC)g2xfull.f
        $(LINK) -o g2xfull $(SRC)g2xfull.f $(LIBR)
grund: grund.o $(LIBR)
        $(LINK) -o grund grund.o $(LIBR)
grund.o: $(SRC)grund.f
        $(COML) $(SRC)grund.f
inillp1: $(SRC)inillp1.f $(LIBR)
        $(LINK) -o inillp1 $(SRC)inillp1.f $(LIBR)
inxmlp1: $(SRC)inxmlp1.f rxml.o xmlparser.o
        $(LINK) -o inxmlp1 $(SRC)inxmlp1.f rxml.o xmlparser.o $(LIBR) /usr/lib/libstdc++.6.dylib
inxml2gin: $(SRC)inxml2gin.f rxml.o xmlparser.o
        $(LINK) -o inxml2gin $(SRC)inxmlp1.f rxml.o xmlparser.o $(LIBR) /usr/lib/libstdc++.6.dylib
iqpsi: iqpsi.o inpd.o grundd.o $(LIBR) $(LIBP) 
        $(LINK) -o iqpsi iqpsi.o inpd.o grundd.o $(LIBR) $(LIBP) $(PGFLAG)
iqpsi.o: $(SRC)iqpsi.f
        $(COML) $(SRC)iqpsi.f
mill: mill.o $(LIBR)
        $(LINK) -o mill mill.o $(LIBR)
mill.o: $(SRC)mill.f
        $(COML) $(SRC)mill.f
monbug: $(SRC)monbug.f $(LIBR)  
        $(LINK) -o monbug $(SRC)monbug.f $(LIBR) 
mplot: mplot.o mplots.o $(LIBR) $(LIBP) 
        $(LINK) -o mplot mplot.o mplots.o $(LIBR) $(LIBP) $(PGFLAG)
mplot.o: $(SRC)mplot.f
        $(COML) $(SRC)mplot.f
mplots.o: $(SRC)mplots.f
        $(COML) $(SRC)mplots.f
mpolly: mpolly.o $(LIBR)
        $(LINK) -o mpolly mpolly.o $(LIBR)
mpolly.o: $(SRC)mpolly.f
        $(COML) $(SRC)mpolly.f
pchead.o: $(SRC)pchead.f
        $(COML) $(SRC)pchead.f
[RonBook-3:~/gg/sasOgf] ron% nedit makefile &
[5] 93491
[RonBook-3:~/gg/sasOgf] ron% UTF8 locale not supported.

[RonBook-3:~/gg/sasOgf] ron% 
[RonBook-3:~/gg/sasOgf] ron% make
make: *** No rule to make target `col42xml', needed by `all'.  Stop.
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/colrow.f 
gfortran  -o colrow colrow.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
gfortran -c  ..//sassrc/cont.f
gfortran  -o cont cont.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
gfortran -c  ..//sassrc/detec.f
gfortran -c  ..//sassrc/setprp.f
gfortran  -o detec detec.o setprp.o ../libsOgf/librlib.a
make: *** No rule to make target `..//sassrc/detd16.f', needed by `detd16.o'.  Stop.
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/detd16.f
gfortran  -o detd16 detd16.o setprp.o ../libsOgf/librlib.a 
gfortran  -o dirrun ..//sassrc/dirrun.f
gfortran -c  ..//sassrc/effdef.f
gfortran  -o effdef effdef.o grundd.o  ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib 
gfortran  -o g2x ..//sassrc/g2x.f ../libsOgf/librlib.a
gfortran  -o g2xfull ..//sassrc/g2xfull.f ../libsOgf/librlib.a
make: *** No rule to make target `..//sassrc/grund.f', needed by `grund.o'.  Stop.
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/grund.f
gfortran  -o grund grund.o ../libsOgf/librlib.a
gfortran  -o inillp1 ..//sassrc/inillp1.f ../libsOgf/librlib.a
gcc -c ..//sassrc/rxml.cpp
gcc -c ..//sassrc/xmlparser.cpp
gfortran  -o inxmlp1 ..//sassrc/inxmlp1.f rxml.o xmlparser.o ../libsOgf/librlib.a /usr/lib/libstdc++.6.dylib
gfortran  -o inxml2gin ..//sassrc/inxmlp1.f rxml.o xmlparser.o ../libsOgf/librlib.a /usr/lib/libstdc++.6.dylib
gfortran -c  ..//sassrc/iqpsi.f
gfortran  -o iqpsi iqpsi.o inpd.o grundd.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
gfortran -c  ..//sassrc/mill.f
gfortran  -o mill mill.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/mplot.f
gfortran -c  ..//sassrc/mplots.f
gfortran  -o mplot mplot.o mplots.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
Undefined symbols:
  "_qres_", referenced from:
      _MAIN__ in mplot.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [mplot] Error 1
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/qres.f
gfortran  -o mplot mplot.o mplots.o qres,o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
i686-apple-darwin8-gfortran-4.2: qres,o: No such file or directory
make: *** [mplot] Error 1
[RonBook-3:~/gg/sasOgf] ron% make
gfortran  -o mplot mplot.o mplots.o qres.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
gfortran  -o monbug ..//sassrc/monbug.f ../libsOgf/librlib.a 
..//sassrc/monbug.f:14.16:

2     format (f)                                                        
               1
Error: Nonnegative width required in format string at (1)
..//sassrc/monbug.f:13.18:

      read (vert,2) verp                                                
                 1
Error: FORMAT label 2 at (1) not defined
make: *** [monbug] Error 1
[RonBook-3:~/gg/sasOgf] ron% ls ../sassrc_gg_2012/monbug*
../sassrc_gg_2012/monbug.f
[RonBook-3:~/gg/sasOgf] ron% cp -p  ../sassrc_gg_2012/monbug.f ~/gg/sassrc
[RonBook-3:~/gg/sasOgf] ron% make
gfortran  -o monbug ..//sassrc/monbug.f ../libsOgf/librlib.a 
gfortran -c  ..//sassrc/mpolly.f
gfortran  -o mpolly mpolly.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/pchead.f
gfortran  -o pchead pchead.o ../libsOgf/librlib.a 
gfortran -c  ..//sassrc/pdqheads.f
gfortran  -o pdqheads pdqheads.o ../libsOgf/librlib.a 
gfortran -c  ..//sassrc/pdqtitle.f
..//sassrc/pdqtitle.f:29.63:

        Write (6,3) 'Run:',numor,' Ext:',iext,' Pre: ',par(10),' Title: 
                                                              1
Error: Unterminated character constant beginning at (1)
..//sassrc/pdqtitle.f:43.63:

        Write (6,3) 'Run:',numor,' Ext:',iext,' Pre: ',par(10),' Title: 
                                                              1
Error: Unterminated character constant beginning at (1)
make: *** [pdqtitle.o] Error 1
[RonBook-3:~/gg/sasOgf] ron% cp -p ../sassrc_gg_2012/pdqtitle.f ~/gg/sassrc
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/pdqtitle.f
gfortran  -o pdqtitle pdqtitle.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/pdqpg.f
gfortran  -o pdqpg pdqpg.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
gfortran -c  ..//sassrc/pdqpt.f
gfortran  -o pdqpt pdqpt.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
gfortran -c  ..//sassrc/polymer.f
gfortran -c  ..//sassrc/sasinn.f
gfortran  -o polymer polymer.o  sasinn.o ../libsOgf/libffn74ogf.a ../libsOgf/libpgplot.a ../libsOgf/librlib.a /usr/X11R6/lib/libX11.6.dylib
ld warning: for symbol _version_ tentative definition of size 16 from ../libsOgf/libffn74ogf.a(fthelp.o) is being replaced by a real definition of size 8 from ../libsOgf/libffn74ogf.a(userlog.o)
ld warning: for symbol _lpoutc_ tentative definition of size 16 from ../libsOgf/libffn74ogf.a(lpendf.o) is being replaced by a real definition of size 8 from ../libsOgf/libffn74ogf.a(lpout.o)
make: *** No rule to make target `..//sassrc/postcard.f', needed by `postcard.o'.  Stop.
[RonBook-3:~/gg/sasOgf] ron% cp -p ../sassrc_gg_2012/postcard.f ~/gg/sassrc
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/postcard.f
gfortran  -o postcard postcard.o ../libsOgf/librlib.a
ld warning: for symbol _ttyio_ tentative definition of size 16 from ../libsOgf/librlib.a(inin.o) is is smaller than the real definition of size 12 from postcard.o
gfortran -c  ..//sassrc/rcard.f
gfortran  -o rcard rcard.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/rfit.f
gfortran  -o rfit rfit.o  sasinn.o ../libsOgf/libffn74ogf.a ../libsOgf/libpgplot.a ../libsOgf/librlib.a /usr/X11R6/lib/libX11.6.dylib
ld warning: for symbol _version_ tentative definition of size 16 from ../libsOgf/libffn74ogf.a(fthelp.o) is being replaced by a real definition of size 8 from ../libsOgf/libffn74ogf.a(userlog.o)
ld warning: for symbol _lpoutc_ tentative definition of size 16 from ../libsOgf/libffn74ogf.a(lpendf.o) is being replaced by a real definition of size 8 from ../libsOgf/libffn74ogf.a(lpout.o)
gfortran -c  ..//sassrc/rguim.f
gfortran  -o rguim rguim.o vc04a.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
ld warning: for symbol _tinc_ tentative definition of size 96 from ../libsOgf/librlib.a(ttin.o) is is smaller than the real definition of size 84 from rguim.o
ld warning: for symbol _tinc_ tentative definition of size 96 from ../libsOgf/librlib.a(tdcd.o) is is smaller than the real definition of size 84 from rguim.o
make: *** No rule to make target `..//sassrc/ralread.f', needed by `ralread.o'.  Stop.
[RonBook-3:~/gg/sasOgf] ron% cp -p ../sassrc_gg_2012/ralread.f ~/gg/sassrc
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/ralread.f
gfortran  -o ralread ralread.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/rlist.f
gfortran  -o rlist rlist.o ../libsOgf/librlib.a 
gfortran -c  ..//sassrc/rmask.f
gfortran  -o rmask rmask.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/rnd16.f
gfortran -c   ..//sassrc/inpd16.f
gfortran  -o rnd16 rnd16.o inpd16.o grundd.o setprp.o ../libsOgf/librlib.a 
make: *** No rule to make target `..//sassrc/rnd16s.f', needed by `rnd16s.o'.  Stop.
[RonBook-3:~/gg/sasOgf] ron% cp -p ../sassrc_gg_2012/rnd16s.f ~/gg/sassrc
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/rnd16s.f
gfortran  -o rnd16s rnd16s.o inpd16.o grundd.o setprp.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/rnils.f
make: *** No rule to make target `..//sassrc/grundf.f', needed by `grundf.o'.  Stop.
[RonBook-3:~/gg/sasOgf] ron% cp -p ../sassrc_gg_2012/grundf.f ~/gg/sassrc
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/grundf.f
gfortran  -o rnils rnils.o inpd.o grundf.o setprp.o ../libsOgf/librlib.a 
gfortran -c  ..//sassrc/rplot.f
..//sassrc/rplot.f:52.17:

     1  ,XTOPT/  'Q   A-1    ','Q  A-1   ',' Q  A-1   ',                
                1
Warning: initialization string truncated to match variable at (1)
gfortran  -o rplot rplot.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
gfortran -c  ..//sassrc/rreg.f
gfortran  -o rreg rreg.o   setprp.o ../libsOgf/librlib.a 
gfortran -c  ..//sassrc/rundex.f
gfortran  -o rundex rundex.o setprp.o  ../libsOgf/librlib.a
gfortran -c  ..//sassrc/sasfit4.f
gfortran -c  ..//sassrc/calskp.f
gfortran -c  ..//sassrc/calskpx.f
gfortran  -o sasfit4 sasfit4.o calskp.o calskpx.o sasinn.o   ../libsOgf/libffn74ogf.a ../libsOgf/libpgplot.a ../libsOgf/librlib.a /usr/X11R6/lib/libX11.6.dylib
ld warning: for symbol _titles_ tentative definition of size 368 from ../libsOgf/libffn74ogf.a(ftfuns.o) is is smaller than the real definition of size 360 from sasfit4.o
ld warning: for symbol _version_ tentative definition of size 16 from ../libsOgf/libffn74ogf.a(fthelp.o) is being replaced by a real definition of size 8 from ../libsOgf/libffn74ogf.a(userlog.o)
ld warning: for symbol _lpoutc_ tentative definition of size 16 from ../libsOgf/libffn74ogf.a(lpendf.o) is being replaced by a real definition of size 8 from ../libsOgf/libffn74ogf.a(lpout.o)
gfortran  -o sasmpl ..//sassrc/sasmpl.f rxml.o xmlparser.o \
	../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib /usr/lib/libstdc++.6.dylib
gfortran -c  ..//sassrc/smorger.f
gfortran  -o smorger smorger.o  ../libsOgf/librlib.a
gfortran -c  ..//sassrc/snils.f
gfortran  -o snils snils.o inpd.o grundf.o setprp.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/splots.f
gfortran -c  ..//sassrc/splotf.f
gfortran -c  ..//sassrc/prolog.f	
gfortran  -o splots splots.o splotf.o prolog.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
gfortran -c  ..//sassrc/spolly.f
gfortran  -o spolly spolly.o ../libsOgf/librlib.a
make: *** No rule to make target `..//sassrc/tbplot.f', needed by `tbplot.o'.  Stop.
[RonBook-3:~/gg/sasOgf] ron% cp -p ../sassrc_gg_2012/tbplot.f ~/gg/sassrc
[RonBook-3:~/gg/sasOgf] ron% make
gfortran -c  ..//sassrc/tbplot.f
gfortran  -o tbplot tbplot.o mplots.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
ld warning: for symbol _illgfc_ tentative definition of size 16 from tbplot.o is being replaced by a real definition of size 12 from ../libsOgf/libpgplot.a(gidriv.o)
gfortran -c  ..//sassrc/windet.f
gfortran  -o windet windet.o ../libsOgf/librlib.a
gfortran -c  ..//sassrc/red16.f
gfortran  -o red16 red16.o ../libsOgf/librlib.a ../libsOgf/libpgplot.a /usr/X11R6/lib/libX11.6.dylib
ld warning: for symbol _cursorc_ tentative definition of size 816 from red16.o is being replaced by a real definition of size 808 from ../libsOgf/librlib.a(poscur.o)
[RonBook-3:~/gg/sasOgf] ron% 
