#
# ~ppr/src/misc_filters/Makefile
# Copyright 1995, 1996, 1997, Trinity College Computing Center.
# Written by David Chappell.
# 
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation.  This software is provided "as is" without express or
# implied warranty.
#
# Last modified 3 April 1997.
#

#
# Build and install various input filters for PPR.
#

include ../include/global.mk

all: filter_hexdump$(DOTEXE) filter_fortran$(DOTEXE)

install: $(HOMEDIR)/lib/filter_hexdump$(DOTEXE) \
	$(HOMEDIR)/lib/filter_fortran$(DOTEXE) \
	$(HOMEDIR)/lib/filter_pr $(HOMEDIR)/install/filter_troff_real \
	$(HOMEDIR)/install/filter_ditroff_real \
	$(HOMEDIR)/install/filter_troff_groff \
	$(HOMEDIR)/install/filter_ditroff_groff \
	$(HOMEDIR)/install/filter_dvi $(HOMEDIR)/install/filter_tex \
	$(HOMEDIR)/install/filter_texinfo $(HOMEDIR)/install/filter_bmp \
	$(HOMEDIR)/install/filter_jpeg $(HOMEDIR)/install/filter_gif \
	$(HOMEDIR)/install/filter_pnm $(HOMEDIR)/install/filter_xbm \
	$(HOMEDIR)/install/filter_xpm $(HOMEDIR)/install/filter_xwd \
	$(HOMEDIR)/install/filter_tiff \
	$(HOMEDIR)/install/filter_plot_postplot \
	$(HOMEDIR)/install/filter_plot_plot2ps \
	$(HOMEDIR)/install/filter_fig $(CONFDIR)/mfmodes.conf

filter_hexdump$(DOTEXE): hexdump.c
	$(CC) $(CFLAGS) -o filter_hexdump hexdump.c
	$(STRIP) filter_hexdump$(DOTEXE)

filter_fortran$(DOTEXE): fortran.c ../include/global_defines.h
	$(CC) $(CFLAGS) -o filter_fortran fortran.c ../libppr.$(LIBEXT)
	$(STRIP) filter_fortran$(DOTEXE)

$(HOMEDIR)/lib/filter_hexdump$(DOTEXE): filter_hexdump$(DOTEXE)
	cp filter_hexdump$(DOTEXE) $(HOMEDIR)/lib/filter_hexdump$(DOTEXE)

$(HOMEDIR)/lib/filter_fortran$(DOTEXE): filter_fortran$(DOTEXE)
	cp filter_fortran$(DOTEXE) $(HOMEDIR)/lib/filter_fortran$(DOTEXE)

# This one is installed directly because
# every unix system has pr.
$(HOMEDIR)/lib/filter_pr: pr.sh
	cp pr.sh $(HOMEDIR)/lib/filter_pr
	chmod 755 $(HOMEDIR)/lib/filter_pr

$(HOMEDIR)/install/filter_troff_real: troff_real.sh
	cp troff_real.sh $(HOMEDIR)/install/filter_troff_real

$(HOMEDIR)/install/filter_ditroff_real: ditroff_real.sh
	cp ditroff_real.sh $(HOMEDIR)/install/filter_ditroff_real

$(HOMEDIR)/install/filter_troff_groff: troff_groff.sh
	cp troff_groff.sh $(HOMEDIR)/install/filter_troff_groff

$(HOMEDIR)/install/filter_ditroff_groff: ditroff_groff.sh
	cp ditroff_groff.sh $(HOMEDIR)/install/filter_ditroff_groff

$(HOMEDIR)/install/filter_dvi: dvi.sh
	cp dvi.sh $(HOMEDIR)/install/filter_dvi

$(HOMEDIR)/install/filter_tex: tex.perl
	cp tex.perl $(HOMEDIR)/install/filter_tex

$(HOMEDIR)/install/filter_texinfo: texinfo.sh
	cp texinfo.sh $(HOMEDIR)/install/filter_texinfo

$(HOMEDIR)/install/filter_jpeg: jpeg.sh
	cp jpeg.sh $(HOMEDIR)/install/filter_jpeg

$(HOMEDIR)/install/filter_gif: gif.sh
	cp gif.sh $(HOMEDIR)/install/filter_gif

$(HOMEDIR)/install/filter_bmp: bmp.sh
	cp bmp.sh $(HOMEDIR)/install/filter_bmp

$(HOMEDIR)/install/filter_pnm: pnm.sh
	cp pnm.sh $(HOMEDIR)/install/filter_pnm

$(HOMEDIR)/install/filter_xbm: xbm.sh
	cp xbm.sh $(HOMEDIR)/install/filter_xbm

$(HOMEDIR)/install/filter_xpm: xpm.sh
	cp xpm.sh $(HOMEDIR)/install/filter_xpm

$(HOMEDIR)/install/filter_xwd: xwd.sh
	cp xwd.sh $(HOMEDIR)/install/filter_xwd

$(HOMEDIR)/install/filter_tiff: tiff.sh
	cp tiff.sh $(HOMEDIR)/install/filter_tiff

$(HOMEDIR)/install/filter_plot_postplot: plot_postplot.sh
	cp plot_postplot.sh $(HOMEDIR)/install/filter_plot_postplot

$(HOMEDIR)/install/filter_plot_plot2ps: plot_plot2ps.sh
	cp plot_plot2ps.sh $(HOMEDIR)/install/filter_plot_plot2ps

$(HOMEDIR)/install/filter_fig: fig.sh
	cp fig.sh $(HOMEDIR)/install/filter_fig

$(CONFDIR)/mfmodes.conf: mfmodes.conf
	cp mfmodes.conf $(CONFDIR)/mfmodes.conf

clean:
	rm -rf *~ *.bak filter_hexdump$(DOTEXE) filter_fortran$(DOTEXE)

# end of file
