# Makefile for ncurses tests.

SHELL		= /bin/sh

srcdir		= @srcdir@
VPATH		= @srcdir@
prefix		= @prefix@
exec_prefix	= @exec_prefix@
libdir		= $(exec_prefix)/lib
includedir	= @includedir@

CC		= @CC@
CFLAGS		= @CFLAGS@
CPPFLAGS	= @INCLUDES@ -DHAVE_CONFIG_H

CCFLAGS		= $(CFLAGS) $(CPPFLAGS)

LINK		= $(CC)
LDFLAGS		= -L../lib -L$(libdir) @LD_MODEL@ -lmenu@DFT_ARG_SUFFIX@ -lpanel@DFT_ARG_SUFFIX@ -lncurses@DFT_ARG_SUFFIX@ @LDFLAGS@ @LIBS@

TESTS = \
	blue \
	bs \
	firework \
	gdc \
	hanoi \
	knight \
	ncurses \
	newdemo \
	rain \
	tclock \
	testcurs \
	view \
	worm \
	xmas 

.c.o:
	$(CC) -c $(CCFLAGS) $<

all: $(TESTS) 

blue: $(srcdir)/blue.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
bs: $(srcdir)/bs.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
firework: $(srcdir)/firework.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
gdc: $(srcdir)/gdc.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
hanoi: $(srcdir)/hanoi.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
knight: $(srcdir)/knight.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
ncurses: $(srcdir)/ncurses.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
newdemo: $(srcdir)/newdemo.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
rain: $(srcdir)/rain.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
tclock: $(srcdir)/tclock.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -lm -o $@
testcurs: $(srcdir)/testcurs.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
view: $(srcdir)/view.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
worm: $(srcdir)/worm.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@
xmas: $(srcdir)/xmas.c
	$(LINK) $(CCFLAGS) $(srcdir)/$@.c $(LDFLAGS) -o $@

install:

clean:
	-rm -rf *.o trace screendump t $(TESTS)

distclean: clean
	-rm -f Makefile

mostlyclean: clean

realclean: distclean
