# -----------------------------------------------------------------------
# prof - Makefile (nmake) for Visual-C++
#
# additional defines: LR=x includes long real arithmetic
# -----------------------------------------------------------------------
#

CCPLUS          = cl
CC              = cl

CFLAGS		= -O2 -D__I386__

# --------------------------------

INCLUDE          = $(INCLUDE)c:\profil\bias
LINK            = BIAS\Bias.lib

LIBRARY		= prof.lib
LINKTHISLIB	= $(LIBRARY)

HEADERS		= ival.h vector.h ivalvec.h matrix.h ivalmat.h \
		  func.h util.h const.h complex.h lss.h error.h \
		  realop.h config.h
OBJECTS1	= lss.obj util.obj matrix.obj ivalmat.obj \
		  intmat.obj vector.obj ivalvec.obj
OBJECTS2	= intvec.obj ival.obj error.obj func.obj \
		  complex.obj const.obj
OBJECTS3	= realop.obj

OBJECTS		= $(OBJECTS1) $(OBJECTS2) $(OBJECTS3)

library         : $(OBJECTS)

all:		library

test:		test.exe

test.exe:		test.obj $(LIBRARY)
	$(CCPLUS) $(CFLAGS) $(INCLUDE) -e$@ test.obj $(LINKTHISLIB) $(LINK)

test.obj:               test.cpp $(HEADERS)
error.obj:              error.cpp error.h config.h
const.obj:              const.cpp const.h config.h
complex.obj:            complex.cpp complex.h config.h
func.obj:               func.cpp func.h ival.h const.h config.h
util.obj:               util.cpp util.h error.h config.h
longreal.obj:           longreal.cpp longreal.h config.h
lss.obj:                lss.cpp lss.h util.h config.h
ival.obj:               ival.cpp ival.h config.h
vector.obj:             vector.cpp vector.h error.h realop.h config.h
ivalvec.obj:    ivalvec.cpp ivalvec.h error.h config.h
intvec.obj:     intvec.cpp intvec.h error.h config.h
matrix.obj:             matrix.cpp matrix.h vector.h error.h realop.h config.h
ivalmat.obj:    ivalmat.cpp ivalmat.h ivalvec.h \
			matrix.h vector.h error.h config.h
intmat.obj:     intmat.cpp intmat.h intvec.h error.h \
			config.h
realop.obj:		realop.h config.h

#library:                $(LIBRARY)
#
#$(LIBRARY):             $(OBJECTS)
#         lib -out:profil.lib $(OBJECTS)

.cpp.obj:
        $(CCPLUS) $(CFLAGS) -c $<

relop.c relop.obj:
        $(CC) $(CFLAGS) -c $<

library:
     lib -out:$(LIBRARY) $(OBJECTS)


clean:
#        $(shell if exist "*.obj" del "*.obj")
#        $(shell if exist "test.exe" del "test.exe")

CLEAN:	clean
#        $(shell if exist "$(LIBRARY)" del "$(LIBRARY)")
