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

include $(BUILD)/make.inc

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

.PRECIOUS: $(BUILD)/libgpk.a


OBJS= box.o ltrans.o m22cc.o v2.o line.o m22.o m22v2.o v2cc.o t222.o nltrans.o \
nline.o nbox.o line_int.o trans.o

HDRS= box.h line.h line_int.h ltrans.h m22.h m22v2.h nbox.h nline.h nltrans.h t222.h t222n.h trans.h v2.h

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

.PHONY: all

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


$(BUILD)/libgpk.a: $(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
