# Generated automatically from Makefile.in by configure.
# Makefile for ncurses source code.
#
# This makes the ncurses utility programs.
#
# The variable 'srcdir' refers to the source-distribution, and can be set with
# the configure script by "--srcdir=DIR".
#
# The rules are organized to produce the libraries for the configured models,
# and the programs with the configured default model.

srcdir = $(basedir)/progs
include ../misc/Makefile.inc

AUTO_SRC = termsort.c

PROGS = tic.exe toe.exe infocmp.exe clear.exe tput.exe tset.exe

TESTPROGS = mvcur.exe tctest.exe hardscroll.exe

################################################################################
all::	$(AUTO_SRC) $(PROGS) 

install: install.progs 

# this line simplifies the configure-script
install.libs:

install.progs: $(PROGS) $(bindir)
	$(INSTALL_PROGRAM) tic.exe $(bindir)/tic.exe
	$(INSTALL_PROGRAM) toe.exe $(bindir)/toe.exe
	$(INSTALL_PROGRAM) infocmp.exe $(bindir)/infocmp.exe
	$(INSTALL_PROGRAM) clear.exe $(bindir)/clear.exe
	$(INSTALL_PROGRAM) tput.exe $(bindir)/tput.exe
	$(INSTALL_PROGRAM) tset.exe $(bindir)/tset.exe
	@echo "linking captoinfo to tic"
	-@rm -f $(bindir)/captoinfo.exe
	-@$(LN_S) $(bindir)/tic.exe $(bindir)/captoinfo.exe
	@echo "linking reset to tset"
	-@rm -f $(bindir)/reset.exe
	-@$(LN_S) $(bindir)/tset.exe $(bindir)/reset.exe

#
# Utilities normally built by make all start here
#

tic.exe: $(MODEL)/tic.$O $(MODEL)/dump_entry.$O $(LIB_CURSES)
	 $(LINK) $(CFLAGS_DEFAULT) $? $(LDFLAGS) -o $@

toe.exe: $(MODEL)/toe.$O $(MODEL)/dump_entry.$O $(LIB_CURSES)
	 $(LINK) $(CFLAGS_DEFAULT) $? $(LDFLAGS) -o $@

clear.exe: $(MODEL)/clear.$O $(LIB_CURSES)
	 $(LINK) $(CFLAGS_DEFAULT) $? $(LDFLAGS) -o $@

tput.exe: $(MODEL)/tput.$O $(LIB_CURSES)
	 $(LINK) $(CFLAGS_DEFAULT) $? $(LDFLAGS) -o $@

infocmp.exe: $(MODEL)/infocmp.$O $(MODEL)/dump_entry.$O $(LIB_CURSES)
	 $(LINK) $(CFLAGS_DEFAULT) $? $(LDFLAGS) -o $@

tset.exe: $(MODEL)/tset.$O $(MODEL)/dump_entry.$O $(LIB_CURSES)
	 $(LINK) $(CFLAGS_DEFAULT) $? $(LDFLAGS) -o $@

termsort.c: ../include/Caps.filtered MKtermsort.sh
	sh -c "MKtermsort.sh $(AWK) ../include/Caps.filtered" >$@

#
# Test programs (not normally built by make all) start here.
#

# Cursor movement optimization tester. Use -g for debugging but -O if you're
# profiling with intent to determine COMPUTE_OVERHEAD
MVFLAGS = -O
mvcur.exe: ../ncurses/lib_mvcur.c $(MODEL)/dump_entry.$O $(LIB_CURSES)
	 $(LINK) $(CCFLAGS) -DTRACE -DMAIN $(MVFLAGS) $? $(LDFLAGS) -o $@

# Termcap-conversion tester
tctest.exe: ../ncurses/captoinfo.c $(LIB_CURSES)
	 $(LINK) $(CCFLAGS) -DTRACE -DMAIN $? $(LDFLAGS) -o $@

# Demonstrator/tester for hardware-scrolling algorithm.
hardscroll.exe: ../ncurses/hardscroll.c $(MODEL)/lib_trace.$O
	 $(LINK) $(CCFLAGS) -DTRACE -DMAINDEBUG $? $(LDFLAGS) -o $@

#
# Utility productions start here
#

tags:
	ctags *.[ch]

TAGS:
	etags *.[ch]

