# -*-makefile-*-
##############################################################
#
#	$Id: makefile,v 1.10 1998/07/18 19:52:42 jvuokko Exp $	
#
#
# Makefile for building jmr (Juke's Mail Reader) for unix.
#
##############################################################

RM=rm -f
BINDIR=/usr/local/bin/
MANDIR=/usr/local/man/man1/
JMRDIR=/usr/local/lib/jmr/

all:
	@echo "jmr - Qwk offline mail reader for Unix."
	@echo "Copyright (c) 1997 by Jukka Vuokko <jvuokko@iki.fi>."
	@echo "All Rights Reserved."
	@echo 
	@echo "SHORT INSTRUCTIONS:"
	@echo "    To compile jmr type one of these: "
	@echo "       'make dist', 'make devel' (recommended) or 'make debug'."
	@echo "    To install compiled jmr, type 'make install'."
	@echo
	@echo "OPTIONS:"
	@echo "dist       Normal distribution version."
	@echo "devel      Developing version. Recommended as long as"
	@echo "           jmr is in alpha or beta state (version number"
	@echo "           belove 1.0.0)."
	@echo "debug      Debug version. This writes lot of stuff to stderr."
	@echo "prof       Version for profiling jmr"
	@echo "install    Install jmr"
	@echo "uninstall  Uninstall jmr"
	@echo "size       Tells size of program code in lines"
	@echo "depend     Generate dependencies"
	@echo "clean      Restores package to pre-make state"
	@echo "distclean  Similar to 'clean', but this does not remove"
	@echo "           created binary file"
	@echo "experiment Experimental code: 'Follow up to all' feature"


experiment:
	cd src; $(MAKE) devel=1 experimental=1; mv jmr ..; cd ..

#
# This is for making development version.
# 
devel:
	cd src; $(MAKE) devel=1; mv jmr ..; cd ..

#
# This is for making debugging version.
# 
debug:
	cd src; $(MAKE) debug=1; mv jmr ..; cd ..

#
# This is for profiling program
#
prof:
	cd src; $(MAKE) devel=1 profile=1; mv jmr ..; cd ..

#
# This is for normal distribution
#
dist:
	cd src; $(MAKE) dist; mv jmr ..; cd ..

#
# This is only for my building script.... 
#
build:
	cd src; $(MAKE) clean; $(MAKE) build=1; mv jmr ..; cd ..

#
# Create dependies
#
depend:
	cd src; gcc -MM *.cc > .depend; cd ..

#
# This cleans everything (except sources :-)
clean:
	cd src; $(MAKE) clean; cd ..
	/bin/rm -f jmr

#
# This cleans all object files, but leaves executable
#
distclean: 
	cd src; $(MAKE) distclean; cd ..

#
# Tell size of project
#
size:
	@echo "Size of project is in lines :"
	@cat src/*.[ch]? | wc -l

#
# installing...
#
install:
	sh ./jmr.install

#
# and unistalling
#
uninstall:
	sh ./jmr.uninstall
