#
# The Makefile for the solitaire game klondike
#
# This makefile uses the shared libraries
# just type make
#

# Uncomment the next two lines if you have GCC
#CC = gcc
#GNULIB = /usr/local/lib/gcc-gnulib

# Uncomment if you would like to see the original ByQ A of spades
BYQ=-DByQ

# Uncomment if you find the beeping annoying
#NOBEEP=-DNOBEEP

# Uncomment if the mouse refuses to let go of the cards
#	I need to define BADMOUSE when I compile with cc, but not with gcc
#	I do not know why:-(.  You should never need it.
#	I would like to hear if this works with cc and BADMOUSE undefined
BADMOUSE=-DBADMOUSE

CFLAGS = -O $(BADMOUSE) $(BYQ) $(NOBEEP)
LDFLAGS = -s
SHAREDLIB = /lib/crt0s.o /lib/shlib.ifile
NAME = klondike
BIN = /usr/games
MANDIR = /usr/man/man6
LINT = lint -xbp

SRC=klondike.c drag.c window.c cards.c spade.c heart.c club.c diamond.c other.c
OBJ=klondike.o drag.o window.o cards.o spade.o heart.o club.o diamond.o other.o

all: $(NAME)

$(NAME): $(OBJ)
	$(LD) $(LDFLAGS) -o $(NAME) $(SHAREDLIB) $(OBJ) $(GNULIB)

install: $(NAME)
	cp $(NAME) $(BIN)/$(NAME)
	chgrp bin $(BIN)/$(NAME)
	chown bin $(BIN/$(NAME)
	cp $(NAME).6 $(MANDIR)/$(NAME).6

clean:
	rm -f *.o core $(NAME)

shar:
	shar -h shar1 README Makefile klondike.6 cards.c diamond.c
	shar -h shar2 klondike.c club.c
	shar -h shar3 drag.c heart.c klondike.h window.c
	shar -h shar4 other.c spade.c
lint:
	$(LINT) $(SRC)

klondike.o : klondike.c klondike.h 
drag.o : drag.c klondike.h 
window.o : window.c klondike.h 
cards.o : cards.c klondike.h
club.o : club.c 
diamond.o : diamond.c 
heart.o : heart.c 
spade.o : spade.c 
other.o : other.c 

