
AM_FCFLAGS = $(FC_MODINC)$(top_srcdir)/lib $(FC_MODINC). $(FC_MODOUT)$(top_srcdir)/lib

if BUNDLE
  photmetrydir = $(prefix)/share/munipack
else
  photmetrydir = $(pkgdatadir)
endif

pkglibexec_PROGRAMS = find aphot gphot phcal phfotran pphot

find_SOURCES = daosky.f95 daofind.f95 fitsfind.f95 find.f95
find_LDFLAGS = @LIBGFORTRAN@ @LIBGCC@ -L$(top_srcdir)/lib @LDMINPACK@
find_LDADD   = -lrstat -lfmm -llmin -lsort -lminpacks -lminpack -lfitsio -lcfitsio -lm

aphot_SOURCES = daosky.f95 daofotometr.f95 fitsaphot.f95 aphot.f95
aphot_LDFLAGS = @LIBGFORTRAN@ @LIBGCC@ -L$(top_srcdir)/lib @LDMINPACK@
aphot_LDADD   = -lrstat -lfmm -llmin -lsort -lminpacks -lminpack -lfitsio -lcfitsio -lm

gphot_SOURCES = growinit.f95 growmodel.f95 \
                growfit.f95 growreport.f95 growcurve.f95 gphot.f95
gphot_LDFLAGS = @LIBGFORTRAN@ @LIBGCC@ -L$(top_srcdir)/lib @LDMINPACK@
gphot_LDADD   = -lrstat -llmin -lsort -lpppack -lminpacks -lminpack -lfmm \
                -lfitsio -lcfitsio -lm

phcal_SOURCES =  fitsfotran.f95 rational.f95 rplane.f95 \
                 fotran.f95 mfits.f95 calibre.f95 jam.f95 colorex.f95 \
                 sfits.f95 phcal.f95
phcal_LDFLAGS = @LIBGFORTRAN@ @LIBGCC@ @LDMINPACK@ -L$(top_srcdir)/lib
phcal_LDADD = -lrstat -llmin -lsort -lastrotrafo -lphotometry -lfmm \
              -lminpacks -lminpack -lphio -lastrosphere -lfitsio -lcfitsio -lm

phfotran_SOURCES = mfits.f95 jam.f95 fitsfotran.f95 rplane.f95 \
                   rational.f95 fotran.f95 phfotran.f95
phfotran_LDFLAGS = @LIBGFORTRAN@ @LIBGCC@ @LDMINPACK@ -L$(top_srcdir)/lib
phfotran_LDADD   = -lastrotrafo -lphotometry -lminpacks -lminpack -llmin -lrstat -lsort \
                   -lphio -lfmm -lastrosphere -lfitsio -lcfitsio -lm

pphot_SOURCES = psf.f95 fitspphot.f95 pphot.f95
pphot_LDFLAGS = @LIBGFORTRAN@ @LIBGCC@ -L$(top_srcdir)/lib
pphot_LDADD   = -lrstat -llmin -lsort -lfitsio -lcfitsio -lm

dist_photmetry_DATA = photosystems.fits grow_report.sh grow_report.py

photosystems.fits: photosystems.lst
	echo -e "MODE = 'RESTORE'\nFILE = 'photosystems.lst' '' 'photosystems.fits'\n" | ../fitsut/fitsut

CLEANFILES = photosystems.fits
