# file: Makefile-dos-gcc	G. Moody	24 April 1997
#				Last revised:	 5 May 1999
#
# -----------------------------------------------------------------------------
# GCC-DOS `make' description file for PSD estimation programs
# Copyright (C) 1999 George B. Moody
#
# These programs are free software; you can redistribute them and/or modify
# them 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.
#
# These programs are distributed in the hope that they 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
# these programs; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
# You may contact the author by e-mail (george@mit.edu) or postal mail
# (MIT Room E25-505A, Cambridge, MA 02139 USA).  For updates to this software,
# please visit PhysioNet (http://www.physionet.org/).
# _____________________________________________________________________________
#
# This file is used with the UNIX `make' command to cross-compile MS-DOS
# binaries of the power spectral density (PSD) estimation applications that
# come with the WFDB Software Package.  Before using it for the first time,
# check that the site-specific variables below are appropriate for your system.
# To build and install these applications and their man pages, just type `make
# -f Makefile-dos-gcc' (from within this directory).

# Site-specific variables
# -----------------------
# CCDIR is the directory containing the cross-compiler and the binary
# file utilities for MSDOS.
CCDIR = /usr/lib/gcc-lib/i386-go32-msdos/2.7.2

# CC is the name of the cross-compiler.
CC = $(CCDIR)/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, and of MSDOS, as shown below.  Other
# definitions are needed only for various versions of UNIX and should be
# omitted here.
CCDEFS = -DDB_MAJOR=$(MAJOR) -DDB_MINOR=$(MINOR) -DDB_RELEASE=$(RELEASE) -DMSDOS

# CFLAGS is the list of C compiler options used when compiling programs in the
# `app', `convert', and `example' directories.  Add the following options to
# CFLAGS as appropriate (separating them by spaces if you use more than one):
#   -g		  to save symbols for debugging
#   -O		  to use the optimizer
#   -I$(INCDIR)   needed if INCDIR is not in the normal search path for
#		   `#include' files;  harmless otherwise
#   -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, gcc-dos allows you to use both -g and -O if you wish.
CFLAGS = -O -I/usr/local/dos/include $(CCDEFS) -L/usr/local/dos/lib

# 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.
# You will need to have write permission in BINDIR.  Users of this software
# will need to have search (execute) permission in BINDIR.
BINDIR = /usr/local/dos/bin

# STRIP is the command used to compact the compiled binaries by removing their
# symbol tables.  The next line is commented out because $(CCDIR)/strip fails.
# STRIP = $(CCDIR)/strip
# To retain the symbol tables for debugging, comment out the previous line, and
# uncomment the next line.
STRIP = :

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

# General rule for compiling C sources into executable files.
.SUFFIXES: .exe
.c.exe:
	$(CC) $(CFLAGS) $< -o $@ -lm

# Programs to be compiled.
XFILES = coherenc.exe fft.exe log10.exe lomb.exe memse.exe

# `make' or `make install':  build and install applications, clean up
install:	all
	cp $(XFILES) $(BINDIR)
	$(MAKE) clean

# `make all': build applications
all:	$(XFILES)
	$(STRIP) $(XFILES)

coherenc.exe:	coherence.c
	$(CC) $(CFLAGS) $< -o $@ -lm

# `make clean': remove intermediate and backup files.
clean:
	rm -f *.o *~ $(XFILES)
