
OS=__$(shell uname)
BUILD=..

include $(BUILD)/make.inc

LIB_INC=-I$(BUILD)/gpklib -I$(BUILD)
CC=$(CCLIB)

.PRECIOUS: $(BUILD)/libgpk.a


OBJS= bsstep.o euler.o rzextr.o euler.o rzextr.o
HDRS= runge6.h bulsto.h

HEADERS=${HDRS:%=$(INC)/gpklib/%}
LHDRS=${HDRS:%=$(BUILD)/gpklib/%}


.PHONY: all
.PHONY: always

all: $(BUILD)/libgpk.a $(LHDRS)

$(BUILD)/libgpk.a: always $(BUILD)/libgpk.a( $(OBJS) )

install: $(HEADERS)


$(INC)/gpklib/% : %
	$(INSTALL) $* $(INC)/gpklib/$* -m 0444

$(BUILD)/gpklib/% : %
	$(INSTALL) $* $(BUILD)/gpklib/$* -m 0444

clean:
	rm -f *.o *.a *.so


$(OBJS) : $(LHDRS)
image.o: $(BUILD)/gpklib.h $(BUILD)/gpklib/ieee754.h
image.o: $(BUILD)/gpk_std.h $(BUILD)/gpklib/NaN.h $(BUILD)/gpklib/innerloop4.h


bs_rev_t : bs_rev_t.o  $(MYLIB).a
	$(LD) -o bs_rev_t bs_rev_t.o $(MYLIB).a -lm
rungetest : rungetest.o  $(MYLIB).a
	$(LD) -o rungetest rungetest.o $(MYLIB).a -lm
rungetest.o : rungetest.c
	$(CC) -DBULSTO $*.c
extrtest : extrtest.o  $(MYLIB).a
	$(LD) -o extrtest extrtest.o $(MYLIB).a -lm
bstest : bstest.o  $(MYLIB).a
	 (LD) -o bstest bstest.o $(MYLIB).a -lm

euler.c rzextr.c : doublestore.h
