#******************************************************************************
#
# ULTRIX makefile for pipe V2.2
#
# Michael Muller
# February 10, 1992
#
# INSTRUCTIONS:
#
# 0) You need the Motif developer's kit to build pipe.
#
# 1) Change INSTALL_LOC and INSTALL_DIR to indicate where pipe should be 
#    installed.  (This makefile assumes that there exists a subdirectory 
#    named INSTALL_DIR under INSTALL_LOC.)  If desired, you can also
#    change the names and locations of the help, high score, and 
#    executable files.  The game is set up to run properly as long as 
#    the game, uid files, score file, and help file are located in 
#    your present working directory. 
#
#	Note: not in this makefile you don't.
#	Pete Kaiser
#	12 February 1992
#
# 2) Make sure MOTIF_TOP is defined to be /usr/lib/DXV for VAXen and 
#    /usr/lib/DXM for MIPS RISC machines.
#
# 3) Enable superuser if neccesary to write to INSTALL_LOC, make sure 
#    your present working directory is the same as where this file 
#    and the rest of the source is.
#
# 4) Optional.  You can delete the source now.  All essential files have 
#    been copied to INSTALL_LOC. 
#
#******************************************************************************

# The installation location: where should the finished product be placed?

INSTALL_LOC     =
INSTALL_DIR     =
EXE_NAME        = pipe

# Motif directories, libs and includes

MOTIF_TOP        = /usr/lib/DXM
MOTIF_UIL_DIR    = $(MOTIF_TOP)/clients/uil
MOTIF_LIB_DIR    = $(MOTIF_TOP)/lib

# Parameters for compilation & linking

INCLUDES = -I$(MOTIF_LIB_DIR) \
           -I$(MOTIF_LIB_DIR)/Mrm \
           -I$(MOTIF_LIB_DIR)/Xm \
           -I$(MOTIF_LIB_DIR)/Xt \
           -I$(MOTIF_LIB_DIR)/Xt/X11

LIBS = $(MOTIF_LIB_DIR)/Mrm/libMrm.a \
       $(MOTIF_LIB_DIR)/Xm/libXm.a \
       $(MOTIF_LIB_DIR)/Xt/libXt.a \
       -lX11 \
       -lm

DEFINES = -D_MOTIF \
          -DUID_LOC='""' \
          -DHELP_LOC='""' \
          -DHIGH_SCORE_LOC='""'

CFLAGS = -s -O $(DEFINES) $(INCLUDES) 

# Rules for updating sources

.SUFFIXES : .uil .uid

.uil.uid :
	$(MOTIF_UIL_DIR)/uil -o $@ $< -I$(MOTIF_UIL_DIR)

.c.o :
	cc -c $(CFLAGS) $*.c

# Dependencies

all: pipe_widgets.uid pipe_icons.uid $(EXE_NAME)
	@echo 'You can run pipe now.  It must be run from the'
	@echo 'where the executable, UID files, help file, and'
	@echo 'score file are all found.'
	@echo
	@echo 'Send comments to: '
	@echo '  Michael Muller'
	@echo '  muller@nodex.enet.dec.com'
	@echo

pipe: pipe.o
	cc -s $(CFLAGS) pipe.o -o $(EXE_NAME) $(LIBS)
