#
# This Makefile can be used to automatically build the entire package.  
#
# If you make changes in the "Makefile" under any subdirectory, you can
# rebuild the system with "make clean" followed by "make all".
#
#
# Generic. On most systems, this should handle everything.
#

# This tests for 64-bit and installs it in a bin64 directory in case
# you are trying to keep your stuff separate
MACHINE=$(shell uname -m)
ifeq ($(MACHINE),x86_64)
ARCH=64
else
ARCH=
endif

# Modify these to suit your tastes
INSTALLBIN = $(HOME)/code/bin$(ARCH)
INSTALLLIB = $(HOME)/code/lib$(ARCH)

# Use this primarily to indicate where BLAS/LAPACK liver on your
# system
export MYLIBS = -L/usr/lib/atlas

all:
	cd lib; make libsdp.a
	cd solver; make csdp
# 	cd theta; make all
# 	cd example; make all

#
# Perform a unitTest
#

# unitTest:
# 	cd test; make all

#
# Install the executables in /usr/local/bin.
#

install:
	cp -f solver/csdp $(INSTALLBIN)
# 	cp -f theta/theta $(INSTALLBIN)
# 	cp -f theta/graphtoprob $(INSTALLBIN)
# 	cp -f theta/complement $(INSTALLBIN)
# 	cp -f theta/rand_graph $(INSTALLBIN)

#
# Clean out all of the directories.
# 

clean:
	cd lib; make clean
	cd solver; make clean
	cd theta; make clean
	cd test; make clean
	cd example; make clean








