# Generated automatically from Makefile.in by configure.
# Makefile for shar and unshar.
# Copyright (C) 1994 Free Software Foundation, Inc.
# Francois Pinard <pinard@iro.umontreal.ca>, 1994.

# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

SHELL = /bin/sh

prefix = /usr/local
exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
infodir = $(prefix)/info
mandir = $(prefix)/man/man1
manext = .1

# Waiting for the Texinfo manual to replace the man pages.
infodir =
shar_texi =
texinfo_tex =
shar_info =

srcdir = .
U = 

CC = gcc
AR = ar
RANLIB = ranlib
INSTALL = /bin/installbsd -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}
# MAKEINFO = makeinfo
# TEXI2DVI = texi2dvi

# These CFLAGS values, all pertaining to shar, are not auto-configured:
# -DDEBUG		use -$ on call for activating debugging output
# -DMSDOS		probably doesn't work but accounts for some old code
# -DNO_WALKTREE		inhibit recursive walk on directory parameters
# -DSTRNCMP_IS_FAST	if unefficient to compare first chars before strncmp
# -DV_AVOIDPIPES	never use pipes in the shar files even for uudecoding
# -DV_NOFORCE		allow added features as needed even in vanilla mode

CFLAGS = -g
LDFLAGS = 

DEFS = -DHAVE_CONFIG_H
LIBS = 

CPPFLAGS = -I. -I$(srcdir) $(DEFS)

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

HEADERS = shar.h
SOURCES = shar.c unshar.c uushar.c whoami.c
OBJECTS = $Ushar.o $Uunshar.o $Uuushar.o $Uwhoami.o
LIBHDRS = getopt.h pathmax.h
LIBSRCS = basename.c error.c getopt.c getopt1.c xgetcwd.c xmalloc.c
LIBOBJS = basename.o error.o getopt.o getopt1.o xgetcwd.o xmalloc.o

# For shar-dist to produce usable shars on sites without `touch',
# true sources ought to be listed before derived files in DISTFILES.

DISTFILES = README NEWS TODO THANKS COPYING INSTALL ChangeLog \
README.OLD ChangeLog.OLD $(shar_texi) shar.1 unshar.1 \
configure.in acconfig.h aclocal.m4 Makefile.in mkinstalldirs install.sh \
ansi2knr.c ansi2knr.1 c-boxes.el $(texinfo_tex) \
$(HEADERS) $(SOURCES) $(LIBHDRS) $(LIBSRCS) \
stamp-h.in config.h.in configure $(shar_info)

# Later (maybe):

all: shar unshar

shar: $Ushar.o $Uuushar.o $Uwhoami.o libshar.a
	$(CC) $(LDFLAGS) -o shar $Ushar.o $Uuushar.o $Uwhoami.o \
libshar.a $(LIBS)

unshar : $Uunshar.o libshar.a
	$(CC) $(LDFLAGS) -o unshar $Uunshar.o libshar.a $(LIBS)

ansi2knr: ansi2knr.c
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o ansi2knr $(srcdir)/ansi2knr.c
_shar.c: shar.c ansi2knr
	./ansi2knr $(srcdir)/shar.c > _shar.c
_uushar.c: uushar.c ansi2knr
	./ansi2knr $(srcdir)/uushar.c > _uushar.c
_whoami.c: whoami.c ansi2knr
	./ansi2knr $(srcdir)/whoami.c > _whoami.c
_unshar.c: unshar.c ansi2knr
	./ansi2knr $(srcdir)/unshar.c > _unshar.c

$(OBJECTS): config.h shar.h
shar.o unshar.o: getopt.h

libshar.a: $(LIBOBJS)
	rm -f libshar.a
	$(AR) cru libshar.a $(LIBOBJS)
	$(RANLIB) libshar.a

$(LIBOBJS): config.h
getopt.o getopt1.o: getopt.h
xgetcwd.o: pathmax.h

info: shar.info

shar.info: shar.texi
	$(MAKEINFO) -I$(srcdir) --no-split shar.texi

dvi: shar.dvi

shar.dvi: shar.texi
	$(TEXI2DVI) $(srcdir)/shar.texi

install: shar unshar $(shar_info) installdirs
	$(INSTALL_PROGRAM) shar $(bindir)/shar
	$(INSTALL_PROGRAM) unshar $(bindir)/unshar
	if test -n "$(infodir)"; then \
	  $(INSTALL_DATA) $(srcdir)/shar.info $(infodir)/shar.info; \
	fi
	$(INSTALL_DATA) $(srcdir)/shar.1 $(mandir)/shar$(manext)
	$(INSTALL_DATA) $(srcdir)/unshar.1 $(mandir)/unshar$(manext)

installdirs:
	$(srcdir)/mkinstalldirs $(bindir) $(infodir) $(mandir)

uninstall:
	cd $(bindir); rm -f shar unshar
	if test -n "$(infodir)"; then \
	  cd $(infodir); rm -f shar.info;
	fi
	cd $(mandir); rm -f shar.1 unshar.1

tags: $(HEADERS) $(SOURCES)
	ctags $(HEADERS) $(SOURCES)

TAGS: $(HEADERS) $(SOURCES)
	etags -t $(HEADERS) $(SOURCES)

texclean:
	rm -f *.aux *.cp *.dvi *.fn *.ky *.log *.pg *.toc *.tp *.vr

mostlyclean: texclean
	rm -f *~ *.tmp core

clean: mostlyclean
	rm -f ansi2knr _*.c *.o *.a shar unshar

distclean: clean
	rm -f tags TAGS Makefile config.status config.h stamp-h

realclean: distclean
	rm -f shar.info stamp-h.in

dist: $(DISTFILES)
	pwd | sed 's|.*/||' > .fname
	rm -rf `cat .fname`
	mkdir `cat .fname`
	chmod 777 `cat .fname`
	@echo "Copying distribution files"
	@cp -a $(DISTFILES) `cat .fname`
	chmod -R a+r `cat .fname`
	tar chozf `cat .fname`.tar.gz `cat .fname`
	rm -rf `cat .fname` .fname

dist-shar: $(DISTFILES)
	pwd | sed 's|.*/||' > .fname
	rm -rf `cat .fname`
	mkdir `cat .fname`
	chmod 777 `cat .fname`
	@echo "Copying distribution files"
	@cp -a $(DISTFILES) `cat .fname`
	chmod -R a+r `cat .fname`
	./shar -cMF -L40 -o`cat .fname`.shar `cat .fname`
	rm -rf `cat .fname` .fname

# For the justification of the following Makefile rules, see node
# `Automatic Remaking' in GNU Autoconf documentation.
Makefile: Makefile.in config.status
	./config.status
config.status: configure
	./config.status --recheck
configure: configure.in aclocal.m4
	cd $(srcdir); autoconf

config.h: stamp-h
stamp-h: config.h.in config.status
	test ! -f stamp-h || ./config.status
	touch stamp-h
config.h.in: stamp-h.in
stamp-h.in: configure.in aclocal.m4 acconfig.h
	cd $(srcdir); autoheader
	touch $(srcdir)/stamp-h.in

# Tell versions [3.59,3.63) of GNU make not to export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
