# file: Makefile	G. Moody	5 September 1990
#			Last revised:   24 May 1997		Version 9.7.1
# UNIX `make' description file for DB Software Package and WAVE
#
# Copyright(C) Massachusetts Institute of Technology 1997. All rights reserved.
#
# *****************************************************************************
#
# The default settings in this file are suitable for compiling using `gcc'
# under Solaris.  You will need to have root permissions to install the
# DB Software Package using these settings.
#
# If you are compiling under Linux or SunOS, see Makefile-linux or
# Makefile-sunos in this directory for pre-edited versions of this file.
# If you are using some other version of UNIX, continue reading this file
# for instructions.
#
# *****************************************************************************
#
# Please don't be put off by the size of this file.  The installation process
# is really very easy!  If you are not installing the software on a UNIX
# system, this file will not be useful to you;  you should refer to the README
# file in this directory for instructions instead.
#
# This file can be used with the UNIX `make' command to compile and install
# the DB Software Package.  It works by spawning inferior `make' processes
# in each of the subdirectories listed in the SUBDIRS variable below.  If you
# prefer, you can follow the instructions given in the `Makefile' in each of
# the subdirectories, rather than doing everything at once using this file.
#
# Before using this file for the first time, check that the site-specific
# variables below are appropriate for your system.  If you need to make
# changes, copy this file into `makefile' and edit the copy.  To build and
# install the DB Software Package, just type `make' from within this directory.
# On an otherwise lightly loaded Sun Sparcstation IPC (nominally 15 mips) this
# process takes about 5 to 8 minutes, depending on which options you choose
# below.
#
# To remove local copies of the object files, type `make clean'.  To make a
# complete set of source listings, type `make listing'.
#
# Before using the applications, you must set the DB environment variable.  At
# the end of the installation, `make' prints instructions for doing so.

# Other software that may be useful
# ---------------------------------

# If you have a Web browser such as Netscape or Mosaic, you can read the
# ECG Database Programmer's Guide, the ECG Database Applications Guide, and
# the WAVE User's Guide in hypertext form.  Your system need not be connected
# to a network in order to use a Web browser for this purpose.  If you don't
# have a Web browser, get one!  (See `SOURCES', in this directory.)

# If you have already installed GNU emacs (or GNU info and makeinfo), you can
# install a (different) hypertext version of the ECG Database Programmer's
# Guide on-line.  If you have TeX, you can print your own copies of it.  (All
# three versions -- HTML, GNU info, and printed text -- are produced from the
# same TeXinfo source, in the `doc' directory.) Sources for GNU emacs, info,
# makeinfo, and TeX are freely available;  see `SOURCES'.

# Several generations of software for visualization of data are included in
# this package, and another (WAVE, see below) is available separately.  The
# oldest of these, `dbtool' and `dbplot', are obsolete and will not be updated
# or supported in future releases of this package.  `dbtool' is based on
# SunView (an obsolete kernel-based window system developed, but no longer
# supported, by Sun).  SunView is still usable under SunOS 4.x (which Sun also
# no longer supports).  A long time ago, I translated `dbtool' to use the
# XView toolkit (yet another no-longer-supported Sun product) under the X
# window system, and this program eventually became WAVE.  `dbplot' is even
# older than `dbtool', and uses the UNIX plot(3) library to produce
# device-independent output.  The plot(3) library, which has been available
# since UNIX Version 6 in the 1970's, has been deleted from most modern Unices;
# on others, it supports an amazing variety of obsolete devices only.  If you
# have neither SunView nor `wave' (see below), you may wish to write your own
# plot(3) library following the instructions in `app/PLOT' so that you can
# compile and use `dbplot' to view or plot annotated signals.

# Three programs included here (`pschart', `psfd', and `plotstm') generate
# PostScript output.  If you have a PostScript printer, you need nothing else
# (specifically, you do not need Adobe TranScript software in order to use
# these programs).  If you do not have a PostScript printer, you may wish to
# investigate GNU ghostscript;  see `SOURCES'.  The combination of `pschart'
# and ghostscript is an adequate solution for occasional data visualization
# needs, since ghostscript also supports screen output (under X11, among
# other possibilities).

# The `plot2d' script included here is a front-end for `gnuplot', a freely-
# available XY plotting program (see `SOURCES') that supports a very wide
# variety of output devices.  Used with `rdsamp' (also included here), `plot2d'
# offers another method for data visualization. 

# A much more capable visualization program, which also supports annotation
# editing and control of external analysis programs, is `wave', an X Window
# System application that is not included in this package (see `SOURCES').
# If you have obtained the appropriate binary distribution of `wave' for your
# operating system, you may install it in the `wave' subdirectory before
# beginning the installation of the DB Software Package;  if you do so, `wave'
# will be installed automatically at the end of the installation procedure.

# For maximum portability, all of this software has been written in a version
# of C that can be compiled by ANSI/ISO C compilers as well as the older (K&R)
# C compilers that are still standard on many UNIX systems. The main DB library
# header file (db.h) contains conditionally compiled ANSI/ISO C function
# prototypes for compilers that support their use.  If you wish to develop your
# own ANSI C applications that use the DB library, you may wish to investigate
# the GNU C/C++ compiler `gcc', which supports a wide variety of systems and is
# freely available in (K&R C) source form (see `SOURCES').  If you use `gcc' on
# a system that has a different manufacturer-supplied C compiler, read the
# comments below on `make' variables CC, CFDB, CFAPP, and SCFLAGS.

# Finally, if you have an MS-DOS PC, either Microsoft or Turbo C/C++, and a
# Microstar Laboratories DAP-1200 or DAP-2400 analog interface card (see
# `SOURCES'), you can compile `app/sample.c' (under MS-DOS only).  This program
# converts digital signals from DB records on CD-ROMs or other media to analog
# signals, and can also digitize analog signals to make new DB records (which
# can be used under MS-DOS, UNIX, and other operating systems).  The DB
# Software Package does not include an equivalent UNIX-based application.

# Version numbers
# ---------------

# Each release of the DB Software Package is identified by a three-part version
# number, defined in this section.

# The major version number is incremented, and the minor version and release
# numbers are set to zero, whenever changes have been made that are
# incompatible with previous versions of the DB library.  An example of such a
# change would be adding a new member to a data structure.  These changes are
# infrequent (version 1 of the DB library appeared in 1980).  Existing
# applications usually do not require modification, but they must be recompiled
# if they are to used with a new major version of the library.  The file
# `OLDNEWS' in this directory contains information about differences between
# recent major versions.
MAJOR = 9

