# Makefile for "tt" - Tetris for Terminals (ie. not just workstations)
# ====================================================================

SOURCES = tt.c utils.c screen.c pieces.c game.c
HEADERS = tt.h utils.h screen.h pieces.h game.h 
OBJECTS = tt.o utils.o screen.o pieces.o game.o

CC = gcc 
LDFLAGS =
CFLAGS = -static
LINTFLAGS =	-abh -DLINT
LIBRARIES =	-lcurses -ltermcap
TIDYUP =	| egrep -v 'possible pointer alignment problem' \
		| egrep -v 'long assignment may lose accuracy'

# ---------------------------------------------------------------------------

tt		: $(OBJECTS)
		  $(CC) $(LDFLAGS) $(CFLAGS) $(OBJECTS) -o tt $(LIBRARIES)

ttl		:
		  lint $(LINTFLAGS) $(SOURCES) $(TIDYUP)

lint		:
		  lint $(LINTFLAGS) $(SOURCES)

tags		:
		  etags *.[ch]

clean		:
		  rm -f *.o tt a.out core

install		: tt
		  @cp -v tt /usr/local/bin
		  @cp -v tt.6 /usr/man/man6
		  chmod a+rw /usr/local/etc

# --------------------------------------------------------------------------

tt.o		: tt.c tt.h utils.h screen.h game.h

utils.o		: utils.c utils.h tt.h screen.h

screen.o	: screen.c screen.h tt.h pieces.h utils.h

pieces.o	: pieces.c pieces.h tt.h

game.o		: game.c game.h tt.h screen.h pieces.h utils.h

# --------------------------------------------------------------------------
