# file: Makefile-dos-gcc	G. Moody	24 April 1997
#
# GCC-DOS `make' description file for MIMIC DB applications
#
# Copyright(C) Massachusetts Institute of Technology 1997. All rights reserved.

# This file is used with the UNIX `make' command to cross-compile MS-DOS
# binaries of the MIMIC DB-specific applications that come with the DB 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

MAKE = make -f Makefile-dos-gcc

# 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 $@ -ldb

# Programs to be compiled.
XFILES = annsort.exe lab2ann.exe rdacexp.exe rdtxt.exe txt2dat.exe

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

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

rdacexp.exe:	rdacexp.c
	$(CC) -o rdacexp -O rdacexp.c

clean:
	rm -f *.o *~ $(XFILES)