# The minor version number is incremented, and the release number is set to
# zero, when compatible changes are made to the DB library. For example,
# existing library functions may be modified internally, or new functions may
# be added to the library, without changing how the existing functions are
# used.  In this case, existing applications can be re-linked to the new
# library without re-compiling them.  In environments such as SunOS, Solaris,
# SVR4, Linux, and at least some versions of HP-UX, it is not even necessary to
# re-link applications explicitly, if they have been linked with shared
# (dynamically-linked) libraries.  In these environments, the version number is
# significant for proper run-time binding of the shared library.  The file
# `NEWS' in this directory contains information about differences between
# minor versions of the current major version.
MINOR = 7

# The release number is incremented when components of the DB Software Package
# other than the DB library have changed.  For example, new applications may
# be added, or new options may be added to existing applications.  The file
# `NEWNEWS' in this directory contains information about differences between
# releases of the current minor version.
RELEASE = 1

# The full version number is used during installation, so that you can be
# warned if you try to install an old version over a new one.  It is also
# available to applications by invoking the DB library function `dberror'
# before any DB library errors have occurred.
VERSION = $(MAJOR).$(MINOR).$(RELEASE)

# Site-specific variables
# -----------------------

# The first group of site-specific variables specifies what portions of the
# DB Software Package are to be installed.  As distributed, this file contains
# settings that will install everything except `lintlib' (a code-verification
# tool for versions of UNIX that support `lint'), `dbplot' (which requires the
# UNIX plot(3) library), and `dbtool' (which requires the SunView graphics
# library).

# HTMLINSTALL specifies how the on-line hypertext manuals are to be installed.
# If you are installing this package from a removable disk that may not be
# on-line when you need it, and you have 8 Mb to spare in HELPDIR (see
# below), uncomment the next line:
# HTMLINSTALL = htmlcopy
# Otherwise, you may simply create a symbolic link from HELPDIR to the HTML
# files within the `html' directory (at the same level as this one) by
# uncommenting the next line:
HTMLINSTALL = htmlsymlink
# The files in the `html' directory were generated automatically from sources
# in this directory's `doc' subdirectory.  These files can be regenerated if
# you edit the on-line manuals and wish to make the edited versions accessible
# via a web browser.  See `doc/Makefile' for details.

# INITINSTALL is a list of `make' targets to be executed before compiling
# anything.  This list may be empty, or it may include:
#       ld-prep         to add SLIBDIR (see below) to the list of directories
#                        used for shared libraries (needed under Linux)
#       db2-prep        to rearrange links to an unrelated libdb.* that may
#                        exist on some systems (may be needed under Linux)
# Normally, you will need `root' permissions in order to make these targets.
INITINSTALL =

# POSTLIBINSTALL is a list of `make' targets to be executed after installing
# the DB library but before compiling anything that uses it.  This list may be
# empty, or it may include one or more of:
#	link-incdir	to make a symbolic link from /usr/include to the
#			 directory in which the DB library #include files are
#			 to be installed
#	link-libso	to make a symbolic link from /usr/lib/libdb.so to
#			 the shareable DB library
# Normally, you will need `root' permissions in order to make these targets.
POSTLIBINSTALL = link-incdir link-libso

# SUBDIRS specifies the list of (sub)directories in which to run `make'.  This
# list must begin with `lib' (which contains the DB library), but the others
# are optional and may be listed in any order:
#	app		the standard application programs
#	convert		programs for converting DB files to and from AHA format
#	doc		UNIX `man' pages and other documentation
#	examples	programs from the ECG Database Programmer's Guide
#	microdb		a 1-minute sample from the MIT-BIH Arrhythmia Database
#	psd		programs for power spectral density estimation
#	udb		miscellaneous header files for local and piped records
#	wave		optional WAVE software (it is harmless to include
#			 `wave' in SUBDIRS even if you don't have the WAVE
#			 software distribution)
#	waverc		applications for remote control of WAVE (e.g., from a
#			Web browser)
SUBDIRS = lib app convert doc examples microdb psd udb wave waverc

# LIBTARGETS specifies the list of `make' targets within the `lib' directory.
# This list should always include `dblib' (to build and install the standard
# DB library), but it may also include:
#	lintlib		to build and install the `lint' library
#	slib		to build and install the alternate library (see below)
#	slib-linux	to build the a.out shared library for Linux (only if
#			 gcc does *not* have ELF support)
LIBTARGETS = dblib slib $(POSTLIBINSTALL)

# APPTARGETS specifies the list of `make' targets within the `app' directory.
# This list should always include `standard' (to build and install the standard
# set of applications), but it may also include:
#	dbtool		(if you have SunView libraries)
#	dbplot		(if you have the UNIX plot(3) library and the plot(1)
#			 interpreter)
#	scripts		(to create C-shell and Bourne/Korn shell scripts for
#			 setting the DB path, see below)
APPTARGETS = standard scripts

# DOCTARGETS specifies the list of `make' targets within the `doc' directory.
# This list may include:
#	man		(to install the man pages on-line)
#	info		(to install hypertext `info' files on-line)
# If you have neither GNU makeinfo nor GNU emacs, you won't be able to install
# info, but it's not necessary to remove info from DOCTARGETS.
DOCTARGETS = man info

#..............................................................................

# This section contains variables that specify where to find database records
# on CD-ROMs.  If you have no CD-ROM databases, skip this section.

# By indicating below that you plan to use a CD-ROM, you instruct `make' to
# insert the appropriate directory names for that CD-ROM into a list of
# directories that are searched by the DB software.  You can modify this
# list at any time by editing this file and typing `make scripts' (it is not
# necessary to re-compile).  It is harmless to include directories for a
# CD-ROM that you don't have, or that is not always on-line.

# Set CDMOUNTPOINT to the standard mount point (root directory) for CD-ROMs on
# your system.  (If you wish to use more than one mount point for CD-ROMs to
# be read by DB applications, replace each occurrence of $(CDROOT) in the
# following lines by the appropriate mount point).  If your operating system
# is *not* Solaris, the following value is probably correct:
# CDMOUNTPOINT=/cdrom
# Under Solaris, the automounter mounts a CD-ROM in a subdirectory of the
# standard mount point (usually /cdrom) named according to the volume ID of
# the CD-ROM, and it creates an alias for this subdirectory named `cdrom0'
# (for the first CD-ROM drive in the system).  Uncomment the following line
# to read CD-ROMs under Solaris:
CDMOUNTPOINT = /cdrom/cdrom0

