# Generated automatically from Makefile.in by configure.
#
#===========================================================================
#=                                                                         =
#=  (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:
#

# where the filters are installed:
INSTDIR=/home/Alceste/stef/PLP/tmp/CTI-Print
# where the fonts are installed (this path should agree
# with the one in FONTPATH).
FONTDIR=/home/Alceste/stef/PLP/tmp/CTI-Print/fonts

# shell to use
SHELL=/bin/sh

#
# the compiler optimisation/debugging flags you wish to use.
# what C compiler to use.
#
CC=cc
CCOPTFLAGS =  -g   # -Wall #-O
LDFLAGS    =  -g   # -Wall #-O
# add additional definitions here
DEFS=-DHAVE_CONFIG_H

# use FLAGS for additional flags
CFLAGS = $(CCOPTFLAGS) $(DEFS) $(FLAGS)

# libraries you will need (found by config), add more to end
LIBS= -lsocket -lnsl

INSTALLCMD=/opt/gnu/bin/install -c
SHELL = /bin/sh

SRC=.

RANLIB=:

######### - no changes by configure after here #############


MACHINESFONTS= -DMACHINESFONTS=\"$(FONTDIR)/host_fonts\"
# Accounting shell location
ACCNTSH= -DACCNTSH=\"$(INSTDIR)/accounting.sh\"

# Font Path 
FONTPATH= -DFONTPATH=\"$(FONTDIR)\"
# Default font for the case that no entry exists for a 
# machine in previous file.
DEFLTFONT= -DDEFLTFONT=\"$(FONTDIR)/elot-928/c1201c.10\"

# OF FILTER NAME
PSOF= -DPSOF=\"psof\"

SRCDIRS=${SRC}/.
INCLUDE=.. ${SRC}/.
VPATH=$(subst :, ,$(INCLUDE) $(SRCDIRS))

FLAGS=  ${ACCNTSH} ${MACHINESFONTS} ${FONTPATH} ${DEFLTFONT} ${PSOF} \
	$(patsubst %,-I%,$(INCLUDE)) #-Wall

# commands made by this script
COMMANDS= ifhp accounting.sh banner.sh

.SUFFIXES: .sh .sh_init

.sh_init.sh:
	sed -e 's:_INSTDIR_:$(INSTDIR):g' \
		-e 's:_SHELL_:$(SHELL):g' \
		$^ >$@

all: ${COMMANDS}

.PHONY: all clean install lorder

#
# Object - Source  dependencies
#
IFOBJS = ifhp.o
LIB_OBJS = \
	banner.o do_monitor.o pr_pagecount.o sendjob.o open_trace.o \
	pr_duplex.o doaccnt.o get_info.o copyright.o \
	getpjlargs.o monitorport.o out_line.o page_set.o fonts.o \
	pfu.o pr_startjob.o check_job.o pr_endjob.o \
	pr_status.o pr_synch.o pr_timed.o pr_query.o readpipe.o \
	check_code.o get_num.o getcrstr.o port_read.o sendfont.o \
	setpcl_on.o signals.o wake_up.o file_read.o \
	args.o open_device.o stty.o wait_printer.o cleanup.o \
	strpr.o write_check.o writecn.o log.o setstatus.o \
	snprintf.o fexit.o \

lib_print.a: $(LIB_OBJS)
	ar ruv $@ $(LIB_OBJS)
	$(RANLIB) $@

ifhp:	$(IFOBJS) lib_print.a
	${CC} ${LDFLAGS} $^ ${LIBS} -o $@

$(IFOBJS) $(LIB_OBJS): hp4.h config.h common.h


#
# Installation of commands
#
install: all
	-mkdir -p $(INSTDIR)
	for i in $(COMMANDS) ; do \
		$(INSTALLCMD) -m 755 $$i $(INSTDIR); \
	done ;
	cd $(INSTDIR); rm -f ofhp; ln -s ifhp ofhp

#
# Miscellaneous
#

clean:
	-rm -f $(COMMANDS) *.o *.a core ?

lorder: $(LIB_OBJS)
	lorder $(LIB_OBJS) | tsort

ci: clean
	for i in * ; do \
		if [ -f $$i ]; then ci $(CI) -l -mUpdate -t-Initial $$i; fi; \
	done;

distclean:
	-rm -f Makefile
