.KEEP_STATE: #suggested by Keigo Nitadori 11/06.
CFLAGS = -O3 -Wall -ffast-math
FFLAGS = -O3 -Wall -ffast-math
#FFLAGS +=  -O3 -fbounds-check
#FFLAGS = -O3 -g
#FFLAGS +=  -traceback
#FFLAGS +=  -pg
FC = gfortran
#FC = gfortran44

VPATH = ../ARchain:../ARint:

SOURCE = \
nbody6.f adjust.f assess.f bindat.f binev.f binout.f binpop.f \
block.f bodies.f brake.f brake2.f brake3.f bsetid.f chaos0.f \
chaos.f check.f checkl.f chrect.f clint.f cloud.f cloud0.f \
cmbody.f cmcorr.f cmfirr.f cmfreg.f coal.f comenv.f core.f \
corerd.f cputim.f data.f decide.f define.f deform.f degen.f \
delay.f dgcore.f dtchck.f eccmod.f ecirc.f edot.f efac2.f \
efac3.f expel.f energy.f escape.f events.f evolve.f expand.f \
fbulge.f fclose.f fcloud.f fcorr.f fdisk.f fhalo.f ficorr.f findj.f \
findm.f flyby.f fnuc.f fpcorr.f fpert.f fpoly1.f fpoly2.f \
freeze.f gcinit.f gcint.f giant.f giant3.f gntage.f grrad.f \
hcorr.f hiarch.f hicirc.f hidat.f higrow.f himax.f himax2.f \
himod.f hipop.f hirect.f histab.f hivel.f hmdot.f hmdot2.f \
hotsys.f hrdiag.f hrplot.f hut.f hut2.f iblock.f imf.f imfbd.f \
imf2.f impact.f induce.f inext.f input.f insert.f instar.f \
intgrt.f intide.f jacobi.f kepler.f kick.f kick2.f kozai.f ksapo.f \
kscorr.f ksin2.f ksinit.f ksint.f kslist.f ksmod.f ksperi.f \
kspert.f kspoly.f kspred.f ksrect.f ksreg.f ksres.f ksres2.f ksterm.f \
kstide.f lagr.f lagr2.f levels.f magbrk.f matrix.f mdot.f merge.f \
merge2.f mix.f mloss.f mlwind.f modify.f mrenv.f mtrace.f mydump.f \
nbhist.f nbint.f nblist.f nbpot.f nbrem.f nbrest.f nbsort.f nbtide.f \
newtev.f nstab.f ntint.f offset.f orbit.f output.f peri.f permit.f \
pfac.f plpot1.f poti.f premsf.f proto_star.f qtides.f ran2.f reflct.f \
regint.f remove.f rename.f reset.f reset2.f resolv.f rkint.f rl.f roche.f \
rpmax.f rpmax2.f rpmin.f scale.f search.f setup.f setup2.f shrink.f \
sort1.f spiral.f stability.f star.f start.f stepk.f steps.f stumpf.f \
subint.f swap.f sweep.f synch.f tail0.f tcirc.f tides.f tides2.f \
tides3.f touch.f tpert.f trdot.f trdot2.f trflow.f tstab.f tstep.f \
units.f unpert.f update.f verify.f xtrnl0.f xtrnld.f xtrnlf.f \
xtrnlp.f xtrnlt.f xtrnlv.f xvpred.f zare.f zcnsts.f zero.f zfuncs.f \
triple.f derqp3.f difsy3.f erel3.f extend.f qpmod3.f stabl3.f \
stablz.f start3.f subsys.f tperi.f trans3.f \
quad.f derqp4.f difsy4.f endreg.f erel4.f ichain.f newreg.f newsys.f \
qpmod4.f rchain.f rsort.f stabl4.f start4.f status.f trans4.f \
chain.f const.f erel.f hpsort.f inclin.f ksphys.f physks.f \
absorb.f chdata.f chfind.f chfirr.f chinit.f chlist.f chmod.f \
chpert.f chpot.f chterm.f expel2.f fchain.f ghost.f \
reduce.f ffdot.f reinit.f setsys.f tchain.f xcpred.f xtpert.f \
arc.f pnpert.f xtpert2.f bhstat.f bhstab.f emax1.f \
grbin.f inject.f infall.f decorr.f chterm2.f cpertx.f cpertj.f kcpert.f \
brake4.f ksrot.f deform2.f expand2.f renew.f \
circ.f spinup.f \
newton.f ksintp.f kspert2.f pnpert2.f
# five dummy routines in dir Ncode to enable block-step version.

OBJECTS = $(SOURCE:.f=.o)

nbody7: $(OBJECTS)
	$(FC) $(FFLAGS) $(OBJECTS) -o nbody7

print:
	@- \rm -f NBODY6.TEXT
	@cat $(SOURCE) > NBODY6.TEXT

clean:
	rm -f *.o
