#
# 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>
#
# $Id: Makefile,v 2.3.1.1 1998/10/20 11:04:13 junker Exp $
# 
# 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

# Revision 1.3  1998/04/13 13:36:35  junker
# for papersize patch.
#
# Revision 1.2  1998/01/07 09:16:01  junker
# First RCS-checkin(from version 2.1)
# almost nothing changed.
#

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

# installation prefix
PREFIX  = /usr/local

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

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


#CFLAGS	= -DBSD -O -DLPR_PRINT
#
# for BSD Unix, add -DBSD
# 
# Sun Solaris 2.x, omit -DLPR_PRINT for no automatical print
#
# HFONT:			must be used in nh2ps
# A4_PAPERSIZE:			if you have a4-sized paper
# WIDTH, HEIGHT:		set to your paper size
# DEFAULT_HLATEXFONT_MODE:	set if you use HLaTeX font mode in default
#

# for a4 paper size, ps font mode
CFLAGS	= -DBSD -O2 -DHFONT  -DWIDTH=8.27 -DHEIGHT=11.64 \
	  -DA4_PAPERSIZE=1

# for letter paper size
#CFLAGS	= -DBSD -O2 -DHFONT  -DWIDTH=8.5 -DHEIGHT=11.0 \
#	  -DA4_PAPERSIZE=0


# 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
