# Generated automatically from Makefile.in by configure.
# Makefile for GNU cpio.
# Copyright (C) 1988, 1991 Free Software Foundation, Inc.

# Modified 1996, 1997 by Claus-Justus Heine for use with the ftape package

# 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.

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

srcdir = .
VPATH = .

#
# set this to the location of the directory containing the
# ftape sources.
#
TOPDIR = ../..
#
# all other configuration is in $(TOPDIR)/MCONFIG:
#
include $(TOPDIR)/MCONFIG

# If you use gcc, you should either run the fixincludes script that
# comes with it or else use gcc with the -traditional option.  Otherwise
# ioctl calls will be compiled incorrectly on some systems.
CC = gcc

# If you don't have a BSD or GNU install program, use cp.
# INSTALL = /usr/bin/install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL) -m 644

# Things you might add to DEFS:
# -DSTDC_HEADERS	If you have ANSI C headers and libraries.
# -DHAVE_UNISTD_H	If you have unistd.h.
# -DHAVE_STRING_H	If you don't have ANSI C headers but have string.h.
# -DHAVE_UTIME_H	If you have utime.h.
# -DMAJOR_IN_MKDEV	If major, minor, makedev defined in sys/mkdev.h.
# -DMAJOR_IN_SYSMACROS	If major, minor, makedev defined in sys/sysmacros.h.
# -DHAVE_FCNTL_H	If not POSIX.1 but you have fcntl.h.
# -DRETSIGTYPE=int	If your signal handlers return int, not void.
# -DHAVE_LCHOWN		If you have lchown system call.
# -DHAVE_STRERROR	If you have strerror function.
# -DHAVE_VPRINTF	If you have vprintf function.
# -DHAVE_DOPRNT		If you have _doprnt function (but lack vprintf).
# -DHAVE_SYS_MTIO_H	If you have sys/mtio.h (magtape ioctls).
# -DHAVE_SYS_GENTAPE_H	If you have sys/gentape.h (ISC magtape ioctls).
# -DHAVE_NETDB_H	To use rexec for remote tape operations
#			instead of forking rsh or remsh.
# -DNO_REMOTE		If you have neither a remote shell nor rexec.
# -DSYMLINK_USES_UMASK	If your symlink system call uses the value of
#			umask to set the protection of symbolic links.
# -DHPUX_CDF		If you are on an HP/UX system and want support
#			for context dependent files.

DEFS =  -DRETSIGTYPE=void -DMAJOR_IN_SYSMACROS=1 -DHAVE_SYS_MTIO_H=1 \
	-DSTDC_HEADERS=1 -DHAVE_UNISTD_H=1 -DHAVE_STRING_H=1 -DHAVE_FCNTL_H=1 \
	-DHAVE_UTIME_H=1 -DHAVE_STRERROR=1 -DHAVE_VPRINTF=1 -DHAVE_ALLOCA_H=1 \
	-DDIRENT=1 \
	-DHAVE_FTAPE \
	-DDEFTAPE=\"/dev/tape\"
LIBS = 
# Set this to rtapelib.o unless you defined NO_REMOTE, in which case
# make it empty.
RTAPELIB = rtapelib.o

override CFLAGS   = -O2 -fomit-frame-pointer
override CPPFLAGS = 

LDFLAGS = -s 

prefix = /usr
exec_prefix = $(prefix)

# Prefix for each installed program, normally empty or `g'.
binprefix = ft
# Prefix for each installed man page, normally empty or `g'.
manprefix = ft

# Where to install the cpio and mt executables.
bindir = $(BINDIR)

# Where to put the rmt executable.
libdir = /etc

# Where to put the Unix-style manual pages.
mandir = $(MANDIR)/man1
# Extension (not including `.') for the Unix-style manual page filenames.
manext = 1

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

SHELL = /bin/sh

# mt source files not shared with cpio.
MT_SRCS = mt.c argmatch.c
MT_OBJS = mt.o argmatch.o error.o xmalloc.o version.o $(RTAPELIB)
HDRS = rmt.h

override CFLAGS := $(CFLAGS) $(CPPFLAGS) $(DEFS) -I$(srcdir) -I$(TOPDIR)/include

all:	mt

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

install: $(srcdir)/mt.1
	test ! -f mt || $(INSTALL_PROGRAM) mt $(bindir)/$(binprefix)mt
	-test ! -f mt || $(INSTALL_DATA) $(srcdir)/mt.1 $(mandir)/$(manprefix)mt.$(manext)

uninstall:
	cd $(bindir); rm -f $(binprefix)mt
	cd $(mandir); rm -f $(manprefix)mt.$(manext)

check:
	@echo No tests are supplied.

mt.o: rmt.h

mt:	$(MT_OBJS)
	$(CC) $(LDFLAGS) -o $@ $(MT_OBJS) $(LIBS)

TAGS:	$(SRCS)
	etags $(SRCS)

clean:
	rm -f cpio rmt mt *.o core

realclean mostlyclean: clean

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

.PHONY: all install uninstall check clean mostlyclean realclean
