#
# Makefile for Ghostview using XawPlus
#
# This makefile don't build `app-dedaults.h' for you !
# If you change the resource file `Ghostview' and want to
# compile in your changes, run `run-ad2c' by hand.
# Version for S.u.S.E. Linux 4.4.1 (XFree 3.2A)
#
# Roland Krause 1997
#
LIB_PATH =	-L../../XawPlus -L/usr/X11/lib		# Libraries for X windows
INC_PATH =	-I../../XawPlus -I/usr/X11/include	# Header for X windows
LIBRARIES =	-lXawPlus -lXmu -lXext -lXt -lXpm -lX11 -lm

CC =		gcc 
DEFS =		-O2 -m486 -DFUNCPROTO=11 -DNARROWPROTO -DNON_BLOCKING_IO

OBJS =		Ghostview.o  callbacks.o  fileselect.o  main.o  ps.o \
		actions.o    dialogs.o    getenv.o      misc.o  setenv.o

all:		prog install
prog:		ghostview ghostview.1x

# --- Clean up

clean:
		rm -f *.o *.1x ghostview

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

install:
		cp ghostview /usr/X11/bin
		cp Ghostview /usr/X11/lib/X11/app-defaults
		mkdir -p /usr/X11/include/X11/pixmaps
		cp bitmaps/menu12.xpm /usr/X11/include/X11/pixmaps
		cp ghostview.1x /usr/man/man1
		gzip /usr/man/man1/ghostview.1x

# -- Build Ghostview

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

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

# --- Build manual

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