# If you plan to use MIMIC Database CD-ROMs, set CDM to the name of the root
# directory (mount point) for the CD-ROM filesystem, and uncomment the
# next 2 lines:
CDM = $(CDMOUNTPOINT)
CDR0 = :$(CDM)/mimicdb:$(CDM)/mimicdb/%3r
# (The DB library replaces `%3r' in the line above by the first 3 characters of
# the record name at run time.  This is needed because of the organization of
# the MIMIC Database CD-ROMs, with each record in its own directory.)
# If you plan to use MIMIC Database CD-ROMs on two or more CD-ROM drives, add
# the `mimicdb' directories from each such drive to CDR0 above, with a `:'
# between directory names.  CDR0 must begin with `:'.
# Otherwise, uncomment the next line:
# CDR0 =

# If you plan to use the MIT-BIH Arrhythmia Database CD-ROM, set CDB to the
# name of the root directory for the CD-ROM (not necessarily the same as CDM,
# if you have two or more CD-ROM drives), and uncomment the next 2 lines:
CDB = $(CDM)
CDR1 = :$(CDB)/mitdb:$(CDB)/cudb:$(CDB)/nstdb:$(CDB)/stdb:$(CDB)/vfdb:$(CDB)/afdb:$(CDB)/cdb:$(CDB)/svdb:$(CDB)/ltdb:$(CDB)/odb:$(CDB)/udb
# Otherwise, uncomment the next line:
# CDR1 =

# If you plan to use the European ST-T Database CD-ROM, set CDE to the name of
# the root directory for the CD-ROM, and uncomment the next 2 lines:
CDE = $(CDM)
CDR2 = :$(CDE)/edb:$(CDE)/valedb
# Otherwise, uncomment the next line:
# CDR2 =

# If you plan to use the MIT-BIH Polysomnographic Database CD-ROM, set CDP to
# the name of the root directory for the CD-ROM, and uncomment the next 2
# lines:
CDP = $(CDM)
CDR3 = :$(CDP)/slpdb
# Otherwise, uncomment the next line:
# CDR3 =

# If you plan to use the MGH/MF Waveform Database CD-ROMs on a single CD-ROM
# drive, set CDMG to the name of the root directory for the CD-ROMs, and
# uncomment the next 2 lines:
CDMG = $(CDM)
CDR4 = :$(CDMG)/mghdb
# If you plan to use the MGH/MF Waveform Database CD-ROMs on two or more CD-ROM
# drives, add the `mghdb' directories from each such drive to CDR4 above,
# with a `:' between directory names.  CDR4 must begin with `:'.
# Otherwise, uncomment the next line:
# CDR4 =

# If you plan to use the sample records included on either the `Samples of
# Physiologic Databases' or the `Software for Physiologic Databases with
# Samples' CD-ROMs available from MIT, uncomment the next 2 lines:
CDS = $(CDM)
CDR5 = :$(CDS)/database:$(CDS)/database/%3r
# See the comments about the MIMIC Database above for an explanation of `%3r'.
# Otherwise, uncomment the next line:
# CDR5 =

# Add additional lines for any other compatible CD-ROM databases here, and
# be sure to include them in CDRDB below.
CDR6 = 
CDR7 =
CDR8 =
CDR9 =

# List all of the CDRn variables defined above in CDRDB, in the order you wish
# them to be searched.
CDRDB = $(CDR0)$(CDR1)$(CDR2)$(CDR3)$(CDR4)$(CDR5)$(CDR6)$(CDR7)$(CDR8)$(CDR9)

#..............................................................................

# If you plan to use the AHA Database for Evaluation of Ventricular Arrhythmia
# Detectors, edit ADB to include the name of the directory or directories in
# which it is (or will be) installed.  You may also include the names of any
# directories that will contain other databases for use with this software.
# ADB must begin with `:';  if you specify more than one directory, place a `:'
# before each directory name.  As noted in the previous section, you can type
# `make scripts' at any time if you wish to change the list of directories.
ADB = :/usr/local/ahadb
# If you do not plan to use the AHA Database, or any others not listed in the
# previous section, uncomment the next line:
# ADB =

#..............................................................................

# This section of site-dependent variables specifies the locations in your
# file system where the DB software and data files will be installed.
# You may choose a different set of locations if you prefer, but documentation
# included in this package generally assumes that you have used the defaults
# given here.  You will need write permission in all of the directories named
# in this section, and users of the software will need read permission in all
# of these directories.  Generally, you will need `root' permissions in order
# to install the software in the standard places.  To do so, uncomment the next
# line.
INSTALL = /usr/local

# If you do not have `root' permissions, a reasonable alternative to the
# standard installation is to put everything into directories called `include'
# and `local' within the current directory (or any other writeable directory).
# To use the current directory for this purpose, replace `xxx' below with the
# full pathname of the current directory, and uncomment the next line.
# INSTALL = xxx
# If you choose to install in non-standard directories, remember these points:
#  1. When compiling C programs with the DB library, use the C compiler
#     options -Ixxx/include and -Lxxx/local/lib, replacing xxx by the value
#     given for INSTALL above.
#  2. Environment variables must be set to gain access to the installed files.
#     PATH must include xxx/local/bin,  MANPATH must include xxx/local/man,
#     HELPPATH must include xxx/local/help, and (under SunOS, Solaris, and
#     SVR4) LD_LIBRARY_PATH must include xxx/local/lib.  If you are using GNU
#     emacs version 19 or later, or the stand-alone GNU info utility, INFOPATH
#     must include xxx/local/info.
#  3. GNU emacs version 18.x, and earlier versions, do not examine INFOPATH.
#     If you wish to use one of these versions to peruse the info (hypertext
#     documentation) files from this package, they must be installed into the
#     directory that contains the GNU emacs info files (for these versions of
#     GNU emacs, this directory is usually /usr/local/emacs/info). If you
#     cannot write into that directory, don't `make info' or include `info' in
#     DOCTARGETS.

# If your system supports the `mkdir -p' command to create a directory (and its
# ancestors, if necessary), and you wish to have `make' create the directories
# named in this section as needed, uncomment the next line:
MAKEDIRS = makedirs
# Otherwise, make the directories manually, and uncomment the next line:
# MAKEDIRS =

