#
# Description: Makefile to construct and install h2ps. Don't forget
# to give your own values to define the variable name of compiler
# (see OPTIONS).
#
# h2ps.c - Hangul (ksc5601-1987) to PostScript converter, version 1.0 . 
# Lee yongjae, setup@shiva.snu.ac.kr, 1996.3.16.
#
# This program is modified from a2ps v4.3 .
#
# h2ps is file converter to print Hangul in simple way.
# The outputed PostScript file is self-contained.
# Because it appends Hangul font to the outputed PS file, the outputed
# PS file can be printed in everywhere with PostScript printer.
#
#
# Copyright (c) 1996 by Lee yongjae, Narae in dept. of Computer Science
# in Seoul National University, Korea.
#
# Narae is the name for Computer Science Society in dept. of
# Computer Science in Seoul National University.
#
# 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, and that the name of the copyright holder
# not be used in advertising or publicity pertaining to distribution
# of the software without specific, written prior permission.
#
# This software is provided "as is" without express or implied warranty.
#
#
# This copyright notice is somewhat of nonsense
# because this the a2ps v4.3 's copyright notice prohibits from distributing
# the modified version of a2ps. But I'm not sure whether the notice means
# "any modified version should not be destributed" or
# "do not distribute modified version as the name of a2ps, for consistency".
# I've tryed to mail to "M.Santana@frgu.bull.fr" but failed.
# Only I hope the author intended the latter.
# See the following a2ps v4.3 's original copyright notice.
#

#
# File: bounty:/archive/src/a2ps/Last/Makefile
# 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.

# stupid a**holes who add non-compatible "features"
SHELL	=/bin/sh

CC	=gcc

D	=.
O	=.

BINDIR	=/usr/local/bin

MANDIR	=/usr/man/mann
MANEXT	=n

CFLAGS	= -O # -DBSD -DLPR_PRINT
# 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	      = h2ps.o

all:		xh2ps

xh2ps:		h2ps.o ncode.o font.o
		@echo "Linking h2ps ... "
		$(CC) -o $D/xh2ps h2ps.o ncode.o font.o

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

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

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

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

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

shar:;		shar -b -oh2ps.shar README Makefile h2ps.c h2ps.1

tar:;		tar cvf h2ps.tar README Makefile h2ps.c h2ps.1

clean:;		rm -f $(OBJS) xh2ps core *~ *.o
