# Generated automatically from Makefile.in by configure.
#
# Xtend is Copyright (C) 1998 David M. Shaw <dshaw@jabberwocky.com>
# 
#    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.
# 
# $Id: Makefile.in,v 1.1.2.2 1999/02/10 23:29:15 dshaw Exp $

SHELL=/bin/sh

# Stuff passed in from configure

CC=gcc
prefix=/usr
exec_prefix=${prefix}
bindir=${exec_prefix}/bin
mandir=${prefix}/man
srcdir=.
FLAGS=-Wall -g -O2 -DHAVE_CONFIG_H
LDFLAGS=
INSTALL=/usr/bin/install -c
INSTALL_PROGRAM=${INSTALL}
INSTALL_DATA=${INSTALL} -m 644

# Uncomment this line if you want to change the environment variable
# behavior slightly - with NO_APPL_ENV enabled, if an appliance is OFF,
# Xtend will not put it in the environment at all.  This is useful if you
# don't want to bother seeing lots of notifications that "unit so-and-so is
# an appliance" unless it's on.
# DEFINES=-DNO_APPL_ENV

#############################################################
# You shouldn't need to change anything under here

VERSION=1.2beta4
CFLAGS=$(FLAGS) $(DEFINES)
DISTFILES=COPYING README INSTALL ANNOUNCE FAQ ChangeLog \
	exec.h parse.h util.h x10.h \
	exec.c parse.c util.c xtend.c unsetenv.c strerror.c \
	Makefile.in Makefile.old config.h.in sample-xtendrc \
	*.1 configure.in configure tools/xtend.pm tools/xtend.bash \
	tools/status tools/status2 tools/status.bash \
	tools/parse-status tools/README install-sh

PROGS=xtend

all: $(PROGS)
	@echo "Built $(PROGS) version $(VERSION)"
clean:
	rm -f *.o *.core core $(PROGS)

exec.o: exec.h x10.h util.h config.h
util.o: util.h x10.h config.h
xtend.o: util.h parse.h x10.h exec.h version.h config.h
parse.o: parse.h x10.h config.h
unsetenv.o: config.h

.c.o:
	$(CC) -I. -I$(srcdir) $(CFLAGS) -c $< -o $@

uninstall:
	@rm -f $(DESTDIR)$(bindir)/xtend $(DESTDIR)$(mandir)/man1/xtend.1

install-strip:	install
	@strip $(DESTDIR)$(bindir)/xtend

distclean:	clean
	rm -f config.cache config.h config.status Makefile

xtend:	xtend.o util.o parse.o exec.o 
	$(CC) $(LDFLAGS) xtend.o util.o parse.o exec.o  -o xtend

install: $(PROGS)
	-mv $(bindir)/xtend $(bindir)/xtend.old
	${INSTALL_PROGRAM} -m 555   xtend $(DESTDIR)$(bindir)
	${INSTALL_DATA} xtend.1 $(DESTDIR)$(mandir)/man1

config.h.in: configure acconfig.h
	autoheader
	@touch config.h.in

configure: configure.in
	autoconf
	@touch configure.in

version.h: Makefile
	rm -f version.h
	echo '#define VERSION "$(VERSION)"' > version.h

dist:	xtend-$(VERSION).tar.gz LSM

MANIFEST: $(DISTFILES)
	rm -f MANIFEST
	for i in $(DISTFILES); \
	do echo xtend-$(VERSION)/$$i >> MANIFEST; done

xtend-$(VERSION).tar.gz: MANIFEST version.h config.h.in configure
		rm -f xtend-$(VERSION).tar.gz
		(cd ..; tar -cvf - `cat xtend-$(VERSION)/MANIFEST` \
		 xtend-$(VERSION)/MANIFEST \
		 | gzip -9 > xtend-$(VERSION)/xtend-$(VERSION).tar.gz;)

LSM:	version.h xtend-$(VERSION).tar.gz
	rm -f LSM
	echo "Begin3" > LSM
	echo "Title: Xtend: The X10 to UNIX controller" >> LSM
	echo "Version: $(VERSION)" >> LSM
	echo "Entered-date: `date +%d%b%y | tr a-z A-Z`" >> LSM
	echo "Description: xtend is a daemon that is used in combination with a" >> LSM
	echo "	CM11a X10 interface that hooks to one of your serial ports." >> LSM
	echo "	It executes arbitrary shell commands depending on what X10" >> LSM
	echo "	commands it sees." >> LSM
	echo "Keywords: X10 home automation" >> LSM
	echo "Author: dshaw@jabberwocky.com (David Shaw)" >> LSM
	echo "Primary-site: ftp.jabberwocky.com /pub/xtend/" >> LSM
	echo "	`ls -s xtend-$(VERSION).tar.gz | sed 's/ *\([0-9]*\).*/\1/g'` kB xtend-$(VERSION).tar.gz" >> LSM
	echo "Copying-policy: GPL" >> LSM
	echo "End" >> LSM
