
# Makefile.in for SGCAL. The building work is done by a separate Makefile in
# the src directory, which gets passed settings from here.

mkinstalldirs = $(SHELL) mkinstalldirs

# These variables get set up by the configure script.

CC=@CC@
CFLAGS=@CFLAGS@
LFLAGS=@LFLAGS@
SGPOINT=@SGPOINT@
SUPPORT_JPEG=@SUPPORT_JPEG@
LIBJPEG=@LIBJPEG@
SUPPORT_PNG=@SUPPORT_PNG@
LIBPNG=@LIBPNG@

INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@

BINDIR=@prefix@/bin
DATADIR=@prefix@/share/sgcal
MANDIR=@prefix@/man

# BINDIR is the directory in which the commands are installed.
# DATADIR is the directory in which the SGCAL library files are installed,
#  in a subdirectory called sgcal.
# MANDIR is the directory in which the man pages are installed.

build:; cd src; $(MAKE) \
                BINDIR=$(BINDIR) \
                DATADIR=$(DATADIR) \
                MANDIR=$(MANDIR) \
                CC="$(CC)" \
                CFLAGS="$(CFLAGS)" \
                LFLAGS="$(LFLAGS)" \
                SGPOINT="$(SGPOINT)" \
                SUPPORT_JPEG="$(SUPPORT_JPEG)" \
                LIBJPEG="$(LIBJPEG)" \
                SUPPORT_PNG="$(SUPPORT_PNG)" \
                LIBPNG="$(LIBPNG)"

clean:; cd src; $(MAKE) clean

distclean:;     rm Makefile config.cache config.log config.status; \
                cd src; $(MAKE) clean

test:; cd testing; RunTests

