#
# standard Makefile for xonix
#
# Makefile.std,v 1.2 1995/08/28 11:00:39 j Exp

#PROJECTROOT=	/usr
PROJECTROOT=	/usr/X11R6

LIBDIR=		$(PROJECTROOT)/lib/X11
INCDIR=		$(PROJECTROOT)/include
BINDIR=		$(PROJECTROOT)/bin
MANDIR=		$(PROJECTROOT)/man/man1/

INSTALL_EXE=	install -c -s
#INSTALL_EXE=	cp
INSTALL_DAT=	install -c
#INSTALL_DAT=	cp
RM=		rm -f
MAKEDIRHIER=	mkdirhier
#MAKEDIRHIER=	mkdir -p

PROG=		xonix
XONIXDIR=	$(LIBDIR)/xonix
CUTE=		-DSEND_MAIL	# cute feature :-)

XAWLIBS=	-lXaw -lXmu -lXt -lX11 -lXt -lSM -lICE -lXExExt -lXext -lX11
XPMLIB=		-lXpm
SYSLIBS=	-lm -lgnumalloc

#COPTS=		-O2 -pipe -m486
COPTS=		-O
EXTRA_DEFINES=	-DUSE_X11 -DXONIXDIR=\"$(XONIXDIR)\" $(CUTE)
INCLUDES=	-I$(INCDIR)

SRCS=		xonix.c x11.c stack.c
OBJS=		xonix.o x11.o stack.o

CFLAGS=		$(COPTS) $(EXTRA_DEFINES) $(INCLUDES)

$(PROG): $(OBJS)
	$(CC) $(CFLAGS) -o $(PROG) $(OBJS) -L$(LIBDIR) \
	$(XAWLIBS) $(XPMLIB) $(SYSLIBS)

clean:
	$(RM) $(PROG) $(OBJS)

install:
	$(INSTALL_EXE) $(PROG) $(BINDIR)
	$(INSTALL_DAT) Xonix.ad $(LIBDIR)/app-defaults/Xonix
	if [ -d $(XONIXDIR) ] ; then	\
		exit 0;			\
	else				\
		( umask 0; $(MAKEDIRHIER) $(XONIXDIR) ) ; \
	fi

install.man:
	$(INSTALL_DAT) xonix.man $(MANDIR)/xonix.1

####################################################################
## dependencies
xonix.o: $(INCDIR)/X11/Xos.h $(INCDIR)/X11/Xosdefs.h
xonix.o: $(INCDIR)/X11/Intrinsic.h
xonix.o: $(INCDIR)/X11/Xlib.h $(INCDIR)/X11/X.h
xonix.o: $(INCDIR)/X11/Xfuncproto.h /usr/include/stddef.h
xonix.o: $(INCDIR)/X11/Xutil.h $(INCDIR)/X11/Xresource.h
xonix.o: $(INCDIR)/X11/Core.h $(INCDIR)/X11/Composite.h
xonix.o: $(INCDIR)/X11/Constraint.h $(INCDIR)/X11/Object.h
xonix.o: $(INCDIR)/X11/RectObj.h stack.h
x11.o: $(INCDIR)/X11/Xos.h $(INCDIR)/X11/Xosdefs.h
x11.o: $(INCDIR)/X11/Intrinsic.h $(INCDIR)/X11/Xlib.h
x11.o: $(INCDIR)/X11/X.h $(INCDIR)/X11/Xfuncproto.h
x11.o: $(INCDIR)/X11/Xutil.h
x11.o: $(INCDIR)/X11/Xresource.h $(INCDIR)/X11/Core.h
x11.o: $(INCDIR)/X11/Composite.h $(INCDIR)/X11/Constraint.h
x11.o: $(INCDIR)/X11/Object.h $(INCDIR)/X11/RectObj.h
x11.o: $(INCDIR)/X11/StringDefs.h $(INCDIR)/X11/keysym.h
x11.o: $(INCDIR)/X11/keysymdef.h $(INCDIR)/X11/Shell.h
x11.o: $(INCDIR)/X11/SM/SMlib.h $(INCDIR)/X11/SM/SM.h
x11.o: $(INCDIR)/X11/ICE/ICElib.h $(INCDIR)/X11/ICE/ICE.h
x11.o: $(INCDIR)/X11/xpm.h xonix.xbm xonix_mask.xbm d0.xbm d1.xbm
x11.o: d2.xbm d3.xbm d4.xbm d5.xbm d6.xbm d7.xbm d8.xbm d9.xbm colon.xbm
x11.o: flyer.xpm runner.xpm eater.xpm empty.xpm way.xpm filled.xpm
x11.o: $(INCDIR)/X11/Xaw/Form.h $(INCDIR)/X11/Xaw/Label.h
x11.o: $(INCDIR)/X11/Xaw/Simple.h
x11.o: $(INCDIR)/X11/Xmu/Converters.h
x11.o: $(INCDIR)/X11/Xaw/Box.h $(INCDIR)/X11/Xaw/Command.h
x11.o: $(INCDIR)/X11/Xaw/MenuButton.h
x11.o: $(INCDIR)/X11/Xaw/SimpleMenu.h
x11.o: $(INCDIR)/X11/Xaw/SmeLine.h $(INCDIR)/X11/Xaw/Sme.h
x11.o: $(INCDIR)/X11/Xaw/SmeBSB.h patchlevel.h xonix.h
stack.o: $(INCDIR)/X11/Xos.h
stack.o: $(INCDIR)/X11/Xosdefs.h $(INCDIR)/X11/Intrinsic.h
stack.o: $(INCDIR)/X11/Xlib.h $(INCDIR)/X11/X.h
stack.o: $(INCDIR)/X11/Xfuncproto.h
stack.o: $(INCDIR)/X11/Xutil.h $(INCDIR)/X11/Xresource.h
stack.o: $(INCDIR)/X11/Core.h $(INCDIR)/X11/Composite.h
stack.o: $(INCDIR)/X11/Constraint.h $(INCDIR)/X11/Object.h
stack.o: $(INCDIR)/X11/RectObj.h stack.h
