#
# Makefile for xless using XawPlus
#
# Roland Krause 1997
#

LIB_PATH =	-L../../XawPlus -L/usr/X11/lib		# Libraries for X
INC_PATH =	-I../../XawPlus -I/usr/X11/include	# Header for X
LIBRARIES =	-lXawPlus -lXmu -lXext -lXt -lXpm -lX11

CC =		gcc 
DEFS =		-ansi -O2 -m486
OBJS =		regerror.o regexp.o regsub.o \
		actions.o functions.o init.o popup.o widgdump.o \
		callbacks.o help.o main.o util.o window.o

all:		prog install
prog:		xless xless.1x regexp.3

# --- Clean up

clean:
		rm -f *.o *.1x *.3 xless

# --- Install xless: This only works as superuser root

install:
		cp xless /usr/X11/bin
		cp XLess /usr/X11/lib/X11/app-defaults
		cp xless.help /usr/lib/X11
		cp xless.1x /usr/man/man1
		gzip /usr/man/man1/xless.1x
		cp regexp.3 /usr/man/man3
		gzip /usr/man/man3/regexp.3

# --- Build xless

xless:		$(OBJS)
		$(CC) -o xless $(LIB_PATH) $(OBJS) $(LIBRARIES)
		strip xless

.c.o:
		$(CC) $(DEFS) $(INC_PATH) -c $<

# --- Build the manuals

xless.1x:	xless.man
		nroff -man xless.man >xless.1x

regexp.3:	regexp.man
		nroff -man regexp.man >regexp.3

