#
# Makefile for irchat
#
# $Id: Makefile,v 1.8 1994/07/29 09:13:37 tmo Exp tmo $
#

#
# If you don't have jwz's optimizing byte-compiler, uncomment the following
# lines.  A better idea would be to get it from archive.cis.ohio-state.edu
# in the file pub/gnu/emacs/elisp-archive/packages/bytecomp.tar.Z. It also
# comes with emacs19
#
# DEFSUBST_SRC=  defsubst.el
# DEFSUBST_BIN=  defsubst.elc
# DEFSUBST_LOAD= -l ./$(DEFSUBST_BIN)

EMACS	= emacs -batch -q -l ./setpath.el
TAR	= gtar
CC 	= gcc
LD	= $(CC)

# LDFLAGS for DCC 
# Sparc-Solaris2.3 & other SVR4?
LDFLAGS	= -lgen -lnsl -lsocket
# BSD 4.3, Solaris 1.1, Ultrix &c
# LDFLAGS	=
#
# You shouldn't need to change anything after this point.

OBJS 	= \
	irchat-filter.elc	\
	gnus-caesar.elc		\
	irchat-000.elc		\
	irchat-200.elc		\
	irchat-300.elc		\
	irchat-400.elc		\
	irchat-500.elc		\
	irchat-commands.elc	\
	irchat-copyright.elc	\
	irchat-cta.elc		\
	irchat-dcc.elc		\
	irchat-globals.elc	\
	irchat-handle.elc	\
	irchat-misc.elc		\
	irchat-timer.elc	\
	irchat-vars.elc		\
	irchat-main.elc

SRCS	= $(OBJS:.elc=.el)

all: irchat.elc dcc irchat

dcc:	dcc.o
	$(LD) -o $@ dcc.c $(LDFLAGS)

%.elc: %.el
	$(EMACS) -f batch-byte-compile $(DEFSUBST_SRC) $<

irchat.elc:	$(OBJS)
	rm -f $@
	cat $(OBJS) > $@

irchat:	irchat.texinfo
	$(EMACS) -batch -q irchat.texinfo \
		 -f texinfo-format-buffer -f save-buffer

clean: 
	-rm -f *.elc irchat dcc.o dcc

EXTRAS = 	README Makefile irchat.texinfo irchat-hooks.el	\
		dcc.c 		 				\
		defsubst.el setpath.el 				\
		irchat-inlines.el 				\
		irchat.elc

dist:	$(SRCS) $(EXTRAS)
	$(TAR) cf dist-`date +%d.%b.%Y`.tar $(SRCS) $(EXTRAS)
	compress dist-`date +%d.%b.%Y`.tar