clean ::
	-rm -f tags TAGS do.tic *~
	-rm -f $(AUTO_SRC) $(TESTPROGS)
	-rm -f $(PROGS)

mostlyclean: clean

# These rules are used to allow "make -n" to work on a clean directory-tree
../include/hashsize.h \
../include/parametrized.h \
../include/term.h \
../include/Caps.filtered :
	cd ../include; $(MAKE) $(NC_MFLAGS)
$(LIB_CURSES) :
	cd ../ncurses; $(MAKE) $(NC_MFLAGS)

###############################################################################
# The remainder of this file is automatically generated during configuration
###############################################################################

SHARED_OBJS = \
	../obj_s/clear.obj \
	../obj_s/tic.obj \
	../obj_s/toe.obj \
	../obj_s/dump_entry.obj \
	../obj_s/infocmp.obj \
	../obj_s/tput.obj \
	../obj_s/tset.obj

clean ::
	rm -f $(SHARED_OBJS)

# Program modules (some are in ncurses lib!)

../obj_s/clear.obj :	clear.c \
			../include/term.h
	$(CC) $(CFLAGS_SHARED) -o $@ -c ../progs/clear.c

../obj_s/tic.obj :	tic.c \
			../include/term.h \
			$(INCDIR)/tic.h \
			dump_entry.h
	$(CC) $(CFLAGS_SHARED) -o $@ -c ../progs/tic.c

../obj_s/toe.obj :	toe.c \
			../include/term.h \
			$(INCDIR)/tic.h \
			dump_entry.h
	$(CC) $(CFLAGS_SHARED) -o $@ -c ../progs/toe.c

../obj_s/dump_entry.obj :	dump_entry.c \
			../include/term.h \
			$(INCDIR)/tic.h \
			dump_entry.h \
			../include/parametrized.h \
			termsort.c
	$(CC) $(CFLAGS_SHARED) -o $@ -c ../progs/dump_entry.c

../obj_s/infocmp.obj :	infocmp.c \
			../include/term.h \
			$(INCDIR)/tic.h \
			dump_entry.h
	$(CC) $(CFLAGS_SHARED) -o $@ -c ../progs/infocmp.c

../obj_s/tput.obj :	tput.c \
			../include/term.h
	$(CC) $(CFLAGS_SHARED) -o $@ -c ../progs/tput.c

../obj_s/tset.obj :	tset.c \
			../include/term.h
	$(CC) $(CFLAGS_SHARED) -o $@ -c ../progs/tset.c


NORMAL_OBJS = \
	../objects/clear.o \
	../objects/tic.o \
	../objects/toe.o \
	../objects/dump_entry.o \
	../objects/infocmp.o \
	../objects/tput.o \
	../objects/tset.o

clean ::
	rm -f $(NORMAL_OBJS)

# Program modules (some are in ncurses lib!)

../objects/clear.o :	clear.c \
			../include/term.h
	$(CC) $(CFLAGS_NORMAL) -o $@ -c ../progs/clear.c

../objects/tic.o :	tic.c \
			../include/term.h \
			$(INCDIR)/tic.h \
			dump_entry.h
	$(CC) $(CFLAGS_NORMAL) -o $@ -c ../progs/tic.c

../objects/toe.o :	toe.c \
			../include/term.h \
			$(INCDIR)/tic.h \
			dump_entry.h
	$(CC) $(CFLAGS_NORMAL) -o $@ -c ../progs/toe.c

../objects/dump_entry.o :	dump_entry.c \
			../include/term.h \
			$(INCDIR)/tic.h \
			dump_entry.h \
			../include/parametrized.h \
			termsort.c
	$(CC) $(CFLAGS_NORMAL) -o $@ -c ../progs/dump_entry.c

../objects/infocmp.o :	infocmp.c \
			../include/term.h \
			$(INCDIR)/tic.h \
			dump_entry.h
	$(CC) $(CFLAGS_NORMAL) -o $@ -c ../progs/infocmp.c

../objects/tput.o :	tput.c \
			../include/term.h
	$(CC) $(CFLAGS_NORMAL) -o $@ -c ../progs/tput.c

../objects/tset.o :	tset.c \
			../include/term.h
	$(CC) $(CFLAGS_NORMAL) -o $@ -c ../progs/tset.c

