
lib_LTLIBRARIES = libpsastro.la
libpsastro_la_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSASTRO_CFLAGS)

bin_PROGRAMS = psastro psastroModel gpcModel

psastro_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSASTRO_CFLAGS)
psastro_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PPSTATS_LIBS) $(PSASTRO_LIBS)
psastro_LDADD = libpsastro.la

psastroModel_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSASTRO_CFLAGS)
psastroModel_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSASTRO_LIBS)
psastroModel_LDADD = libpsastro.la

gpcModel_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PSASTRO_CFLAGS)
gpcModel_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PSASTRO_LIBS)
gpcModel_LDADD = libpsastro.la

psastro_SOURCES = \
	psastro.c		    \
        psastroArguments.c	    \
	psastroParseCamera.c   	    \
	psastroDataLoad.c           \
	psastroDataSave.c           \
	psastroMetadataStats.c      \
	psastroCleanup.c

psastroModel_SOURCES = \
	psastroModel.c		    \
        psastroModelArguments.c	    \
	psastroModelParseCamera.c   \
	psastroModelDataLoad.c      \
	psastroModelAnalysis.c      \
	psastroModelBoresite.c      \
	psastroModelFitBoresite.c   \
	psastroModelAdjust.c        \
	psastroModelDataSave.c      \
	psastroCleanup.c

gpcModel_SOURCES = gpcModel.c

libpsastro_la_SOURCES = \
	psastroErrorCodes.c         \
	psastroVersion.c            \
	psastroDefineFiles.c        \
	psastroAnalysis.c           \
	psastroAstromGuess.c        \
	psastroLoadRefstars.c       \
	psastroChooseRefstars.c     \
	psastroConvert.c	    \
	psastroChipAstrom.c         \
	psastroOneChip.c	    \
	psastroOneChipGrid.c	    \
	psastroOneChipFit.c	    \
	psastroRemoveClumps.c	    \
	psastroUtils.c	       	    \
	psastroTestFuncs.c          \
	psastroLuminosityFunction.c \
	psastroRefstarSubset.c      \
	psastroFixChips.c           \
	psastroFixChipsTest.c       \
	psastroUseModel.c           \
	psastroMosaicAstrom.c       \
	psastroMosaicGradients.c    \
	psastroMosaicChipAstrom.c   \
	psastroMosaicOneChip.c      \
	psastroMosaicSetAstrom.c    \
	psastroMosaicSetMatch.c     \
	psastroDemoDump.c           \
	psastroDemoPlot.c

include_HEADERS = \
	psastro.h \
	psastroErrorCodes.h

noinst_HEADERS = \
	psastroInternal.h \
	psastroStandAlone.h

clean-local:
	-rm -f TAGS

# Tags for emacs
tags:
	etags `find . -name \*.[ch] -print`

### Error codes.
BUILT_SOURCES = psastroErrorCodes.h psastroErrorCodes.c
CLEANFILES = psastroErrorCodes.h psastroErrorCodes.c
EXTRA_DIST = psastroErrorCodes.dat psastroErrorCodes.h.in psastroErrorCodes.c.in

psastroErrorCodes.h : psastroErrorCodes.dat psastroErrorCodes.h.in
	$(ERRORCODES) --data=psastroErrorCodes.dat --outdir=. psastroErrorCodes.h

psastroErrorCodes.c : psastroErrorCodes.dat psastroErrorCodes.c.in psastroErrorCodes.h
	$(ERRORCODES) --data=psastroErrorCodes.dat --outdir=. psastroErrorCodes.c
