srcdir = .
VPATH = .

CC = gcc  
#CC = cc  
#INSTALL = /bin/install -c
INSTALL = /bin/cp
INSTALL_PROGRAM = $(INSTALL)

DEFS = -DUSG -Dunix

CFLAGS = -O6
#CFLAGS = -O
#LDFLAGS = -g
LDFLAGS = -s

#LIBS = -ltermcap
LIBS = -lterm

# Colon-separated list of directories in which to look for info files.
DEFAULT_INFOPATH = .:$(infodir):/usr/emacs/info:/usr/Emacs/info:/usr/local/emacs/info

# Command used to print out a text file.  The filename follows this command.
#INFO_PRINT_COMMAND = lpr
INFO_PRINT_COMMAND = lpr -B

prefix = /usr
exec_prefix = $(prefix)

# Where installed binaries go.
#bindir = $(exec_prefix)/TeX/bin
bindir = $(exec_prefix)/local/bin

# Where info files go.
infodir = $(prefix)/Info

# Where manual pages go, and their extension (not including `.').
mandir = $(prefix)/man/man1
manext = 1

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

PATHSPEC = -DDEFAULT_INFOPATH='"$(DEFAULT_INFOPATH)"'
PRINTSPEC = -DINFO_PRINT_COMMAND='"$(INFO_PRINT_COMMAND)"'
INFO_FLAGS = $(PATHSPEC) $(PRINTSPEC)

SOURCES = info.c makeinfo.c texindex.c getopt.c getopt1.c
OBJECTS = info.o makeinfo.o texindex.o getopt.o getopt1.o
HEADERS = getopt.h
SUPPORT = Makefile.in configure 


PROGS = info makeinfo texindex

all: $(PROGS)

.c.o:
	$(CC) -c $(CFLAGS) $(CPPFLAGS) $(DEFS) $<

info:	info.o getopt.o getopt1.o
	$(CC) $(LDFLAGS) -o $@ info.o getopt.o getopt1.o $(LIBS)

info.o: info.c
	$(CC) -c $(CFLAGS) $(INFO_FLAGS) $(CPPFLAGS) $(DEFS) $(srcdir)/info.c

makeinfo: makeinfo.o getopt.o getopt1.o
	$(CC) $(LDFLAGS) -o $@ makeinfo.o getopt.o getopt1.o $(LIBS)

makeinfo.o: makeinfo.c
	$(CC) -c $(CFLAGS) $(MAKEINFO_FLAGS) $(CPPFLAGS) $(DEFS) $(srcdir)/makeinfo.c

texindex: texindex.o getopt.o getopt1.o
	$(CC) $(LDFLAGS) -o $@ texindex.o getopt.o getopt1.o $(LIBS)

info.o makeinfo.o texindex.o getopt1.o: getopt.h

install: all
	for f in $(PROGS); do $(INSTALL_PROGRAM) $$f $(bindir)/$$f; done


clean:
	rm -f $(PROGS) $(OBJECTS)



# Prevent GNU make v3 from overflowing arg limit on SysV.
.NOEXPORT:
