# $Id: Makefile.in,v 1.1 1999/05/07 21:32:55 werner Exp $
#
# Makefile for divertctrl (Werner Cornelius 1999)
# Modified from loopctrl Makefile made by Fritz Elfert
#
#
SHELL			= /bin/sh
CFLAGS			= -Wall -O2
INCLUDES		= -I. -I@CONFIG_KERNELDIR@/include -I@CONFIG_KERNELDIR@/drivers/isdn/divert
DEFS			=
LDFLAGS			= -L../lib @LIBS@
PROGRAM			= divertctrl
MODULES			= divertctrl.o
MANPAGE			= divertctrl.8
INSTALL			= @INSTALL@
INSTALL_PROGRAM	= $(INSTALL) -o 0 -g 0 -m 0750
INSTALL_MAN		= $(INSTALL) -o 0 -g 0 -m 0644
prefix			= @prefix@
exec_prefix		= @exec_prefix@
ifeq (../.config,$(wildcard ../.config))
	include ../.config
	SBINDIR			= $(CONFIG_SBINDIR)
	mandir			= $(CONFIG_MANDIR)
else
	SBINDIR			= /sbin
	mandir			= @mandir@
endif
MAN8DIR			= $(mandir)/man8
CC				= @CC@

.SUFFIXES:
.SUFFIXES: .c .o

%.o: %.c
	$(CC) $(CFLAGS) $(INCLUDES) $(DEFS) -c -o $@ $<

all: $(PROGRAM)

config:
	@./configure

Makefile: Makefile.in config.status
	./config.status

config.status: configure
	./config.status --recheck

$(PROGRAM):	$(MODULES)
	$(CC) $(CFLAGS) $(INCLUDES) $(DEFS) $? $(LDFLAGS) -o $@

install-man: $(PROGRAM).man
	mkdir -p $(DESTDIR)$(MAN8DIR)
	$(INSTALL_MAN) $< $(DESTDIR)$(MAN8DIR)/$(MANPAGE)

install: $(PROGRAM) install-man
	$(INSTALL_PROGRAM) $(PROGRAM) $(DESTDIR)$(SBINDIR)/$(PROGRAM)

install-strip: $(PROGRAM)
	$(INSTALL_PROGRAM) -s $(PROGRAM) $(DESTDIR)$(SBINDIR)/$(PROGRAM)

uninstall:
	rm -f $(DESTDIR)$(SBINDIR)/$(PROGRAM) $(DESTDIR)$(MAN8DIR)/$(MANPAGE)

clean:
	rm -f *.o *~ $(PROGRAM)

distclean: clean
	rm -f config.status config.cache config.log Makefile divertctrl.man
