# Generated automatically from Makefile.in by configure.
# Makefile for GNU CVS program.
# Do not use this makefile directly, but only from `../Makefile'.
# Copyright (C) 1986, 1988-1990 Free Software Foundation, Inc.

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

# $CVSid: @(#)Makefile.in 1.19 94/09/29 $

SHELL = /bin/sh

srcdir     = .
top_srcdir = ..

prefix = /usr/local
exec_prefix = ${prefix}

# Where to install the executables.
bindir = $(exec_prefix)/bin

# Where to put the system-wide .cvsrc file
libdir = $(prefix)/lib

# Where to put the manual pages.
mandir = $(prefix)/man

# Use cp if you don't have install.
INSTALL = /usr/bin/install -c
INSTALL_DATA = ${INSTALL} -m 644
INSTALL_PROGRAM = ${INSTALL}

LIBS = 

SOURCES = add.c admin.c checkin.c checkout.c classify.c client.c commit.c \
create_adm.c cvsrc.c diff.c entries.c find_names.c hash.c history.c ignore.c \
import.c lock.c log.c logmsg.c main.c modules.c myndbm.c no_diff.c \
parseinfo.c patch.c rcs.c rcscmds.c recurse.c release.c remove.c repos.c \
root.c rtag.c server.c status.c subr.c tag.c update.c vers_ts.c version.c
MSOURCES = mkmodules.c

OBJECTS = add.o admin.o checkin.o checkout.o classify.o commit.o \
create_adm.o cvsrc.o diff.o entries.o find_names.o hash.o history.o \
ignore.o import.o lock.o log.o logmsg.o main.o modules.o myndbm.o no_diff.o \
parseinfo.o patch.o rcs.o rcscmds.o recurse.o release.o remove.o repos.o \
root.o rtag.o status.o tag.o update.o vers_ts.o server.o client.o

MOBJECTS = hash.o mkmodules.o myndbm.o

COMMON_OBJECTS = subr.o version.o

HEADERS = cvs.h rcs.h hash.h myndbm.h patchlevel.h \
	update.h server.h client.h

DISTFILES = .cvsignore Makefile.in ChangeLog ChangeLog.fsf \
	    NOTES README-rm-add \
            sanity.sh sanity.el cvsbug.sh \
            $(HEADERS) options.h.in $(SOURCES) $(MSOURCES) 

PROGS = cvs mkmodules cvsbug

DEFS = -DHAVE_CONFIG_H 

CC	 = gcc
CFLAGS = -g -O
CPPFLAGS=
LDFLAGS=

INCLUDES = -I. -I.. -I$(srcdir) -I$(top_srcdir)/lib
.c.o:
	$(CC) $(CPPFLAGS) $(INCLUDES) $(DEFS) $(CFLAGS) -c $<

all: $(PROGS)
.PHONY: all

saber_cvs:
	@cd ..; $(MAKE) saber SUBDIRS=src

lint:
	@cd ..; $(MAKE) lint SUBDIRS=src

# CYGNUS LOCAL: Do not depend upon installdirs
install:
	@for prog in $(PROGS); do \
	  echo Installing $$prog in $(bindir); \
	  $(INSTALL) $$prog $(bindir)/$$prog ; \
	done

installdirs:
	$(SHELL) $(top_srcdir)/mkinstalldirs $(bindir)

.PHONY: install installdirs

installcheck:
	RCSBIN=$(bindir) ; export RCSBIN ; $(SHELL) $(srcdir)/sanity.sh $(bindir)/cvs
.PHONY: installcheck

check: all
	if [ -x ../../rcs/src/rcs ] ; then \
		RCSBIN=`pwd`/../../rcs/src ; \
		export RCSBIN ; \
	fi ; \
	$(SHELL) $(srcdir)/sanity.sh `pwd`/cvs
.PHONY: check

# I'm not sure there is any remaining reason for this to be separate from
# `make check'.
remotecheck: all
	$(SHELL) $(srcdir)/sanity.sh -r `pwd`/cvs
.PHONY: remotecheck

tags: $(DISTFILES)
	ctags $(DISTFILES)

TAGS: $(DISTFILES)
	etags `for i in $(DISTFILES); do echo $(srcdir)/$$i; done`

ls:
	@echo $(DISTFILES)
.PHONY: ls

clean:
	/bin/rm -f $(PROGS) *.o core
.PHONY: clean

distclean: clean
	rm -f tags TAGS Makefile options.h
.PHONY: distclean

realclean: distclean
.PHONY: realclean

dist-dir:
	mkdir ${DISTDIR}
	for i in ${DISTFILES}; do \
	  ln $(srcdir)/$${i} ${DISTDIR}; \
	done
.PHONY: dist-dir

# Linking rules.

$(PROGS): ../lib/libcvs.a

cvs: $(OBJECTS) $(COMMON_OBJECTS)
	$(CC) $(OBJECTS) $(COMMON_OBJECTS) ../lib/libcvs.a $(LIBS) $(LDFLAGS) -o $@ 

xlint: $(SOURCES)
	files= ; \
	for i in $(SOURCES) ; do \
	  files="$$files $(srcdir)/$$i" ; \
	done ; \
	sh -c "lint $(DEFS) $(INCLUDES) $$files | grep -v \"possible pointer alignment problem\" \
	| grep -v \"argument closure unused\""

saber: $(SOURCES)
	# load $(CFLAGS) $(SOURCES)
	# load ../lib/libcvs.a $(LIBS)

mkmodules: $(MOBJECTS) $(COMMON_OBJECTS)
	$(CC) $(LDFLAGS) -o $@ $(MOBJECTS) $(COMMON_OBJECTS) ../lib/libcvs.a $(LIBS) $(LIBIBERTY)

cvsbug: cvsbug.sh
	cp $(srcdir)/cvsbug.sh cvsbug

# Compilation rules.

$(OBJECTS) $(COMMON_OBJECTS) mkmodules.o: $(HEADERS) options.h

subdir = src
Makefile: ../config.status Makefile.in
	cd .. && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= ./config.status

#../config.status: ../configure
#	cd .. ; $(SHELL) config.status --recheck

#../configure: ../configure.in
#	cd $(top_srcdir) ; autoconf
