# $Id: Makefile.in,v 1.4 1997/03/29 15:05:27 fritz Exp $
#
# Makefile for pcbitctl
# (C) 1997 Fritz Elfert
#
#
SHELL			= /bin/sh
CFLAGS			= -Wall -Wstrict-prototypes -O2 -g
INCLUDES		= -I. -DDEBUG -I@KERNELDIR@/drivers/isdn/pcbit
LDFLAGS			= -L../lib @LIBS@
PROGRAM			= pcbitctl
MODULES			= pcbitctl.o convhexbin.o
MANPAGE			= pcbitctl.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,$(widcard ../.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) -c -o $@ $<

all: $(PROGRAM)

config:
	@./configure

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

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

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

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

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

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

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

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

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