# BINDIR specifies the directory in which the applications will be installed;
# it should be a directory in the PATH of those who will use the applications.
# Note that programs in `examples', if compiled, are left in that directory
# and are NOT copied to BINDIR.
BINDIR = $(INSTALL)/bin

# DBDIR specifies the name of a directory in which to install the contents
# of the `microdb' and `udb' directories.
DBDIR = $(INSTALL)/database

# DBPATH specifies, in the format used by the Bourne shell's PATH variable,
# a list of directories to be searched in order to find DB files (see the
# section titled `The Database Path' in the ECG Database Programmer's Guide).
# DBPATH is used to construct the C-shell script `cshsetdb' and the Bourne (or
# Korn) shell script `setdb', which are installed in BINDIR.  Each user's
# `.cshrc' or `.profile' should read the appropriate script in order to set
# the DB environment variable.
#
# If you decide to change DBPATH after installing the software, simply edit
# its value below and type `make scripts' (it is not necessary to recompile).
# Note that the first component of DBPATH is empty;  this is recommended in
# order that user-created DB files (which generally go into the user's current
# directory) can be read.  Also note that the string `\$${HOME}' below is
# necessary in order to put the string `${HOME}' into the scripts.
DBPATH = :\$${HOME}/database:$(DBDIR)$(CDRDB)$(ADB)

# HELPDIR specifies the directory in which on-line help files are kept.
HELPDIR = $(INSTALL)/help

# INCDIR specifies the directory under which the DB library #include files are
# to be installed.  The installation process creates a subdirectory called
# `ecg' within INCDIR; it does not write anything else into INCDIR itself.  If
# INCDIR is not normally searched by your C compiler for #include <...> files,
# you will need to use the compiler option -I$(INCDIR) whenever compiling
# programs that use these headers;  you may avoid doing so by symbolically
# linking INCDIR/include/ecg to /usr/include/ecg.  If you use `gcc', be sure
# to read the note below on using INCDIR in CFDB, CFAPP, and SCFLAGS.
INCDIR = $(INSTALL)/include

# INFODIR specifies the directory in which the info (hypertext documentation)
# files from this package are to be installed.  These files are only installed
# if DOCTARGETS include `info', and if you have already installed GNU emacs or
# GNU makeinfo.  The best choice for INFODIR is the directory that contains
# your other info files.  On most systems with recent versions of emacs or
# info, this is /usr/local/info.  If you choose to set INFODIR to a different
# directory, you will need to set the INFOPATH environment variable
# appropriately so that GNU emacs and GNU info can find the info files.
INFODIR = $(INSTALL)/info
# If you are using GNU emacs version 18 or earlier, you must use the directory
# that contains your emacs info files.  (GNU emacs version 18 doesn't search
# INFOPATH.) The following choice is probably correct in this case.  
# INFODIR = /usr/local/emacs/info

# LIBDIR should be one of the directories searched by CC's loader for -l...
# libraries.
LIBDIR = $(INSTALL)/lib

# MANDIR is the root of the man page directory tree.  On most systems, this is
# something like /usr/man or /usr/local/man (type `man man' to find out).  If
# you choose to use a non-standard directory, you must set the MANPATH
# environment variable appropriately so that `man' (and `xman', etc.) can find
# the files.
MANDIR = $(INSTALL)/man

# MAN1, MAN3, and MAN5 are the directories in which local man pages for
# section 1 (commands), section 3 (libraries), and section 5 (formats) go.
# You may wish to use $(MANDIR)/manl for all of these; if so, uncomment the
# next three lines.
# MAN1 = $(MANDIR)/manl
# MAN3 = $(MANDIR)/manl
# MAN5 = $(MANDIR)/manl
# Uncomment the next three lines to put the man pages in with the standard
# ones.
MAN1 = $(MANDIR)/man1
MAN3 = $(MANDIR)/man3
MAN5 = $(MANDIR)/man5
# If you want to put the man pages somewhere else, edit `doc/maninst' first.

# PAPERDEF specifies the default paper size assumed by `pschart' and `psfd'.
# PAPERDEF is specified as a command-line definition for the C compiler.
# Uncomment one of the following, or see the sources in the `app' directory
# for other choices:
PAPERDEF=-DPTYPE='\"letter\"'	# US standard, 8.5 x 11 inches (216 x 279 mm) 
# PAPERDEF=-DPTYPE='\"A4\"'	# European standard, 210 x 297 mm

# PSPDIR specifies the directory in which PostScript prolog files are kept.
# (You may use any directory for this purpose;  if you have other PostScript
# applications, you may wish to keep all of your prolog files in the same
# directory, often /usr/local/lib/ps.)
PSPDIR = $(INSTALL)/lib/ps

#.............................................................................

# This section of site-specific variables specifies names of and options for
# system programs that are needed during the DB software installation.

# CC is the name of your C compiler.  The DB Software Package can be compiled
# with K&R C compilers (`cc' on most if not all older UNIX systems) as well as
# with ANSI/ISO C compilers such as GNU C (`gcc').  On some systems, such as
# Linux, `cc' is an alias for `gcc'.  To use your system's standard C compiler
# (whether it is a K&R or ANSI/ISO C compiler), uncomment the next line.
# CC = cc
# For `gcc', uncomment the next line (and see CFDB, CFAPP, and SCFLAGS below).
CC = gcc

# CCDEFS is the set of C compiler options needed to set preprocessor variables
# while compiling the DB Software Package.  You should include definitions of
# the major, minor, and release numbers, as shown below.  Add the following
# options to CCDEFS as appropriate (separating them by spaces if you use more
# than one):
#   -DBSD	  if you are running BSD 4.3 or earlier
#   -DISPRINTF	  if you do not have `stdlib.h' and your `sprintf' returns an
#		   int (see lib/dblib.h)
#   -DNOMALLOC_H  if you have neither `stdlib.h' nor `malloc.h' (see
#		   lib/dblib.h)
#   -DNOSTRSTR	  if your C library does not include the ANSI C strstr function
#   -DNOSTRTOK	  if your C library does not include the ANSI C strtok function
#   -DNOTIME	  if you do not have `time.h' (see lib/signal.c)
#   -DOLDC	  if you have neither `stdarg.h' nor `varargs.h' (see
#		   lib/dbio.c)
#   -DSOLARIS     if you are using Solaris 2.x but not `gcc' (see db.h)
#   -DUSE_FREAD	  if you do not have a `read' function, or if using `fread'
#		    is preferable (see lib/signal.c)
#   -DUSE_FWRITE  if you do not have a `write' function, or if using `fwrite'
#		    is preferable (see lib/signal.c)
# If your C compiler fails to compile `lib/signal.c', add -DBROKEN_CC to
# CCDEFS and try again (see lib/signal.c).
CCDEFS = -DDB_MAJOR=$(MAJOR) -DDB_MINOR=$(MINOR) -DDB_RELEASE=$(RELEASE)

