#
# Generated automatically from Makefile.in by the
# configure script.
#

#
# Master Makefile for man, apropos, whatis, and makewhatis
#
# Copyright (c) 1990, 1991, John W. Eaton.
#
# You may distribute under the terms of the GNU General Public
# License as specified in the README file that comes with the man 1.0
# distribution.  
#
# John W. Eaton
# jwe@che.utexas.edu
# Department of Chemical Engineering
# The University of Texas at Austin
# Austin, Texas  78712
#
# various changes - aeb, March 1994
# use of catalogs - aeb, June 1994

SHELL = /bin/sh

#### Start of system configuration section. ####

CC = cc
INSTALL = install

pager = /bin/less -is

DEFS =  -DSTDC_HEADERS -DPOSIX -DUSG -DALLOCA_MISSING -DNONLS -DNOGETOPT -DDO_COMPRESS

# CDEBUG = -g
# LDFLAGS = -g
CDEBUG =
CFLAGS = $(CDEBUG) -I. $(DEFS)
LDFLAGS = -s

# Where to install the executables.
bindir = $(BINROOTDIR)/usr/bin
# Where to put man.config
libdir = $(BINROOTDIR)/usr/lib
man_config_file = $(BINROOTDIR)/usr/lib/man.config

LIBOBJS = 

#### End of system configuration section. ####

all: man man.config apropos whatis makewhatis

MANOBJS = man.o manpath.o man-config.o getopt.o different.o \
	gripes.o glob.o util.o msg.o

man: $(MANOBJS) $(LIBOBJS)
	$(CC) $(LDFLAGS) -o man $(MANOBJS) $(LIBOBJS) $(LIBS)

msg.c gripes.h: ../msgs/mess.en makemsg
	./makemsg ../msgs/mess.en gripes.h msg.c

man.o: version.h
man-config.o: paths.h
man.o manpath.o gripes.o util.o: gripes.h
man.o manpath.o getopt.o man-config.o: man.h
glob.o: ndir.h
msg.o: msg.c

man.config:	man.config.in ../conf_script
	../conf_script man.config

paths.h:	paths.h.in ../conf_script
	../conf_script paths.h

apropos: apropos.sh Makefile
	sed -e 's,%libdir%,/usr/lib,' -e 's,%bindir%,/usr/bin,' \
	    -e 's,%pager%,/bin/less -is,' -e 's,%manpathoption%,-w,' \
		apropos.sh > apropos

whatis: whatis.sh Makefile
	sed -e 's,%libdir%,/usr/lib,' -e 's,%bindir%,/usr/bin,' \
	    -e 's,%pager%,/bin/less -is,' -e 's,%manpathoption%,-w,' \
		whatis.sh > whatis

install: all apropos whatis makewhatis
	$(INSTALL) -c  man $(BINROOTDIR)/usr/bin/man
	$(INSTALL) -c -m 755 apropos $(BINROOTDIR)/usr/bin/apropos
	$(INSTALL) -c -m 755 whatis $(BINROOTDIR)/usr/bin/whatis
	$(INSTALL) -c -m 754 makewhatis $(BINROOTDIR)/usr/lib/makewhatis
	$(INSTALL) -c -m 644 man.config $(BINROOTDIR)/usr/lib/man.config

clean:
	rm -f *.o *~ core man apropos whatis makewhatis makemsg

spotless: clean
	rm -f Makefile config.status paths.h man.config
	rm -f gripes.h msg.c mess.*.cat
