# $Id: makefile.in,v 1.36 2005/10/19 22:50:13 tom Exp $
# Makefile-template for 'vttest'

THIS = vttest
RELEASE = 2

#### Start of system configuration section. ####

srcdir = .


x		= 
o		= .

CC		= cc
CPP		= cc -E
LINK		= $(CC)
LINT		= splint
INSTALL 	= /usr/bin/install -c -o root -g wheel
INSTALL_PROGRAM = install  -s -o root -g wheel -m 555
INSTALL_DATA	= install  -o root -g wheel -m 444

LIBS		= 
CFLAGS		= -fno-common 
LDFLAGS 	= 

prefix		= 
exec_prefix	= ${prefix}

bindir		= $(DESTDIR)${exec_prefix}/bin
mandir		= $(DESTDIR)${prefix}/man/man$(manext)
manext		= 1

#### End of system configuration section. ####

SHELL		= /bin/sh

DEFINES 	= -DHAVE_CONFIG_H -DRELEASE=$(RELEASE)
INCLUDES	= -I. -I$(srcdir)
CPPFLAGS	= $(DEFINES) $(INCLUDES)  -D_GNU_SOURCE

.SUFFIXES: .c .i $o

.c.i:
# compiling
	$(CPP) -E -C $(CPPFLAGS) $< >$@
.c$o:
# compiling
	$(CC) -c $(CPPFLAGS) $(CFLAGS) $<

C_SRC = \
	charsets.c \
	color.c \
	draw.c \
	esc.c \
	keyboard.c \
	main.c \
	mouse.c \
	nonvt100.c \
	printer.c \
	reports.c \
	reset.c \
	setup.c \
	sixel.c \
	status.c \
	tek4014.c \
	ttymodes.c \
	unix_io.c \
	vt220.c \
	vt320.c \
	vt420.c \
	vt52.c \
	xterm.c
H_SRC = \
	vttest.h \
	draw.h \
	esc.h \
	ttymodes.h
OBJS  = \
	charsets$o \
	color$o \
	draw$o \
	esc$o \
	keyboard$o \
	main$o \
	mouse$o \
	nonvt100$o \
	printer$o \
	reports$o \
	reset$o \
	setup$o \
	sixel$o \
	status$o \
	tek4014$o \
	ttymodes$o \
	unix_io$o \
	vt220$o \
	vt320$o \
	vt420$o \
	vt52$o \
	xterm$o

SRC =	patchlev.h \
	CHANGES COPYING README BUGS \
	$(THIS).1 \
	$(C_SRC) $(H_SRC) \
	tech.set \
	config.hin install.sh mkdirs.sh makefile.in configure.in

PROG	= $(THIS)$x

DISTFILES = MANIFEST configure $(SRC)

all:	$(PROG)

$(PROG): $(OBJS)
	$(LINK) $(CFLAGS) $(LDFLAGS) -o $(PROG) $(OBJS) $(LIBS)

$(OBJS): config.h $(THIS).h patchlev.h

install: all installdirs
	$(INSTALL_PROGRAM) $(PROG) $(bindir)/$(PROG)
	$(INSTALL_DATA) $(srcdir)/$(THIS).1 $(mandir)/$(THIS).$(manext)

installdirs:
	$(SHELL) ${srcdir}/mkdirs.sh $(bindir) $(mandir)

uninstall:
	rm -f $(bindir)/$(PROG)
	rm -f $(mandir)/$(THIS).$(manext)

mostlyclean:
	rm -f *.[oi] core *~ *.BAK *.trace *.atac

clean: mostlyclean
	rm -f $(PROG)

distclean: clean
	rm -f makefile config.log config.cache config.status config.h

realclean: distclean
	rm -f tags TAGS # don't remove configure!

tags:	$(C_SRC) $(HDRS)
	ctags $(C_SRC) $(HDRS)

TAGS:	$(C_SRC) $(HDRS)
	etags $(C_SRC) $(HDRS)

# I keep my sources in RCS, and assign a symbolic release to the current patch
# level.  The 'manifest' script knows how to build a list of files for a given
# revision.
MANIFEST: patchlev.h
#	manifest -rv$(RELEASE)`fgrep PATCHLEVEL patchlev.h | sed -e s'/^[^0-9]*/_/'`
	manifest -rd`fgrep PATCH_DATE patchlev.h | sed -e s'/^[^0-9]*//'`

dist: MANIFEST
	- rm -f .fname .files
	fgrep PATCH_DATE patchlev.h | sed -e 's/[^0-9.]//g' -e 's/^/$(THIS)-/' >.fname
	cat MANIFEST | grep ' ' | egrep -v ' subdirectory$$' | sed -e 's/\ .*//' | uniq >.files
	rm -rf `cat .fname`
	TOP=`cat .fname`; mkdir $$TOP `cat .files | grep / | sed -e 's@/.*@@' | sed -e s@\^@$$TOP/@ | uniq`
	for file in `cat .files`; do \
	  ln $(srcdir)/$$file `cat .fname`/$$file \
	    || { echo copying $$file instead; cp $$file `cat .fname`/$$file; }; \
	done
	tar -cf - `cat .fname` | gzip >`cat .fname`.tgz
	rm -rf `cat .fname` .fname .files

# Some of the output will be uuencoded because the test scripts include
# <CR><LF> terminated ".bat" files for MS-DOS.
dist-shar: MANIFEST
	- rm -f .fname .files
	fgrep PATCH_DATE patchlev.h | sed -e 's/[^0-9.]//g' -e 's/^/$(THIS)-/' >.fname
	cat MANIFEST | grep ' ' | egrep -v ' subdirectory$$' | sed -e 's/\ .*//' | uniq >.files
	shar -M -n`cat .fname` -opart -l50 `cat .files`
	- rm -f .fname .files

$(THIS)$o:	config.h

lint:
	$(LINT) $(CPPFLAGS) $(C_SRC)

check: $(PROG)
	@echo 'Sorry -- You must run this interactively.'


syntax highlighted by Code2HTML, v. 0.9.1