# CFDB is the set of C compiler options to be used when compiling the standard
# DB library.  CFDB should always include CCDEFS.  Add the following options to
# CFDB as appropriate (separating them by spaces if you use more than one):
#   -g		  to save symbols for debugging
#   -O		  if you trust your C compiler's optimizer
#   -I$(INCDIR)   unless CC=gcc and INCDIR=/usr/include (but see below)
# With the exception of `gcc', most C compilers do not allow you to use -g and
# -O simultaneously.
CFDB = -g -I$(INCDIR) $(CCDEFS)
# For `gcc', comment out the previous line, and uncomment the next one.
# CFDB = -g -O -I$(INCDIR) $(CCDEFS)
#
# Note 1: -I$(INCDIR) should not be included in the values of CFDB, CFAPP, or
# SCFLAGS (below) if you are using `gcc' and if INCDIR is /usr/include.  If
# `gcc' is not the standard compiler for your system, it normally searches a
# private directory for gcc-compatible versions of standard #include files such
# as stdio.h, and then looks in /usr/include.  The -I$(INCDIR) option forces it
# to search INCDIR first, and if INCDIR contains unmodified versions of these
# #include files (as may be the case if you are using `gcc' on a system that
# also has a manufacturer-supplied `cc'), then `gcc' will read the wrong
# versions, probably causing compilation errors.  On the other hand, if `gcc'
# is the standard compiler for your system, and INCDIR is /usr/include, it is
# harmless but redundant to include -I$(INCDIR) in CFDB.
#
# Note 2: If your system supports shared (dynamically linked) libraries, a
# reasonable approach is to compile the shared library with optimization on,
# and the standard (statically linked) library with debugging symbols.  Thus
# applications get the benefit of optimized code by default, but you can still
# link them with the standard library if you need to debug their interactions
# with the DB library.

# CFAPP is the list of C compiler options used when compiling programs in the
# `app', `convert', and `example' directories.  Add the following options to
# CFAPP as appropriate (separating them by spaces if you use more than one):
#   -g		  to save symbols for debugging
#   -O		  if you trust your C compiler's optimizer
#   -I$(INCDIR)   unless CC=gcc and INCDIR=/usr/include
#   -L$(LIBDIR)   needed if LIBDIR is not in the normal library search path;
#		   harmless if LIBDIR is in the normal library search path
# As noted above, most C compilers do not allow you to use both -g and -O.
CFAPP = -O -I$(INCDIR) $(CCDEFS) -L$(LIBDIR)
# For `gcc', you may wish to try using both -g and -O.  On some systems,
# however, modules compiled with -g must be statically linked (hence result in
# much larger executables;  Linux is one such system).  If you want to try
# using `gcc' to produce optimized code with debugging symbols, uncomment the
# next line.
# CFAPP = -g -O -I$(INCDIR) $(CCDEFS) -L$(LIBDIR)
# See comments on CFDB (above).

# DBLIB is the name of the standard DB library.  In order to access it via
# `-ldb', DBLIB should be `libdb.a'.
DBLIB = libdb.a

# LDFLAGS is appended to the C compiler command line when compiling programs in
# the `app', `convert', and `example' directories, to specify loading the DB
# library.  Unless you have changed the value of DBLIB above, `-ldb' should be
# correct.
LDFLAGS = -ldb

# LN is a command that makes the file named by its first argument accessible
# via the name given in its second argument.  If your system supports symbolic
# links, uncomment the next line.
LN = ln -s
# Otherwise uncomment the next line.
# LN = ln

# If you wish to install the info (hypertext documentation) files from this
# package, specify the command needed to format them from the texinfo source
# files.  If you have the GNU `makeinfo' utility, uncomment the next line.
MAKEINFO = makeinfo
# Otherwise, you can use GNU emacs to do the job by uncommenting the next line.
# MAKEINFO = `pwd`/doc/makeinfo.sh

# If your system requires indexed libraries, uncomment the next line.
# RANLIB = ranlib
# Otherwise, uncomment the next line.
RANLIB = :

# PRINT is the name of the program used to produce listings (including any
# options for the desired formatting).
PRINT = lpr

# SETXPERMISSIONS is the command needed to make installed programs accessible
# to those who will use them.  The value given below makes them readable and
# executable by everyone, and writeable by the owner only.  (If you perform the
# installation as `root', `root' is the owner of the installed files.)
SETXPERMISSIONS = chmod 755

# SETDPERMISSIONS is similarly used to make directories created during the
# installation accessible;  its value is usually identical to SETXPERMISSIONS.
SETDPERMISSIONS = chmod 755

# SETPERMISSIONS is similarly used to make installed data files accessible.
# These files should not be marked as executable.
SETPERMISSIONS = chmod 644

# STRIP is the command used to compact the compiled binaries by removing their
# symbol tables.
STRIP = strip
# To retain the symbol tables for debugging, comment out the previous line, and
# uncomment the next line.
# STRIP = :

#.............................................................................

# This section defines site-specific variables used only if LIBTARGETS includes
# `slib' (see above). Ignore this section unless your system supports two or
# more types of libraries.  As distributed, this section contains settings
# suitable for generating an ELF-format shared library under Linux with `gcc'.
# By selecting alternative settings below, you can make a shared library with
# `cc' under SunOS or Solaris, `gcc' version 2.0 or later (tested under SunOS,
# Solaris, Linux, and HP/UX), or with `cc' or `gcc' under UNIX SVR4 (not
# tested).  By modifying these settings, this mechanism can be used to generate
# other types of variant libraries (e.g., for alternative memory models on
# systems that support more than one, or using an alternative C compiler or
# cross-compiler).
#
# It is also possible to build an a.out-format shared library under Linux if
# you do not have ELF support, but doing so is sufficiently different that a
# special target, slib-linux, is defined here and in `lib/Makefile'.  The
# variables defined in this section, except for SLIBDIR and LDCONFIG, are
# ignored in this case.  See `lib/Makefile' for details.

