SHELL=/bin/sh
INSTALL= mv
CFLAGS= -O
SRCS= conf.c confrw.c confrots.c confopts.c confalloc.c confstr.c confprnt.c confsig.c
OBJS= conf.o confrw.o confrots.o confopts.o confalloc.o confstr.o confprnt.o confsig.o
HEADERS= conf.h config.h extern.h structs.h
NEW= xconf
NAME= conf
LISP= conf.el
MAKES= Makefile
DOCDIR= doc
CONFLIB= /usr/lib/conf
CONFSPOOL= /usr/lib/conf
BINDIR= /usr/local/bin
LINT=lint
OWNER=bin
GROUP=bin

LIBS= -ltermlib -lx

$(NEW): $(OBJS)
	$(CC) $(CFLAGS) $(OBJS) $(LIBS) -o $(NEW)

all: $(NEW)

clean:
	rm -f *.o $(NEW) core

shar:
	shar MANIFEST Makefile conf.c conf.el > confshar.1
	shar conf.h confalloc.c config.h confopts.c > confshar.2
	shar confprnt.c confrots.c confrw.c > confshar.3
	shar confsig.c confstr.c extern.h structs.h > confshar.4
	shar doc > confshar.5

lint:
	$(LINT) $(LIBS) $(SRCS)

install:
	cp $(NEW) $(BINDIR)/$(NAME)

	-mkdir $(CONFLIB)

	cp confhelp $(CONFLIB)
	-chgrp $(GROUP) $(CONFLIB) $(CONFLIB)/confhelp $(BINDIR)/$(NAME)
	-chown $(OWNER) $(CONFLIB) $(CONFLIB)/confhelp $(BINDIR)/$(NAME)
	-chmod u+s $(BINDIR)/$(NAME)
	-chmod 644 $(CONFLIB)/confhelp
	-chmod 755 $(CONFLIB)
