#
# Description: Makefile to construct and install nh2ps. Don't forget
# to give your own values to define the variable name of compiler
# (see OPTIONS).
#
# Created: Fri Nov 5 8:15:00 1993 by miguel@bounty.imag.fr (Miguel Santana)
# Version: 4.3
#

# Copyright (c) 1993, 1994, Miguel Santana, M.Santana@frgu.bull.fr
#
# Permission is granted to use, copy, and distribute this software for
# non commercial use, provided that the above copyright notice appear in
# all copies and that both that copyright notice and this permission
# notice appear in supporting documentation.
#
# Permission to modify the software is granted, but not the right to
# distribute the modified code. Please report bugs and changes to
# M.Santana@frgu.bull.fr
# 
# This software is provided "as is" without express or implied warranty.

# A Korean version of a2ps 4.3 using PostScript Font of HLaTeX-0.95 and above
# Version 2.0
#
# No Copyright, 22 Jun 1997, Choi Jun Ho <junker@jazz.snu.ac.kr>
# 
# Thanks to author of HLaTeX for supplying Hangul fonts
# If there is no compile
# option '-DHFONT', it will generate a complete a2ps without hangul support

# stupid a**holes who add non-compatible "features"

# installation prefix
PREFIX  = /usr/local

# directories
BINDIR	= ${PREFIX}/bin
MANDIR	= ${PREFIX}/man/man1
MANEXT	= 1

# misc
SHELL	=/bin/sh
CC	=cc
D	=.
O	=.


#CFLAGS	= -DBSD -O -DLPR_PRINT
# SunSolaris 2.x, omit -DLPR_PRINT for no automatical print
CFLAGS	= -DBSD -O2 -DHFONT
# Default values for HEIGHT, WIDTH, MARGIN and DIR_SEP (11.64, 8.27, 1.2, '/').
# Default values for LPR_COMMAND and LPR_OPT ("lpr", "-l")
# No values for TWOSIDED_DFLT, ONESIDED and TWOSIDED
OBJS	      = nh2ps.o

all:		nh2ps

nh2ps:		psfontmap.c nh2ps.o
		@echo "Linking nh2ps ..."
		$(CC) -o $D/nh2ps nh2ps.o

nh2ps.o:	nh2ps.c
		@echo "Compiling nh2ps.c ..."
		$(CC) -c $(CFLAGS) nh2ps.c

psfontmap.c:	mkpsfontmap.pl
		@echo "Generating psfontmap.c ..."
		./mkpsfontmap.pl > psfontmap.c

install:	nh2ps
		@echo "Installing nh2ps ..."
		cp nh2ps $(BINDIR)/nh2ps
		chmod a+rx $(BINDIR)/nh2ps
		@echo "Installing nh2ps_opt ..."
		cp nh2ps_opt $(BINDIR)/nh2ps_opt
		chmod a+rx $(BINDIR)/nh2ps_opt

install.man:	nh2ps.1
		@echo "Installing nh2ps man page ..."
		cp nh2ps.1 $(MANDIR)/nh2ps.$(MANEXT)
		chmod a+r $(MANDIR)/nh2ps.$(MANEXT)

clean:;		rm -f $(OBJS) nh2ps nh2ps.o core *~ *O psfontmap.c
