#	Makefile for the Nolan Quiz Program

#
# System type flags.  
#
# Try these for any system using ncurses
SYSTYPE = -DUNIX -DNCURSES
INCDIR = -I/usr/local/include
CFLAGS  = -O $(SYSTYPE) $(INCDIR)
LIBS = -L/usr/local/lib -lncurses
LDFLAGS = -s $(LIBS)

# Flags for System V Release 4 using native curses
# SYSTYPE=-DUNIX -DCURSES -DATT
# CFLAGS  = -O $(SYSTYPE)
# LDFLAGS = -s
# LIBS = -lcurses

# Flags for AT&T System V Release 3.2
# SYSTYPE=-DUNIX -DCURSES
# CFLAGS  = -O $(SYSTYPE)
# LDFLAGS = -s
# LIBS = -lcurses

# Try these for Linux. You *must* use the ncurses package for this, it 
# won't work with the curses that comes with the gcc libs.
# SYSTYPE=-DUNIX -DNCURSES -DBSD
# CFLAGS  = -O6 -fomit-frame-pointer $(SYSTYPE)
# LDFLAGS = -s
# LIBS = -lncurses

# Try these for SunOS 4.1
# SYSTYPE=-DUNIX -DCURSES -DATT
# CC=/usr/5bin/cc
# INCDIR = -I/usr/5include -I/usr/include
# CFLAGS  = -O $(SYSTYPE) $(INCDIR)
# LDFLAGS = -s
# LIBS = -L/usr/5lib

nolan: nolan.o screen.o
	$(CC) $(LDFLAGS) nolan.o screen.o $(LIBS) -o nolan

nolan.o: nolan.c script.h

script.h: nolan.script compilescript
	compilescript >script.h

lint:
	lint $(CFLAGS) nolan.c screen.c -lcurses

clean:
	rm -f nolan nolan.shar nolan.arc nolan.tar *.o *~

SOURCES = READ.ME Makefile compilescript nolan.script nolan.[c1] screen.[ch] nolan.lsm

nolan.shar:
	shar $(SOURCES) >nolan.shar

nolan.tar:
	tar cvf nolan.tar $(SOURCES)
nolan.tar.gz: nolan.tar
	gzip nolan.tar

arc: script.h
	arc Makefile nolan.arc nolan.c screen.[ch] script.h

