#
#===========================================================================
#=                                                                         =
#=  (C) Copyright 1995, Computer Technology Institute (CTI)                =
#=                                                                         =
#=  Permission to use, copy, modify and distribute this software and       =
#=  its documentation for non-commercial use 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 and warranty disclaimer appear in supporting documentation,     =
#=  and that the name of Computer Technology Institute (CTI) or any of     =
#=  its entities not be used in advertising or publicity pertaining to     =
#=  distribution of the software and its documentation without specific    =
#=  prior permission.                                                      =
#=                                                                         =
#=  Computer Technology Institute (CTI) disclaims all warranties with      =
#=  regard to this software and makes no representations about the         =
#=  suitability of this software and its documentation for any purpose.    =
#=  It is provided "as is" without expressed or implied warranty.          =
#=                                                                         =
#===========================================================================
#=                                                                         =
#=                        Project CTI-Print                                =
#=                                                                         =
#= File:                                                                   =
#=   Makefile                                                              =
#=                                                                         =
#= Synopsis:                                                               =
#=   This is the Makefile to build and install the filter.                 =
#=                                                                         =
#= Author:                                                                 =
#=   Panos Dimakopoulos, Systems Programmer,                                =
#=   Computer Technology Institute,                                        =
#=   Division of Computing Facilities,                                     =
#=   P.O. Box 1122,                                                        =
#=   261 10  Patras,                                                       =
#=   Greece                                                                =
#=   (e-mail: dimakop@cti.gr)                                              =
#=   Tel: +30 61 992061                                                    =
#=   Fax: +30 61 993973                                                    =
#=                                                                         =
#===========================================================================
#


#============================================================================
#= Modification History:
#= 	Revision 1.1	95/01/12	14:53:38
#=		 Creation.
#= 	Revision 1.2	95/02/10	16:53:44
#=		 Full CTI address.
#= 	Revision 1.3	95/02/13	19:39:59
#=		 Make.inc moved to parent directory.
#= 	Revision 1.4	95/02/15	11:35:30
#=		 Filters have 755 mode now.
#= 	Revision 1.5	95/08/22	15:11:53
#=		 Porting to Solaris.
#=
#

include ../../Make.inc

FLAGS= -I. -I${SRC} ${ETCPC} ${ETCPERMS}
CFLAGS= -g ${FLAGS}
CTIFLAGS= ${DEFLTFONT} ${FONTPATH} ${MACHINESFONTS} ${ACCNTSH} ${ETCPERMS} \
	  ${DINSTDIR}

COMPILE= ${CC} -c ${CFLAGS} ${CTIFLAGS} ${DEFINES}

# commands made by this script
COMMANDS= ifhp4 ifhp4.sh rm_errlog.sh

SRC=.

PRINTER=ccb_iii

DINSTDIR= "-DINSTDIR=\"${INSTDIR}\""

.SUFFIXES: .o .c .c~ .h .h~

.c~.c:
	sccs get $<
.h~.h:
	sccs get $<
.sh~.sh:
	sccs get $<

all:	${COMMANDS}

#
# Object - Source  dependencies
#
ifHP4 = $(SRC)/ifhp4.o $(SRC)/log.o $(SRC)/args.o $(SRC)/fontsfile.o
ifhp4 :	$(ifHP4)
	${CC} ${CFLAGS} $(ifHP4) ${LIBS} -o $@
ifhp4.o:	$(SRC)/ifhp4.c $(SRC)/hp4.h
	${COMPILE} ${ELOTFONT} ${VMSFONT} ${PCFONT} -c ${SRC}/ifhp4.c
fontsfile.o:	$(SRC)/fontsfile.c $(SRC)/hp4.h
	${COMPILE} ${MACHINESFONTS} -c ${SRC}/fontsfile.c
args.o:	$(SRC)/args.c $(SRC)/hp4.h
	${COMPILE} -c ${ACCNTSH} ${ETCPERMS} ${SRC}/args.c
log.o:	$(SRC)/log.c
	${COMPILE} -c ${SRC}/log.c

#
# Installation of commands
#
install: $(COMMANDS)
	-mkdir -p $(INSTDIR)
	for i in $(COMMANDS) ; do \
		echo Copying $$i in $(INSTDIR) ; \
		cp $$i  $(INSTDIR); \
		chmod 755 $(INSTDIR)/$$i ; \
		chown root $(INSTDIR)/$$i ; \
		chgrp daemon $(INSTDIR)/$$i ; \
	done ;

#
# Miscellaneous
#

remove:
	rm -f ${INSTDIR}/$?

clean:
	cd ${SRC}
	-rm -f ifhp4 *.o core ?

print:
	@$lpr -P${PRINTER} -Jifhp4  Makefile *.c *.h
