#
# Makefile for pixmap using XawPlus
# Version for Linux (XFree 3.2A or better)
# 
# Roland Krause 1997
#

LIB_PATH =	-L../../XawPlus -L/usr/X11/lib			# Path to Libraries
INC_PATH =	-I../../XawPlus -I/usr/X11/include -ISelFile	# Path to Header files
LIBRARIES =	-lXawPlus -lXmu -lXext -lXt -lXpm -lX11 -lm

CC =		gcc 

RGBFILE =	/usr/X11/lib/X11/rgb.txt
LIBS =		/usr/X11/lib
DEFS =		-O2 -m486 -DUSE_ATHENA -DRGBF=\"$(RGBFILE)\" -DAPPDEFDIR=\"$(LIBS)\"

OBJS =		SelFile/Dir.o SelFile/Draw.o SelFile/Path.o SelFile/SelFile.o \
		PixEdit.o Pixmap.o Dialog.o

SRCS =		SelFile/Dir.c SelFile/Draw.c SelFile/Path.c SelFile/SelFile.c \
		PixEdit.c Pixmap.c Dialog.c

all:		prog install
prog:		pixmap  pixmap.1x

# --- Clean up

clean:
		rm -f *.o SelFile/*.o *.1x pixmap

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

install:
		cp pixmap /usr/X11/bin
		cp Pixmap /usr/X11/lib/X11/app-defaults
		mkdir -p /usr/X11/include/X11/pixmaps
		cp pixmaps/*.xpm /usr/X11/include/X11/pixmaps
		cp pixmap.1x /usr/man/man1
		gzip /usr/man/man1/pixmap.1x

# --- Build pixmap

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

$(OBJS):	$(SRCS)
		$(CC) $(DEFS) $(INC_PATH) -o $@ -c $*.c

# --- Build the manual

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