# SCC is the C compiler to be used for the alternate library.
SCC = $(CC)

# SINCDIR is a directory searched by SCC for include <...> files.
SINCDIR = $(INCDIR)

# SCFLAGS is the set of C compiler options used when compiling the alternate
# library.  For SunOS `cc', uncomment the next line.
# SCFLAGS = -pic -O -I$(SINCDIR) $(CCDEFS)
# For Solaris or SVR4 `cc', uncomment the next line.
# SCFLAGS = -K PIC -O -I$(SINCDIR) $(CCDEFS)
# For `gcc', uncomment the next line.
SCFLAGS = -fpic -g -O -I$(INCDIR) $(CCDEFS)
# See comments on CFDB (above).  If you don't have `gdb', you won't be able to
# debug the shared library, so you might want to remove the `-g' option in that
# case.
#
# As noted above, you will probably want to enable your C compiler's optimizer
# (if you trust it) when compiling the shared library.  If your application
# fails when linked dynamically but not when linked statically, make sure that
# both versions of the DB library were compiled from the same sources.  If they
# were, the most likely culprit is a bug in your C compiler's optimizer, and
# you may be able to work around the problem by removing `-O' from SCFLAGS
# until your C compiler vendor can fix the bug.

# SLIBDIR is the directory in which the alternate library is to be installed.
SLIBDIR = $(LIBDIR)

# SDBLIB is the name of the alternate library.
SDBLIB = libdb.so.$(MAJOR).$(MINOR)

# SLIBOBJS is the list of *.o modules to be included in the alternate library.
# This should match OFILES in lib/Makefile, and should not need to be changed.
SLIBOBJS = dbinit.o annot.o signal.o calib.o dbio.o

# SBUILDLIB is the command that creates the alternate library once its
# components have been compiled separately.  For SunOS 4.x, using either `cc'
# or `gcc', uncomment the next line.
# SBUILDLIB = ld -o $(SDBLIB) -assert pure-text $(SLIBOBJS)
# For Solaris, uncomment the next line instead.
SBUILDLIB = ld -o $(SDBLIB) -G -z text $(SLIBOBJS)
# For SVR4, uncomment the next line instead.
# SBUILDLIB = ld -o $(SDBLIB) -z text $(SLIBOBJS)
# For (at least some versions of) HP/UX, uncomment the next line instead.
# SBUILDLIB = ld -b -o $(SDBLIB) $(SLIBOBJS)
# To build an ELF-format shared library under Linux, uncomment the next line.
#SBUILDLIB = gcc -shared -Wl,-soname,libdb.so.$(MAJOR) -o $(SDBLIB) $(SLIBOBJS)

# SRANLIB is the name of the program used to index the alternate library.
# Shared libraries are not generally indexed.
SRANLIB = :

# LDCONFIG is the name of the program needed to refresh the system's cached
# index of shared libraries (under SunOS and Linux).
# Under SunOS, use /usr/etc/ldconfig.
# LDCONFIG = /usr/etc/ldconfig $(SLIBDIR)
# Under Linux (with or without ELF support), use /sbin/ldconfig.
# LDCONFIG = /sbin/ldconfig
# Under Solaris, SVR4, and other operating systems that do not maintain a
# cached index of shared libraries, uncomment the next line.
LDCONFIG = :

# SMAKE is the `make' command that is to be executed when `make slib' is run.
SMAKE = $(MAKE) CC=$(SCC) "CFLAGS=$(SCFLAGS)" INCDIR=$(SINCDIR) \
 LIBDIR=$(SLIBDIR) DBLIB=$(SDBLIB) "BUILDLIB=$(SBUILDLIB)" RANLIB=$(SRANLIB) \
 "LDCONFIG=$(LDCONFIG)" "SETPERMISSIONS=$(SETPERMISSIONS)"

#.............................................................................

# This section defines site-specific variables used only if LIBTARGETS includes
# `lintlib' (see above).

# LINTLIB is the name of the lint library generated using `lint -Cdb ...' (BSD)
# or `lint -o db ...' (System V).
LINTLIB = llib-ldb.ln

# LLIBDIR is the directory in which lint libraries are kept.  You will need
# write permission in LLIBDIR if you `make lintlib'.  Note: if LLIBDIR doesn't
# exist, and `mkdir -p' doesn't work on your system, create LLIBDIR before
# making lintlib.
LLIBDIR = $(INSTALL)/lib/lint

# LLFLAGS are the `lint' flags needed to generate LINTLIB. It is impossible to
# make BSD lint completely happy with functions that use the varargs mechanism
# (but it will accept the OLDC ersion of db_error).  Uncomment the next line
# if you have BSD lint.
LLFLAGS = -Cdb -I$(INCDIR) $(CCDEFS) -DOLDC
# On System V (and earlier versions of UNIX), uncomment the next line.
# LLFLAGS = -o db $(CFDB) $(CCDEFS)

#..............................................................................

# This section contains `make' definitions for those applications that require
# function libraries not included in this software package.  You may safely
# ignore any definitions for applications that you have not listed in
# APPTARGETS.

# `dbplot' definitions
#
# `dbplot' is a program for interactively viewing or plotting DB records on any
# device for which a UNIX plot(1) interpreter is available.
#
# PLIB is the set of C compiler options needed to load the UNIX plot(3)
# library.  Normally these should include `-lplot' (the device-independent
# library, requiring the output of `dbplot' to be piped into a suitable plot
# interpreter), but you may wish to use a device-specific library if `dbplot'
# will be used on only one type of graphical output device.  Some such
# libraries may also require `-lm'.  Some USG versions of UNIX do not include
# the plot(3) library or interpreters;  see app/PLOT for more information,
# along with notes on writing your own plot(3) library.
PLIB = -lplot

# `dbtool' definitions
#
# `dbtool' is a SunView application for interactively viewing DB records.  It
# requires graphics libraries that are available only on Sun workstations and
# compatibles.
#
# Set DPMM to your screen resolution in pixels per millimeter (4.0 for Sun 16"
# monitors, and 2.83 for Sun 19" monitors;  others may vary).
DPMM = 4.0

