MYLIB=../mylib.a
AR=ar
RE=$(HOME)/mylib/ptrepository
INC=$(HOME)/include
INC2=$(HOME)/stmplot/subtract
INCLUDES=-I$(INC) -I$(INC2)
# CFLAGS=+w -cg92 -dalign -O5 -native
# CFLAGS=+w -cg92 -dalign -native -O3
# CFLAGS=+w -dalign -O4 -xlibmil -xsafe=mem -fsimple=2 -noex  -pts$(RE)
CFLAGS=+w -dalign -O4 -xlibmil -xsafe=mem -fsimple=2 -noex  -xtarget=ultra -mt
LD = CC $(CFLAGS) $(INCLUDES)
LFLAGS = -mt -lm -lsunmath -ldl
# LFLAGS = -lm -lsunmath
OS=__$(shell uname)$(shell uname -r | sed 's/\..*//')
CC=CC -c -D$(OS) $(CFLAGS) $(INCLUDES)
# CC=gcc -c -D$(OS) $(CFLAGS) $(INCLUDES) -I/usr/lang/SC3.0.1/include/cc_412 -I/usr/lang/SC3.0.1/include/CC_412
SOURCEDIR = "/home/gpk/gpklib/optimize"

.PRECIOUS: $(MYLIB)

HDRFILES= $(INC)/gpklib.h $(INC)/numerics.h

opt : opt.o popen.o $(MYLIB)
	$(LD) -o opt opt.o popen.o $(MYLIB) $(LFLAGS)

%.o : %.c
	$(CC) -DSOURCEDIR='$(SOURCEDIR)' $*.c

opt.o : $(INC)/numerics.h
opt.o : $(INC2)/err.h

dlltest.so.1 : dlltest.o
	LD_RUN_PATH="/lib" cc -o dlltest.so.1 -h dlltest.so -mt -R/lib -G -L/usr/local/lib dlltest.o -lgpkmisc -lm

dlltest.o : dlltest.c
	CC -c -mt -KPIC -I/home/gpk/include -I/home/gpk/stmplot -I/home/gpk/oldsgb dlltest.c

