# Generated automatically from Makefile.in by configure.
# $Id: Makefile.in,v 1.15 1996/06/15 20:40:53 tom Exp $
################################################################################
# Copyright 1996 by Thomas E. Dickey <dickey@clark.net>                        #
# All Rights Reserved.                                                         #
#                                                                              #
# Permission to use, copy, modify, and distribute this software and its        #
# documentation for any purpose and without fee is hereby granted, provided    #
# that the above copyright notice appear in all copies and that both that      #
# copyright notice and this permission notice appear in supporting             #
# documentation, and that the name of the above listed copyright holder(s) not #
# be used in advertising or publicity pertaining to distribution of the        #
# software without specific, written prior permission. THE ABOVE LISTED        #
# COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,    #
# INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT #
# SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY SPECIAL,        #
# INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM   #
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE   #
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR    #
# PERFORMANCE OF THIS SOFTWARE.                                                #
################################################################################
# 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.

# turn off _all_ suffix rules; we'll generate our own
.SUFFIXES:

SHELL		= /bin/sh
THIS		= Makefile

NC_MFLAGS 	= $(MFLAGS)


MODEL		= ../objects
INSTALL_PREFIX	= 
srcdir		= .
prefix		= /boot
exec_prefix	= ${prefix}
bindir		= ${exec_prefix}/bin
includedir	= ${prefix}/include
datadir		= ${prefix}/share

ticdir		= $(datadir)/terminfo

INSTALL		= /bin/install -c
INSTALL_PROGRAM	= ${INSTALL}

AWK		= gawk

CC		= mwcc -I- -I. -I/boot/apps/GeekGadgets/include -L/boot/apps/GeekGadgets/lib -opt global -nodup
CFLAGS		=  

INCDIR		= $(srcdir)/../include
CPPFLAGS	= -I../progs -I$(srcdir)  -I. -I../include -I$(includedir) \
		  -DHAVE_CONFIG_H -DTERMINFO=\"$(ticdir)\"

CCFLAGS		= $(CPPFLAGS) $(CFLAGS)

CFLAGS_NORMAL	= $(CCFLAGS)
CFLAGS_DEBUG	= $(CCFLAGS) -g -DTRACE
CFLAGS_PROFILE	= $(CCFLAGS) -pg
CFLAGS_SHARED	= $(CCFLAGS) unknown

CFLAGS_DEFAULT	= $(CFLAGS_NORMAL)

LINK		= $(CC)
LDFLAGS		=    

LINT		= 
LINT_OPTS	= 
LINT_LIBS	= -lncurses 

AUTO_SRC = \
	termsort.c

PROGS = tic toe infocmp clear tput tset

TESTPROGS = mvcur tctest hardscroll hashmap

# Default library, for linking applications
LIB_CURSES = ../lib/libncurses.a

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

install: install.progs 

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

# Amiga hack - although we have links and they are ok to use in the build
# directory, it's not a good idea to link stuff in the install dir because
# the standard Amiga tools like "copy" don't understand them.

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

$(INSTALL_PREFIX)$(bindir) :
	$(srcdir)/../mkinstalldirs $@

#
# Utilities normally built by make all start here
#

DEPS_TIC = \
	$(MODEL)/tic.o \
	$(MODEL)/dump_entry.o \
	$(LIB_CURSES)
tic: $(DEPS_TIC)
	 $(LINK) $(CFLAGS_DEFAULT) $(DEPS_TIC) $(LDFLAGS) -o $@

DEPS_TOE = \
	$(MODEL)/toe.o \
	$(MODEL)/dump_entry.o \
	$(LIB_CURSES)
toe: $(DEPS_TOE)
	 $(LINK) $(CFLAGS_DEFAULT) $(DEPS_TOE) $(LDFLAGS) -o $@

DEPS_CLEAR = \
	$(MODEL)/clear.o \
	$(LIB_CURSES)
clear: $(DEPS_CLEAR)
	 $(LINK) $(CFLAGS_DEFAULT) $(DEPS_CLEAR) $(LDFLAGS) -o $@

DEPS_TPUT = \
	$(MODEL)/tput.o \
	$(LIB_CURSES)
tput: $(DEPS_TPUT)
	 $(LINK) $(CFLAGS_DEFAULT) $(DEPS_TPUT) $(LDFLAGS) -o $@

DEPS_INFOCMP = \
	$(MODEL)/infocmp.o \
	$(MODEL)/dump_entry.o \
	$(LIB_CURSES)
infocmp: $(DEPS_INFOCMP)
	 $(LINK) $(CFLAGS_DEFAULT) $(DEPS_INFOCMP) $(LDFLAGS) -o $@

DEPS_TSET = \
	$(MODEL)/tset.o \
	$(MODEL)/dump_entry.o \
	$(LIB_CURSES)
tset: $(DEPS_TSET)
	 $(LINK) $(CFLAGS_DEFAULT) $(DEPS_TSET) $(LDFLAGS) -o $@

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

#
# 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
DEPS_MVCUR = \
	$(srcdir)/../ncurses/lib_mvcur.c \
	$(MODEL)/dump_entry.o \
	$(LIB_CURSES)
mvcur: $(DEPS_MVCUR)
	 $(LINK) $(CCFLAGS) -DTRACE -DMAIN $(MVFLAGS) $(DEPS_MVCUR) $(LDFLAGS) -o $@

# Termcap-conversion tester
DEPS_TCTEST = \
	$(srcdir)/../ncurses/captoinfo.c \
	$(LIB_CURSES)
tctest: $(DEPS_TCTEST)
	 $(LINK) $(CCFLAGS) -DTRACE -DMAIN $(DEPS_TCTEST) $(LDFLAGS) -o $@

# Demonstrator/tester for hardware-scrolling algorithm.
DEPS_HARDSCROLL = \
	$(srcdir)/../ncurses/hardscroll.c \
	$(MODEL)/lib_trace.o	
hardscroll: 
	 $(LINK) $(CCFLAGS) -I$(srcdir)/../ncurses -DTRACE -DSCROLLDEBUG $(DEPS_HARDSCROLL) $(LDFLAGS) -o $@

# Demonstrator-tester for enhanced hardware-scrolling code with hash mapping
DEPS_HASHMAP = \
	$(srcdir)/../ncurses/hashmap.c \
	$(srcdir)/../ncurses/hardscroll.c \
	$(MODEL)/lib_trace.o	
hashmap: $(DEPS_HASHMAP)
	 $(LINK) $(CCFLAGS) -I$(srcdir)/../ncurses -DTRACE  -DHASHDEBUG $(DEPS_HASHMAP) -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)

distclean :: clean
	-rm -f Makefile

mostlyclean :: clean

realclean :: distclean

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

lint:
	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c                          $(LINT_LIBS)
	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS)
	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tic.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c     $(srcdir)/dump_entry.c $(LINT_LIBS)
	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c                           $(LINT_LIBS)
	$(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c    $(srcdir)/dump_entry.c $(LINT_LIBS)

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

# generated by mk-0th.awk


lintlib :
	@echo no action needed

# generated by mk-1st.awk

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

$(NORMAL_OBJS) : ../include/config.h ./progs.priv.h

clean ::
	rm -f $(NORMAL_OBJS)

# generated by mk-2nd.awk


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

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

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

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

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

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

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

