#!/usr/bin/make
#===========================================================================
#
#
#    djscript - A text formatter for the HP DeskJet500 printer.
#  
#    Copyright (C) 1993, 1994 Joerg Bullmann
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#===========================================================================

#=================================================
# You can choose your own defaults here:
# Fonts: font_courier, font_lettgoth, font_cgtimes
# Sizes: size_dina4, size_uslegal, size_usletter
# Charsets: char_ascii, char_ansi, char_ecma, char_pc8, char_pc850,
#           char_hpr8 (HP Roman 8), char_hpl (HP Legal)

#DEFAULTS=-DDEFAULT_FONT=font_courier -DDEFAULT_SIZE=size_uslegal\
	  -DDEFAULT_PRT_NAME=\"/dev/lp1\" -DDEFAULT_CHARSET=char_ascii

PACKAGE=print.C Makefile README COPYING ChangeLog

VERSION=1.3

CXX=g++
CC=gcc

CFLAGS=-O2 -DVERSION=\"$(VERSION)\" $(strip $(DEFAULTS))

#==============================================
# All files with leading filenames for TARring. 
FULLPACK=$(foreach FILE, $(PACKAGE),djscript/$(FILE))
#RCSFILES=$(foreach FILE, $(PACKAGE),RCS/$(FILE),v)
 
PATH_PREFIX=/usr/local

BINPATH=$(PATH_PREFIX)/bin
MANPATH=$(PATH_PREFIX)/man/man1

djscript : print.o
	$(CXX) $(CFLAGS) -o $@ $^ -lpaper

%.o : %.C
	$(CXX) $(CFLAGS) -c $<

#RCS/%,v : %
#	rcsdiff $< | more
#	ci -l $< || echo "Checkin failed."

#ci : $(RCSFILES)

install : inst_bin inst_man

inst_bin :
	cp djscript $(BINPATH)
	chmod u=rwx,go=rx $(BINPATH)/djscript

inst_man :
	@echo "Currently no manpage available. (sorry)"
#	chmod u=rw,go=r $(MANPATH)/djscript.1

tar : 
	cd .. ;\
	tar cvf djscript.$(VERSION).tar $(FULLPACK) ;\
	gzip djscript.$(VERSION).tar

clean :
	rm -f *.o djscript core a.out