install:        build
		$(mkinstalldirs) $(BINDIR)
		$(mkinstalldirs) $(DATADIR)
		$(mkinstalldirs) $(DATADIR)/atl
		$(mkinstalldirs) $(MANDIR)
		$(mkinstalldirs) $(MANDIR)/man1
		$(INSTALL) src/sgcal $(BINDIR)/sgcal
		$(INSTALL) src/sgcal-fr $(BINDIR)/sgcal-fr
		$(INSTALL) src/sgtops $(BINDIR)/sgtops
		$(INSTALL) src/sgbuildhy $(BINDIR)/sgbuildhy
		$(INSTALL) src/sghytest $(BINDIR)/sghytest
		if [ -e src/sgpoint ]; then $(INSTALL) src/sgpoint $(BINDIR)/sgpoint; fi
		$(INSTALL_DATA) lib/FontTran $(DATADIR)/FontTran
		$(INSTALL_DATA) lib/HyphenData $(DATADIR)/HyphenData
		$(INSTALL_DATA) lib/PShead $(DATADIR)/PShead
		$(INSTALL_DATA) lib/a4ps $(DATADIR)/a4ps
		$(INSTALL_DATA) lib/a5ps $(DATADIR)/a5ps
		$(INSTALL_DATA) lib/online $(DATADIR)/online
		$(INSTALL_DATA) lib/sgpoint $(DATADIR)/sgpoint
		$(INSTALL_DATA) lib/praccnt $(DATADIR)/praccnt
		$(INSTALL_DATA) lib/prgreek $(DATADIR)/prgreek
		$(INSTALL_DATA) lib/printer $(DATADIR)/printer
		$(INSTALL_DATA) lib/prspecl $(DATADIR)/prspecl
		$(INSTALL_DATA) lib/psaccnt $(DATADIR)/psaccnt
		$(INSTALL_DATA) lib/psgreek $(DATADIR)/psgreek
		$(INSTALL_DATA) lib/psspecl $(DATADIR)/psspecl
		$(INSTALL_DATA) lib/stdflags $(DATADIR)/stdflags
		$(INSTALL_DATA) lib/stdmacs $(DATADIR)/stdmacs
		$(INSTALL_DATA) lib/atl/AvantGa-bf $(DATADIR)/atl/AvantGa-bf
		$(INSTALL_DATA) lib/atl/AvantGa-bi $(DATADIR)/atl/AvantGa-bi
		$(INSTALL_DATA) lib/atl/AvantGa-it $(DATADIR)/atl/AvantGa-it
		$(INSTALL_DATA) lib/atl/AvantGa-rm $(DATADIR)/atl/AvantGa-rm
		$(INSTALL_DATA) lib/atl/Bookman-bf $(DATADIR)/atl/Bookman-bf
		$(INSTALL_DATA) lib/atl/Bookman-bi $(DATADIR)/atl/Bookman-bi
		$(INSTALL_DATA) lib/atl/Bookman-it $(DATADIR)/atl/Bookman-it
		$(INSTALL_DATA) lib/atl/Bookman-rm $(DATADIR)/atl/Bookman-rm
		$(INSTALL_DATA) lib/atl/Courier    $(DATADIR)/atl/Courier
		$(INSTALL_DATA) lib/atl/Courier-bf $(DATADIR)/atl/Courier-bf
		$(INSTALL_DATA) lib/atl/Courier-bi $(DATADIR)/atl/Courier-bi
		$(INSTALL_DATA) lib/atl/Courier-it $(DATADIR)/atl/Courier-it
		$(INSTALL_DATA) lib/atl/Helvetica  $(DATADIR)/atl/Helvetica
		$(INSTALL_DATA) lib/atl/Helveti-bf $(DATADIR)/atl/Helveti-bf
		$(INSTALL_DATA) lib/atl/Helveti-bi $(DATADIR)/atl/Helveti-bi
		$(INSTALL_DATA) lib/atl/Helveti-it $(DATADIR)/atl/Helveti-it
		$(INSTALL_DATA) lib/atl/NHelvetica $(DATADIR)/atl/NHelvetica
		$(INSTALL_DATA) lib/atl/NHelvet-bf $(DATADIR)/atl/NHelvet-bf
		$(INSTALL_DATA) lib/atl/NHelvet-bi $(DATADIR)/atl/NHelvet-bi
		$(INSTALL_DATA) lib/atl/NHelvet-it $(DATADIR)/atl/NHelvet-it
		$(INSTALL_DATA) lib/atl/NewCent-bf $(DATADIR)/atl/NewCent-bf
		$(INSTALL_DATA) lib/atl/NewCent-bi $(DATADIR)/atl/NewCent-bi
		$(INSTALL_DATA) lib/atl/NewCent-it $(DATADIR)/atl/NewCent-it
		$(INSTALL_DATA) lib/atl/NewCent-rm $(DATADIR)/atl/NewCent-rm
		$(INSTALL_DATA) lib/atl/Palatin-bf $(DATADIR)/atl/Palatin-bf
		$(INSTALL_DATA) lib/atl/Palatin-bi $(DATADIR)/atl/Palatin-bi
		$(INSTALL_DATA) lib/atl/Palatin-it $(DATADIR)/atl/Palatin-it
		$(INSTALL_DATA) lib/atl/Palatin-rm $(DATADIR)/atl/Palatin-rm
		$(INSTALL_DATA) lib/atl/Times-bf   $(DATADIR)/atl/Times-bf
		$(INSTALL_DATA) lib/atl/Times-bi   $(DATADIR)/atl/Times-bi
		$(INSTALL_DATA) lib/atl/Times-it   $(DATADIR)/atl/Times-it
		$(INSTALL_DATA) lib/atl/Times-rm   $(DATADIR)/atl/Times-rm
		$(INSTALL_DATA) lib/atl/Symbol	   $(DATADIR)/atl/Symbol
		$(INSTALL_DATA) lib/atl/ZapfCha-it $(DATADIR)/atl/ZapfCha-it
		$(INSTALL_DATA) lib/atl/ZapfDingba $(DATADIR)/atl/ZapfDingba

		$(INSTALL_DATA) doc/sgcal.1 $(MANDIR)/man1
		$(INSTALL_DATA) doc/sgcal-fr.1 $(MANDIR)/man1
		$(INSTALL_DATA) doc/sgbuildhy.1 $(MANDIR)/man1
		$(INSTALL_DATA) doc/sghytest.1 $(MANDIR)/man1
		$(INSTALL_DATA) doc/sgpoint.1 $(MANDIR)/man1
		$(INSTALL_DATA) doc/sgtops.1 $(MANDIR)/man1
# End
