# Generated automatically from Makefile.in by configure.
# IRC II - written by Michael Sandrof
# Copyright (c) 1991 - All Rights Reserved
# Modified by Matthew Green, 1993.
#
# @(#)Makefile,v 1.2 1995/12/07 21:07:10 prb Exp

# targets recognised by this makefile:
#   all, everything	- compiles ircii, ircserv, ircflush and wserv
#   ircserv		- compiles ircserv
#   ircflush		- compiles ircflush
#   wserv		- compiles wserv
#   install		- installs ircii, ircserv, ircflush and wserv the scripts
#			  and the translation tables.
#   installirc		- installs ircii
#   installserv		- installs ircserv
#   installwserv	- installs wserv
#   installflush	- installs ircflush
#   installscript 	- installs the scripts
#   installtranslation	- installs the translation tables
#   installeverything   - all of the above
#   clean               - remove all .o files, core, and binaries
#   disclean            - remove all files geneated by compilation/installation.

prefix = /usr/contrib
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin

# Where the ircII binary will be installed.
# 'make install' will compile and install the program
INSTALL_IRC = $(bindir)/irc

# Where the ircII library will be.  Generally this is the place that
# you put the scripts, help pages and translation tables.  It is
# very important that you set this correctly.
IRCLIB = ${prefix}/lib/irc

# Set this to the lex you want to use, and if they lex uses a library.

LEX = lex
LEXLIB = -ll

CC = gcc
DEFS = -DHAVE_CONFIG_H
LIBS = -ltermcap

# Set this to -g if you want to be able to debug the client, otherwise
# use -O to have the compiler do some optimization instead.
# CFLAGS = -g -O
CFLAGS = -O

# Set this to -s if you want the binary to be striped.
LDFLAGS = -s

# these are legacy things from ircii 2.2 that haven't yet been
# handled with autoconf.

# For Apollo systems (10.2 and upwards) use the following with BSD defaults:
# DEFS = -Asys,bsd4.3

# Use one of the following for mips systems:
# Choice 1, if your system has the wait3() call
# DEFS = -systype bsd43
# Choice 2, if your system has the wait2() call
# DEFS = -systype bsd43 -Duse_wait2
#
# Or, if you only have sysv installed, use one of the following:
# DEFS = -DMIPS_SYSV
# DEFS = -DMIPS_SYSV -Duse_wait2

## You probably don't need to change anything below this line

# Uncomment the following if you want a secure IRC which binds to a
# privileged port. This feature is completely useless in the current
# IRC environment, but in the future some servers may use privileged
# port systems to verify users connecting to them. The value of
# PRIV_PORT determines the minimum port number to use.
# If you modify these (including uncommenting them) you will need to
# touch config.h
#
# If you are on a system where test-suid works, you can simply define
# PP_DEFS to be PRIV_PORT_ULC and irc will change effective UID back
# to a normal user immediately, and change to root when binding a port.
# This feature is undocumented, but is known to work on Sun, MIPS and
# Apollo (Cos we've tested them already).
# PP_DEFINES = -DPRIV_PORT=667
# PP_OBJS = file.o
# PP_DEFINES = -DPRIV_PORT_ULC

# Full path of the directory for ircII help files.  
# The help files are not within the source distribution, if you don't have
# them and want them, check out your nearest ircII archive.
# You may comment HELP_DIR, then the ircIIhelp service will be used.
# If you don't comment it out and want to use the IRCIIHelp service anyway,
# you must make sure that the directory doesn't exist.
HELP_DIR = $(IRCLIB)/help

# Full path of the directory in which to copy the
# IRCII scripts supplied with the code.  These scripts
# may be loaded by using the LOAD command in IRCII.
INSTALL_SCRIPT = $(IRCLIB)/script

# Default setting for IRC_PATH where irc will look for
# its script files if the environment variable is undefined.
# Usually, this should contain the same path as used for INSTALL_SCRIPT in
# the Makefile, but it can contain multiple path elements
# separated by colons. The path MUST lead to an existing directory,
# because the 'global' script is expected to be found there.
IRC_PATH = ~/.irc:$(INSTALL_SCRIPT):.

# Path for TRANSLATION variable.
TRANS_PATH = $(IRCLIB)/translation

# Set the next line to the full path for installation of the ircserv program
# if you wish to use it. 
INSTALL_IRCSERV = $(bindir)/ircserv

# This little program is necessary to have an interactive shell
# in a window of ircII. The 'shell' script uses it, so also update
# the path in there, if you want to enable this.
INSTALL_IRCFLUSH = $(bindir)/ircflush

