#
#       Copyright (c) 1990,1991, OPEN SOFTWARE FOUNDATION, INC.
#       ALL RIGHTS RESERVED
#
#  $Header: /project/docsrc/src/macros/RCS/Makefile,v 1.16 92/05/05 10:38:03 fred Exp $

InstallCmd	= cp

SHELL		= /bin/sh
TOP		= /tmp/DTE
LIBDIR		= $(TOP)/libdata
MACRODIR	= $(LIBDIR)/macros

#  SNAPSRCDIR is the destination path for this source for snapshot
SNAPSHOT	=
SNAPSRCDIR	= $(SNAPSHOT)/tools/src/macros

GENERALMACS	= appendix.mac bookdefs.mac copyright.mm \
	draft.mac draft-an+.man draft-hdr.man draft-hdr.mm draft-mmt+.mm \
	header.all nroff-hdr.mm \
	sgref.mm unnumbered.mm front.mac glossary.mm glosshead.mm \
	index-post.mm index-pre.mm \
	preface.mac ps.mm ptx.mm \
	sync-post.man sync-post.mm sync-pre.man sync-pre.mm \
	toc-middle.mm toc-post1.mm toc-post2.mm toc-pre.mm \
	sml gpsml rsml \
	chappart.sml headfoot.mm osfhead.rsml parts.sml \
	nonbook.mm nonbook.man

# proprietary macros - not shipped with our tapes
PROPMACS	= an mmt pub-an+.man pub-hdr.man pub-hdr.mm pub-mmt+.mm

SPECIALMACS	= tmac.sw

all:

install: prep_dir
	-( cd $(MACRODIR) ; rm -f $(GENERALMACS) $(PROPMACS) $(SPECIALMACS) )
	$(InstallCmd) $(GENERALMACS) $(MACRODIR)
	-( if [ -f an ]; then $(InstallCmd) $(PROPMACS) $(MACRODIR); else true; fi )
	@sh -c 'for m in $(SPECIALMACS) ; \
	    do ( if [ -f $$m ]; then $(InstallCmd) $$m $(MACRODIR); else true; fi ); done'

# make macros directory
prep_dir: $(MACRODIR)

$(MACRODIR):
	mkdir $(MACRODIR)

snapshot:
	@sh -c 'if [ -z "$(SNAPSHOT)" ]; \
	    then echo "SNAPSHOT must be defined on command line - no default!";\
		exit 1 ; \
	    else true ; fi'
	(cd $(SNAPSRCDIR); \
		rm -f Makefile $(GENERALMACS) $(SPECIALMACS) )
	$(InstallCmd) Makefile $(GENERALMACS) $(SNAPSRCDIR)

# do-nothing targets:
clobber:
clean:

rev-list:
	@echo "# Files in `pwd`"
	@(p=`pwd` ; rcsstat -R -V Makefile $(GENERALMACS) $(SPECIALMACS) $(PROPMACS) | \
		sed -e "s@^\.@$$p@" )
	@echo ""

