# Global Makefile for the pretzel distribution

# $Id: Makefile,v 1.9 1998/12/03 10:31:46 felix Exp $

# this is version...
VERSION=2.0n

# use which C compiler?
CC = gcc

# Installation paths: (currently set to my personal settings)

# target path for libraries and objects:
#LIBPATH=/users/felix/lib/pretzel
# recommended:
LIBPATH=$(DESTDIR)/usr/lib/pretzel

# directory for include files
#INCLUDEDIR=/users/felix/lib/pretzel/include
# recommended:
INCLUDEDIR=$(DESTDIR)/usr/include/pretzel

# target path for executables (platform dependent)
#BINDIR1=/users/felix/bin
# recommended:
BINDIR1=$(DESTDIR)/usr/bin

# target path for shell scripts (platform independent):
#BINDIR2=/users/felix/bin
# recommended:
BINDIR2=$(DESTDIR)/usr/bin

# target path for examples and documentation:
#EXMDIR=/users/felix/lib/pretzel/doc
# recommended:
EXMDIR=$(DESTDIR)/usr/share/doc/pretzel/examples

# target path for TeX style file:
#TEXDIR=/users/felix/tex/inputs
# recommended:
TEXDIR=$(DESTDIR)/usr/share/texmf/tex/latex/pretzel

# target path for manpages (pretzel.1 and pretzel-it.1)
#MANPATH=/users/felix/lib/man/man1
# recommended:
MANPATH=$(DESTDIR)/usr/share/man/man1

# -----------------------------------------------------------------
# do not change below here:
# -----------------------------------------------------------------

# all - build executables

all: lib doc
	(cd output; make release)
	(cd attr; make release)
	(cd ftokens; make regression release)
	(cd fgrammar; make regression release)
	(cd main; make regression release)
	(cd doc/styles; make pretzel-noweb.sty)
	(cd pretzel-it; make release)
	(cd contrib/noweb/general; make release)
	(cd languages/pascal/; make release)

# lib - create the libpretzel.a library

lib: alloca.c
	$(CC) -c alloca.c
	ar vrus libpretzel.a alloca.o

# clean - remove intermediate products
clean:
	(cd attr; make clean)
	(cd output; make clean)
	(cd ftokens; make clean)
	(cd fgrammar; make clean)
	(cd main; make clean)
	(cd contrib/noweb/general; make clean)
	(cd languages/pascal; make clean)

# clobber - remove intermediate and final products
clobber: clean
	(cd attr; make clobber)
	(cd output; make clobber)
	(cd ftokens; make clobber)
	(cd fgrammar; make clobber)
	(cd main; make clobber)
	(cd contrib/noweb/general; make clobber)
	(cd contrib/noweb/java.latex; make clobber)
	(cd languages/pascal; make clobber)
	rm -f libpretzel.a plainpp.o plaindpp.o nowebpretzelpp.o alloca.o
	rm -f include/*
	rm -f bin/*

# install - copy files to places on system

install: all
	cp libpretzel.a plainpp.o plaindpp.o $(LIBPATH)
	cp nowebpretzelpp.o $(LIBPATH)
	cp include/* $(INCLUDEDIR)
	cp bin/pretzel $(BINDIR1)
#	cp bin/pascalpp $(BINDIR1)
	cp bin/pretzel-it $(BINDIR2)
#	cp languages/pascal/pascal.ft languages/pascal/pascal.fg $(EXMDIR)
	cp doc/styles/pretzel-latex.sty $(TEXDIR)
	cp doc/styles/pretzel-noweb.sty $(TEXDIR)
	cp doc/styles/pretzeldoc.sty $(TEXDIR)
	cp man/pretzel.1 man/pretzel-it.1 $(MANPATH)
#	cp doc/pretzelbook/pretzelbook.dvi $(EXMDIR)

# doc - make the documentation

doc:



# bundle - make a distribution

bundle:
	echo "are you sure you dont want to make clobber first?"
	(cd .. ; 					\
	tar -czv -X pretzel/files-to-exclude -f pretzel-$(VERSION).tar.gz pretzel/ ; \
	mv pretzel-$(VERSION).tar.gz pretzel)

# make a list of all files not to be included in the distribution
# (for me only)

exclude:
	(cd ..; 						\
	find pretzel/ -print > /tmp/gaertner.files-to-exclude ;	\
	grep RCS /tmp/gaertner.files-to-exclude > pretzel/files-to-exclude;	\
	rm /tmp/gaertner.files-to-exclude )


# move the current distribution to the www directory (may change)
www:
	mv pretzel-$(VERSION).tar.gz /users/wwwpub/Gaertner/pretzel/code



# $Log: Makefile,v $
# Revision 1.9  1998/12/03 10:31:46  felix
# *** empty log message ***
#
# Revision 1.8  1996/09/02  17:05:16  gaertner
# hasty update for v.2.0b
#
# Revision 1.7  1995/09/08  16:29:57  gaertner
# Added release of manpages to make install
#
# Revision 1.6  1995/09/08  16:18:17  gaertner
# Uses gtar now. Didn't manage to exclude RCS files.
#
# Revision 1.5  1995/09/07  17:33:50  gaertner
# Revised Makefile: targets all clean clobber install. Thanks to
# Arno Schaefer for his help.
#
# Revision 1.5  1995/09/07  17:33:50  gaertner
# Revised Makefile: targets all clean clobber install. Thanks to
# Arno Schaefer for his help.
#
# Revision 1.4  1995/08/15  17:16:08  gaertner
# Added alloca.c to the distribution. It's added to the library
# now on installation.
#
# Revision 1.3  1995/04/27  07:51:59  gaertner
# Added the COPYING file to the list that is bundled.
#
# Revision 1.2  1995/04/26  17:00:30  gaertner
# Added rcs entries to file.
#