# This program allows you to use screen/xterm's to put new irc windows
# on new screen/xterm windows.
INSTALL_WSERV = $(bindir)/wserv

## You shouldn't have to change anything below here

srcdir = .

RM = rm -f
LN = ln -s
CP = cp
MV = mv
INSTALL = ./bsdinstall -c -m 755
INSTALL_DATA = ../bsdinstall -c -m 644

VERSION = 2.8.2

SHELL = /bin/sh
MAKE = make $(MFLAGS)
MFLAGS ='CC=$(CC)'					\
	'CFLAGS=$(CFLAGS)'				\
	'DEFS=$(DEFS)'					\
	'HELP_DIR=$(HELP_DIR)'				\
	'INSTALL_IRC=$(INSTALL_IRC)'			\
	'INSTALL_IRCSERV=$(INSTALL_IRCSERV)'		\
	'INSTALL_WSERV=$(INSTALL_WSERV)'		\
	'IRCLIB=$(IRCLIB)'				\
	'IRCPATH=$(IRC_PATH)'				\
	'LDFLAGS=$(LDFLAGS)'				\
	'LEX=$(LEX)'					\
	'LEXLIB=$(LEXLIB)'				\
	'LIBS=$(LIBS)'					\
	'LN=$(LN)'					\
	'PP_DEFS=$(PP_DEFS)'				\
	'PP_OBJS=$(PP_OBJS)'				\
	'PPS_DEFS=$(PPS_DEFS)'				\
	'RM=$(RM)'					\
	'TRANS_DIR=$(TRANS_PATH)'

all: irc ircserv ircflush wserv

install: all installbin installscript installtranslation

irc: source/Makefile Makefile
	@cd source; $(MAKE) all

installeverything: install installflush installserv installwserv \
	installscript installtranslation

everything: all ircflush ircserv wserv

ircserv: source/Makefile
	@cd source; $(MAKE) ircserv

ircflush: source/ircflush.c source/Makefile
	@cd source; $(MAKE) ircflush

wserv: source/wserv.c source/term.c source/Makefile
	@cd source; $(MAKE) wserv

installbin: installirc installserv installflush installwserv

installirc: irc installdirs
	$(INSTALL) source/irc $(INSTALL_IRC)-$(VERSION)
	@if test -f $(INSTALL_IRC).old; then $(RM) $(INSTALL_IRC).old; fi
	@if test -f $(INSTALL_IRC); then $(MV) $(INSTALL_IRC) $(INSTALL_IRC).old; fi
	$(RM) $(INSTALL_IRC)
	$(LN) $(INSTALL_IRC)-$(VERSION) $(INSTALL_IRC)

installscript: installdirs
	-chmod -x script/*
	-@(								\
		if test -f $(INSTALL_SCRIPT)/local; then		\
			if test -f script/local; then 			\
				$(MV) script/local script/local.orig;	\
			fi;						\
		fi							\
	)
	cd script; for i in *; do if [ ! $$i = CVS ] ; then $(INSTALL_DATA) $$i $(INSTALL_SCRIPT); fi; done

installtranslation: installdirs
	-chmod -x translation/*
	cd translation; for i in *; do if [ ! $$i = CVS ] ; then $(INSTALL_DATA) $$i $(TRANS_PATH); fi ; done

installserv: ircserv installdirs
	$(INSTALL) source/ircserv $(INSTALL_IRCSERV)

installflush: ircflush installdirs
	$(INSTALL) source/ircflush $(INSTALL_IRCFLUSH)

installwserv: wserv installdirs
	$(INSTALL) source/wserv $(INSTALL_WSERV)

installhelp:
	@echo Help files are no more within this package.  You
	@echo can probably get them from the same place you got
	@echo this source from.

installdirs:
	umask 022; ./mkinstalldirs $(IRCLIB) $(bindir) $(TRANS_PATH) $(INSTALL_SCRIPT)

clena clean:
	@-if test -f source/Makefile; then cd source; $(MAKE) clean; fi

distclean cleandir realclean: clean
	$(RM) Makefile source/Makefile source/sig.inc config.status config.cache config.log easyinst.status include/defs.h

lint:
	@if test -f source/Makefile; then cd source; $(MAKE) lint; fi

autoconf: configure

configure: configure.in acconfig.h
	autoconf

autoheader: include/defs.h.in

include/defs.h.in: configure.in acconfig.h
	autoheader

config_h:
	$(RM) include/config.h
	ln include/config.h.dist include/config.h

export: distclean autoconf autoheader config_h

dist: export
	( \
		cd ..; \
		tar --exclude .CVS -z -c -f ircii-$(VERSION).tar.z ircii; \
	)