# `wave' definitions
#
# `wave' is an X11/XView application for interactively viewing DB records,
# editing annotation files, and controlling other DB applications.  (`wave' is
# not supplied with the DB Software Package;  it must be obtained separately.)
# `wave' runs on any system for which X11 and XView libraries are available,
# and its output is viewable on any system for which an X11 server is available
# (such as PCs, Macintoshes, and VAXen under VMS as well as UNIX systems).
#
# OWHOME is the Open Windows root directory, which should exist before you
# install `wave'.  Under SunOS and Solaris, this should be /usr/openwin;  this
# is also the default location under Linux.
OWHOME = /usr/openwin
#
# CFWAVE is the set of $(CC) options to be used while compiling `wave'.
CFWAVE = $(CFAPP) -I$(OWHOME)/include -L$(OWHOME)/lib
#
# MENUDIR specifies the directory in which the default analysis menu used by
# `wave' is kept.
MENUDIR = $(INSTALL)/lib
#
# RESDIR specifies the directory in which X11 resource files are kept.
RESDIR = $(OWHOME)/lib/app-defaults

# Note that `sample', `view', and `vsetup' are MS-DOS programs, not usable
# under UNIX.

# It should not be necessary to modify anything below this line.
# -----------------------------------------------------------------------------

# Build and install everything
install:	$(INITINSTALL) $(MAKEDIRS) $(SUBDIRS) $(HTMLINSTALL)
	@echo
	@echo "The DB Software Package, version $(VERSION), has been"
	@echo "successfully installed.  Before using this software, you must"
	@echo "set the environment variables DB and DBCAL (the database path,"
	@echo "and the DB calibration file; see the ECG Database Programmer's"
	@echo "Guide for details).  Under Solaris, it may also be necessary to"
	@echo "set LD_LIBRARY_PATH in order to use 'wave' successfully."
	@echo
	@echo "If you use csh, ecsh, tcsh, or a similar shell, do this by:"
	@echo "    source $(BINDIR)/cshsetdb"
	@echo "and, if necessary:"
	@echo "    setenv LD_LIBRARY_PATH $(OWHOME)/lib:\$$LD_LIBRARY_PATH"
	@echo "Put these commands into each user's .cshrc to set these"
	@echo "variables automatically at login time."
	@echo
	@echo "If you use sh, ksh, bash, or a similar shell, do this instead:"
	@echo "    . setdb"
	@echo "and, if necessary:"
	@echo "    LD_LIBRARY_PATH=$(OWHOME)/lib:\$$LD_LIBRARY_PATH"
	@echo "    export LD_LIBRARY_PATH"
	@echo "Put these commands into each user's .profile to set these"
	@echo "variables automatically at login time."
	@echo
	@echo "Point your Web browser to file:$(HELPDIR)/html/index.html"
	@echo "to begin reading the on-line manuals."

# Clean up temporaries, binaries, etc.
clean:
	rm -f *~
	cd lib; $(MAKE) clean
	cd app; $(MAKE) clean
	cd convert; $(MAKE) clean
	cd doc; $(MAKE) clean
	cd examples; $(MAKE) clean
	cd psd; $(MAKE) clean
	cd wave; $(MAKE) clean
	cd waverc; $(MAKE) clean

# Make listings of all sources
# (See `doc/makefile' for information on making printed documentation.)
listing:
	$(PRINT) README REGCARD NEWNEWS NEWS ORDER.4M Makefile \
	 UNIX LINUX SUN MSDOS MAC
	cd lib; $(MAKE) "PRINT=$(PRINT)" listing
	cd app; $(MAKE) "PRINT=$(PRINT)" listing
	cd convert; $(MAKE) "PRINT=$(PRINT)" listing
	cd doc; $(MAKE) "PRINT=$(PRINT)" listing
	cd examples; $(MAKE) "PRINT=$(PRINT)" listing
	cd microdb; $(MAKE) "PRINT=$(PRINT)" listing
	cd udb; $(MAKE) "PRINT=$(PRINT)" listing
	cd wave; $(MAKE) "PRINT=$(PRINT)" listing

# Preinstallation initializations, needed for Linux.  If needed, set
# INITINSTALL to one or more of these targets.
ld-prep:
	grep -q $(SLIBDIR) /etc/ld.so.conf || cat $(SLIBDIR) >>/etc/ld.so.conf

db2-prep:
	ls -l /usr/lib/libdb.so | grep -q libdb.so.2 && \
	 ( rm -f /usr/lib/libdb.so; mv /usr/lib/libdb.a /usr/lib/libdb2.a )

# Common installation initializations.  If needed, set POSTLIBINSTALL to one
# or more of these targets.
link-incdir:
	test -d /usr/include/ecg || ln -s $(INCDIR)/ecg /usr/include
link-libso:
	rm -f $(LIBDIR)/libdb.so $(LIBDIR)/libdb.so.$(MAJOR)
	-ln -s $(LIBDIR)/$(SDBLIB) $(LIBDIR)/libdb.so.$(MAJOR)
	ln -s $(LIBDIR)/libdb.so.$(MAJOR) $(LIBDIR)/libdb.so
	rm -f /usr/lib/libdb.so /usr/lib/libdb.so.$(MAJOR)
	-ln -s $(LIBDIR)/$(SDBLIB) /usr/lib/libdb.so.$(MAJOR)
	-ln -s $(LIBDIR)/libdb.so.$(MAJOR) /usr/lib/libdb.so
	$(LDCONFIG)

# Make destination directories as needed
makedirs:
	test -d $(BINDIR) || \
	 ( mkdir -p $(BINDIR); $(SETDPERMISSIONS) $(BINDIR) )
	test -d $(DBDIR) || \
	 ( mkdir -p $(DBDIR); $(SETDPERMISSIONS) $(DBDIR) )
	test -d $(HELPDIR) || \
	 ( mkdir -p $(HELPDIR); $(SETDPERMISSIONS) $(HELPDIR) )
	test -d $(INCDIR) || \
	 ( mkdir -p $(INCDIR); $(SETDPERMISSIONS) $(INCDIR) )
	test -d $(INFODIR) || \
	 ( mkdir -p $(INFODIR); $(SETDPERMISSIONS) $(INFODIR) )
	test -d $(LIBDIR) || \
	 ( mkdir -p $(LIBDIR); $(SETDPERMISSIONS) $(LIBDIR) )
	test -d $(MAN1) || \
	 ( mkdir -p $(MAN1); $(SETDPERMISSIONS) $(MAN1) )
	test -d $(MAN3) || \
	 ( mkdir -p $(MAN3); $(SETDPERMISSIONS) $(MAN3) )
	test -d $(MAN5) || \
	 ( mkdir -p $(MAN5); $(SETDPERMISSIONS) $(MAN5) )
	test -d $(PSPDIR) || \
	 ( mkdir -p $(PSPDIR); $(SETDPERMISSIONS) $(PSPDIR) )

