# Generated automatically from Makefile.in by configure.
# $Id: Makefile.in,v 1.9 2004/01/04 20:52:37 deletek Exp $
#
# Makefile for the examples directory.
#

prefix = /usr/local
datadir = ${prefix}/share
mandir = ${prefix}/man
exec_prefix = ${prefix}
bindir = ${exec_prefix}/bin
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
includedir = ${prefix}/include
sysconfdir = ${prefix}/etc

CC = gcc
INSTALL = /usr/bin/install -c
CFLAGS = -g -O2  
LDFLAGS =    -lncurses  -lcdk

LINKIT	= $(CC) $(CFLAGS) $? -o $@ $(LDFLAGS)

all : replacer autowrr-wizard install-autowrr-conf

replacer : replacer.c ; $(LINKIT)

autowrr-wizard :		autowrr-wizard.c		; $(LINKIT) 
#
# Standard clean directives.
#
clean:
	$(RM) core *.o autowrr-wizard start.sh autowrr stop.sh wrr
distclean: clean
	$(RM) Makefile

install: all install-autowrr-man
	$(INSTALL) -m 755 autowrr $(DESTDIR)$(bindir)/
	$(INSTALL) -m 755 autowrr-wizard $(DESTDIR)$(bindir)/
	$(INSTALL) -d $(DESTDIR)$(sysconfdir)/autowrr
	$(INSTALL) -m 755 start.sh $(DESTDIR)$(sysconfdir)/autowrr/
	$(INSTALL) -m 755 htb $(DESTDIR)$(sysconfdir)/autowrr/
	$(INSTALL) -m 755 cbq $(DESTDIR)$(sysconfdir)/autowrr/
	$(INSTALL) -m 755 stop.sh $(DESTDIR)$(sysconfdir)/autowrr/

install-autowrr-conf:
	./replacer autowrr.in autowrr.tmp {sysconfdir} $(sysconfdir)
	./replacer autowrr.tmp autowrr {bindir} $(bindir)
	$(RM) autowrr.tmp
	./replacer start.sh.in start.sh {sysconfdir} ${sysconfdir}
	./replacer wrr.in wrr {sysconfdir} ${sysconfdir}
	./replacer stop.sh.in stop.sh {sysconfdir} ${sysconfdir}
	 chmod 755 start.sh stop.sh wrr
	
install-autowrr-man:

uninstall:
	$(RM) -f $(DESTDIR)$(bindir)/autowrr $(DESTDIR)$(bindir)/autowrr-wizard $(DESTDIR)$(sysconfdir)/autowrr/start.sh $(DESTDIR)$(sysconfdir)/autowrr/htb $(DESTDIR)$(sysconfdir)/autowrr/stop.sh $(DESTDIR)$(sysconfdir)/autowrr/cbq 
	@if test ! -f $(DESTDIR)$(sysconfdir)/autowrr/config; then \
		$(RM) -R $(DESTDIR)$(sysconfdir)/autowrr/; \
	fi;

