#
# Makefile
#   Copyright (C) 1990, 1991, 1992 Free Software Foundation
#
# This file 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 of the License, 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.  */
#

# Seriously hacked by K. Richard Pixley <rich@cygnus.com>.

srcdir = .

prefix = /usr/local

exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib

datadir = $(prefix)/lib

mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = $(prefix)/info
includedir = $(prefix)/include
oldincludedir =
docdir = $(datadir)/doc

SHELL = /bin/sh

AR = ar
AR_FLAGS = qv
CFLAGS = -g

INSTALL = install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)

FLAGS_TO_PASS = \
  "prefix=$(prefix)" \
  "exec_prefix=$(exec_prefix)" \
  "against=$(against)" \
  "AR=$(AR)" \
  "AR_FLAGS=$(AR_FLAGS)" \
  "CC=$(CC)" \
  "CFLAGS=$(CFLAGS)" \
  "INSTALL=$(INSTALL)" \
  "RANLIB=$(RANLIB)" \
  "LOADLIBES=$(LOADLIBES)" \
  "LDFLAGS=$(LDFLAGS)" \
  "BISON=$(BISON)" \
  "MAKEINFO=$(MAKEINFO)" 


#### host, target, and site dependent makefile fragments come in here.
###

SUBDIRS = src man

.PHONY: all install all-src all-man install-src install-man
all: all-src all-man

.PHONY: check
check:
	@(cd src ; $(MAKE) "CC=$(CC)" "CFLAGS=$(CFLAGS)" check)

.PHONY: installcheck
installcheck:

install: install-src install-man
	$(INSTALL_DATA) $(srcdir)/rcs.ms $(docdir)/rcs.ms
	$(INSTALL_DATA) $(srcdir)/rcs_func.ms $(docdir)/rcs_func.ms

clean: clean-src clean-man

info install-info clean-info dvi:

### src
.PHONY: all-src just-src
all-src: just-src
just-src: force
	@[ -d ./src ] && (cd ./src; $(MAKE) $(FLAGS_TO_PASS) all)

clean-src: force
	@[ -d ./src ] && (cd ./src; $(MAKE) $(FLAGS_TO_PASS) clean)

install-src: force
	@[ -d ./src ] && (cd ./src; $(MAKE) $(FLAGS_TO_PASS) install)


### man
.PHONY: all-man just-man
all-man: just-man
just-man: force
	@[ -d ./man ] && (cd ./man; $(MAKE) $(FLAGS_TO_PASS) all)

clean-man: force
	@[ -d ./man ] && (cd ./man; $(MAKE) $(FLAGS_TO_PASS) clean)

install-man: force
	@[ -d ./man ] && (cd ./man; $(MAKE) $(FLAGS_TO_PASS) install)

### other support targets
subdir_do: force
	@for i in $(DODIRS); do \
		if [ -d ./$$i ] ; then \
			if (cd ./$$i; $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then ; \
				true ; \
			else exit 1 ; fi ; \
		else true ; fi ; \
	done

force:

Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
	$(SHELL) ./config.status

# Local Variables:
# fill-column: 79
# End:

# end of rcs/Makefile.in