# Rules for targets in `lib'
lib:	$(LIBTARGETS)

dblib:
	cd lib; $(MAKE) clean
	cd lib; $(MAKE) CC=$(CC) "CFLAGS=$(CFDB)" INCDIR=$(INCDIR) \
	 LIBDIR=$(LIBDIR) DBLIB=$(DBLIB) RANLIB=$(RANLIB) \
	 "SETPERMISSIONS=$(SETPERMISSIONS)" install

lintlib:
	test -d $(LLIBDIR) || \
	 ( mkdir -p $(LLIBDIR); $(SETDPERMISSIONS) $(LLIBDIR) )
	cd lib; $(MAKE) "LLFLAGS=$(LLFLAGS)" INCDIR=$(INCDIR) \
	 LINTLIB=$(LINTLIB) LLIBDIR=$(LLIBDIR) \
	 "SETPERMISSIONS=$(SETPERMISSIONS)" lintlib

slib:
	cd lib; $(MAKE) clean
	cd lib; $(SMAKE)
	cd lib; $(MAKE) clean

slib-linux:
	cd lib; $(MAKE) LIBDIR=$(SLIBDIR) "LDCONFIG=$(LDCONFIG)" slib-linux

# Rules for targets in `app'
app:	$(APPTARGETS)

standard:
	cd app; $(MAKE) CC=$(CC) "CFLAGS=$(CFAPP) $(PAPERDEF)" \
	 "LDFLAGS=$(LDFLAGS)" BINDIR=$(BINDIR) PSPDIR=$(PSPDIR) \
	 "SETPERMISSIONS=$(SETPERMISSIONS)" \
	 "SETXPERMISSIONS=$(SETXPERMISSIONS)" STRIP=$(STRIP) DBPLOT= DBTOOL= \
	 install

dbplot:
	cd app; $(MAKE) CC=$(CC) "CFLAGS=$(CFAPP)" "LDFLAGS=$(LDFLAGS)" \
	 "PLIB=$(PLIB)" dbplot; $(STRIP) dbplot; $(SETXPERMISSIONS) dbplot; \
	 cp dbplot $(BINDIR); rm -f dbplot

dbtool:
	cd app; $(MAKE) CC=$(CC) "CFLAGS=$(CFAPP)" "LDFLAGS=$(LDFLAGS)" \
	 DPMM=$(DPMM) dbtool; $(STRIP) dbtool; $(SETXPERMISSIONS) dbtool; \
	 cp dbtool $(BINDIR); rm -f dbtool

scripts:
	echo "setenv DB $(DBPATH)" >$(BINDIR)/cshsetdb
	echo "setenv DBCAL dbcal" >>$(BINDIR)/cshsetdb
	echo "DB=$(DBPATH); export DB" >$(BINDIR)/setdb
	echo "DBCAL=dbcal; export DBCAL" >>$(BINDIR)/setdb
	$(SETPERMISSIONS) $(BINDIR)/cshsetdb $(BINDIR)/setdb


# Rules for targets in `convert'
convert:	makeconvert
makeconvert:
	cd convert; $(MAKE) CC=$(CC) "CFLAGS=$(CFAPP)" "LDFLAGS=$(LDFLAGS)" \
	 BINDIR=$(BINDIR) "SETXPERMISSIONS=$(SETXPERMISSIONS)" STRIP=$(STRIP) \
	 install


# Rules for targets in `doc'
doc:	$(DOCTARGETS)

man:
	cd doc; $(MAKE) "LN=$(LN)" MAN1=$(MAN1) MAN3=$(MAN3) MAN5=$(MAN5) \
	 "SETPERMISSIONS=$(SETPERMISSIONS)" install

info:
	cd doc; $(MAKE) INFODIR=$(INFODIR) MAKEINFO=$(MAKEINFO) \
	 "SETDPERMISSIONS=$(SETDPERMISSIONS)" \
	 "SETPERMISSIONS=$(SETPERMISSIONS)" info


# Rules for targets in `examples'
examples:	makeexamples
makeexamples:
	cd examples; $(MAKE) CC=$(CC) "CFLAGS=$(CFAPP)" "LDFLAGS=$(LDFLAGS)" \
	 compile


# Rules for targets in `microdb'
microdb:	makemicrodb
makemicrodb:
	cd microdb; $(MAKE) DBDIR=$(DBDIR) "SETPERMISSIONS=$(SETPERMISSIONS)" \
	 install


# Rules for targets in `psd'
psd:	makepsd
makepsd:
	cd psd; $(MAKE) CC=$(CC) "CFLAGS=$(CFAPP)" "BINDIR=$(BINDIR)" \
	 "SETXPERMISSIONS=$(SETXPERMISSIONS)" STRIP=$(STRIP) install


# Rules for targets in `udb'
udb:		makeudb
makeudb:
	cd udb; $(MAKE) DBDIR=$(DBDIR) "SETPERMISSIONS=$(SETPERMISSIONS)" \
	 install


# Rules for targets in `wave'
wave:		makewave
makewave:
	cd wave; $(MAKE) CC=$(CC) "CFLAGS=$(CFWAVE)" \
	 BINDIR=$(BINDIR) HELPDIR=$(HELPDIR) INCDIR=$(INCDIR) \
	 INSTALL=$(INSTALL) LIBDIR=$(LIBDIR) MENUDIR=$(MENUDIR) \
	 RESDIR=$(RESDIR) "SETPERMISSIONS=$(SETPERMISSIONS)" \
	 "SETDPERMISSIONS=$(SETDPERMISSIONS)" \
	 "SETXPERMISSIONS=$(SETXPERMISSIONS)" install

# Rules for targets in `waverc'
waverc:		makewaverc
makewaverc:
	cd waverc; $(MAKE) CC=$(CC) BINDIR=$(BINDIR) install

# Rules for targets in `html'
htmlcopy:	makehtmlcopy
makehtmlcopy:
	tar cfv - ../html | (cd $(HELPDIR); tar xfv - )

htmlsymlink:	makehtmlsymlink
makehtmlsymlink:
	-cd ..; ln -s `pwd`/html $(HELPDIR)
