#ident "%W% %G%"

# Copyright (C) 1994 Kubota Graphics Corp.
# 
# Permission to use, copy, modify, and distribute this material for
# any purpose and without fee is hereby granted, provided that the
# above copyright notice and this permission notice appear in all
# copies, and that the name of Kubota Graphics not be used in
# advertising or publicity pertaining to this material.  Kubota
# Graphics Corporation MAKES NO REPRESENTATIONS ABOUT THE ACCURACY
# OR SUITABILITY OF THIS MATERIAL FOR ANY PURPOSE.  IT IS PROVIDED
# "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE AND KUBOTA GRAPHICS CORPORATION DISCLAIMS ALL WARRANTIES,
# EXPRESS OR IMPLIED.

SHELL = /bin/sh
CCCOM = $(CC) $(CFLAGS) -DERRCHK -I${DORE_LOC}/dore/include -I${ROOT}/usr/include
LDCOM = $(LD) $(LDFLAGS)
ARCOM = $(AR) $(ARFLAGS)
SRC_PATH = $(DORE_LOC)/dore/src/fortran_config/sun/misc
OBJ_PATH = $(DORE_LOC)/dore/obj/$(DORE_OBJTYPE)/fortran_config/sun/misc
LIB_PATH = $(DORE_LOC)/dore/lib/$(DORE_OBJTYPE)

OFILES = fcalbak.o fdatptr.o fdatval.o fexeset.o ffil.o ffilerstr.o \
       finpslt.o flbl.o fnamset.o fpckid.o fpopatt.o fpshatt.o \
       frstr.o 

compile: $(OFILES)

$(OBJ_PATH):
	@sIFS=$$IFS ; IFS="/" ; set $(OBJ_PATH) ; IFS=$$sIFS ; \
	path="" ;						\
	for file do						\
	   path="$$path/$$file" ;				\
	   if [ ! -d $$path ]; then				\
	      echo "New Directory $$path" ;			\
	      mkdir -p $$path ;					\
	   fi ;							\
	done

fcalbak.o : $(OBJ_PATH) $(OBJ_PATH)/fcalbak.o ;
fdatptr.o : $(OBJ_PATH) $(OBJ_PATH)/fdatptr.o ;
fdatval.o : $(OBJ_PATH) $(OBJ_PATH)/fdatval.o ;
fexeset.o : $(OBJ_PATH) $(OBJ_PATH)/fexeset.o ;
ffil.o : $(OBJ_PATH) $(OBJ_PATH)/ffil.o ;
ffilerstr.o : $(OBJ_PATH) $(OBJ_PATH)/ffilerstr.o ;
finpslt.o : $(OBJ_PATH) $(OBJ_PATH)/finpslt.o ;
flbl.o : $(OBJ_PATH) $(OBJ_PATH)/flbl.o ;
fnamset.o : $(OBJ_PATH) $(OBJ_PATH)/fnamset.o ;
fpckid.o : $(OBJ_PATH) $(OBJ_PATH)/fpckid.o ;
fpopatt.o : $(OBJ_PATH) $(OBJ_PATH)/fpopatt.o ;
fpshatt.o : $(OBJ_PATH) $(OBJ_PATH)/fpshatt.o ;
frstr.o : $(OBJ_PATH) $(OBJ_PATH)/frstr.o ;

$(OBJ_PATH)/fcalbak.o : fcalbak.c
	$(CCCOM) -c fcalbak.c
	mv -f fcalbak.o $(OBJ_PATH)/fcalbak.o

$(OBJ_PATH)/fdatptr.o : fdatptr.c
	$(CCCOM) -c fdatptr.c
	mv -f fdatptr.o $(OBJ_PATH)/fdatptr.o

$(OBJ_PATH)/fdatval.o : fdatval.c
	$(CCCOM) -c fdatval.c
	mv -f fdatval.o $(OBJ_PATH)/fdatval.o

