###########################################################################
# GNUMakefile for Sedumi 1.03, makes MEX-files out of C-files.
# For UNIX (e.g. Linux/sun/hp700/alpha/ibm_rs/sgi).
# See "Makefile" for a standard UNIX version.
# See "Makefile.mak" for DOS version.
# Use "make -f GNUMakefile". Uninstall with "make -f GNUMakefile clean".
#
# See the file `Install.unix' for details.
#
# IMPORTANT: you should have the variable MATLABROOT (below) point
#   to the directory where Matlab is located.
#
# This file is part of SeDuMi 1.03
# Copyright (C) 1999 Jos F. Sturm
# Dept. Quantitative Economics, Maastricht University, the Netherlands.
# Affiliations up to SeDuMi 1.02 (AUG1998):
#    CRL, McMaster University, Canada.
#    Supported by the Netherlands Organization for Scientific Research (NWO).
#
###########################################################################

# The USER should provide the root directory of the MATLAB installation:
MATLABROOT=/usr/local/matlab

# Detect the Architecture dependent MEX-extension
# by invoking the GNUmake-script exarch.make.

include exarch.make

# use MATLABROOT variable to find location of MEX compiler.
MEX=$(MATLABROOT)/bin/mex
MEXFLAGS=-O -DNDEBUG

# standard options are provided in this file, which is sourced prior
# to every mex command.  You may want to add your own compiler specific
# options to this file, or rewrite the file itself to suit your needs.
MEXOPTS=$(MATLABROOT)/bin/mexopts.sh

# Extension of MEX-executables is mex+exarch (e.g. mexsol).
ST=mex$(EXARCH)

#
# C to MEX compilation rule
#
%.$(ST):%.c
	$(MEX) -f $(MEXOPTS) $(MEXFLAGS) $^

# Having made the UNIX-specific macro definitions, proceed with the
# common makefile for SeDuMi.
include Makefile.sedumi

# To uninstall the mex-files, type "make -clean"
clean:
	rm -f $(TARGETS)