$(OBJ_PATH)/fexeset.o : fexeset.c
	$(CCCOM) -c fexeset.c
	mv -f fexeset.o $(OBJ_PATH)/fexeset.o

$(OBJ_PATH)/ffil.o : ffil.c
	$(CCCOM) -c ffil.c
	mv -f ffil.o $(OBJ_PATH)/ffil.o

$(OBJ_PATH)/ffilerstr.o : ffilerstr.c
	$(CCCOM) -c ffilerstr.c
	mv -f ffilerstr.o $(OBJ_PATH)/ffilerstr.o

$(OBJ_PATH)/finpslt.o : finpslt.c
	$(CCCOM) -c finpslt.c
	mv -f finpslt.o $(OBJ_PATH)/finpslt.o

$(OBJ_PATH)/flbl.o : flbl.c
	$(CCCOM) -c flbl.c
	mv -f flbl.o $(OBJ_PATH)/flbl.o

$(OBJ_PATH)/fnamset.o : fnamset.c
	$(CCCOM) -c fnamset.c
	mv -f fnamset.o $(OBJ_PATH)/fnamset.o

$(OBJ_PATH)/fpckid.o : fpckid.c
	$(CCCOM) -c fpckid.c
	mv -f fpckid.o $(OBJ_PATH)/fpckid.o

$(OBJ_PATH)/fpopatt.o : fpopatt.c
	$(CCCOM) -c fpopatt.c
	mv -f fpopatt.o $(OBJ_PATH)/fpopatt.o

$(OBJ_PATH)/fpshatt.o : fpshatt.c
	$(CCCOM) -c fpshatt.c
	mv -f fpshatt.o $(OBJ_PATH)/fpshatt.o

$(OBJ_PATH)/frstr.o : frstr.c
	$(CCCOM) -c frstr.c
	mv -f frstr.o $(OBJ_PATH)/frstr.o


library: 
	(cd $(OBJ_PATH);					\
	for file in $(OFILES) ; do				\
	   $(LDCOM) $$file -o t.$$file ;			\
	   mv t.$$file $$file ;					\
	done ;							\
	$(ARCOM) $(LIB_PATH)/$(DORE_LIB_NAME) $(OFILES) )

object: 
	(cd $(OBJ_PATH);					\
	$(LDCOM) $(LIB_PATH)/dore.sub.o $(OFILES) -o $(LIB_PATH)/dore.t.o)
	mv $(LIB_PATH)/dore.t.o $(LIB_PATH)/dore.sub.o

clean: 
	/bin/rm -f $(OBJ_PATH)/*.o

######################################################################

$(OBJ_PATH)/fcalbak.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/fcalbak.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/fcalbak.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/fcalbak.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/fdatptr.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/fdatptr.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/fdatptr.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/fdatptr.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/fdatval.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/fdatval.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/fdatval.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/fdatval.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/fexeset.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/fexeset.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/fexeset.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/fexeset.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/ffil.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/ffil.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/ffil.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/ffil.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/ffilerstr.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/ffilerstr.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/ffilerstr.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/ffilerstr.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/finpslt.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/finpslt.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/finpslt.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/finpslt.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/flbl.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/flbl.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/flbl.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/flbl.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/fnamset.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/fnamset.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/fnamset.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/fnamset.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/fpckid.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/fpckid.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/fpckid.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/fpckid.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/fpopatt.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/fpopatt.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/fpopatt.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/fpopatt.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/fpshatt.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/fpshatt.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/fpshatt.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/fpshatt.o: ${DORE_LOC}/dore/include/internal/dogen.h
$(OBJ_PATH)/frstr.o: ${DORE_LOC}/dore/include/internal/../dore.h
$(OBJ_PATH)/frstr.o: ${DORE_LOC}/dore/include/internal/../dore_develop/develop.h
$(OBJ_PATH)/frstr.o: ${DORE_LOC}/dore/include/internal/../dore_develop/error.h
$(OBJ_PATH)/frstr.o: ${DORE_LOC}/dore/include/internal/dogen.h
