# --------------------------------------------------------------------------
# Copyright 1992 by Forschungszentrum Informatik (FZI)
#
# You can use and distribute this software under the terms of the license
# version 1 you should have received along with this software.
# If not or if you want additional information, write to
# Forschungszentrum Informatik, "OBST Projekt", Haid-und-Neu-Strasse 10-14,
# D-76131 Karlsruhe, Germany.
# --------------------------------------------------------------------------
default: all

include ../tut_common.mk

EXAMPLES=$(SAMPLE)

UF =$(EXAMPLES)/UnixFile
UF1=$(EXAMPLES)/UnixFile_v1
UF2=$(EXAMPLES)/UnixFile_v2

INCLUDES=$(OBST_INCLUDES) -I$(UF)


# ~~~~~~~~~~~~~~~~

all: $(UF)/UnixFile 

clean:
	rm -f $(UF)/*.o $(UF)/UnixFile

realclean: clean
	rm -f $(UF)/*_obst.[Cch] $(UF)/*_use.h $(UF)/*_scp.C
	touch $(UF)/*.obst


# ~~~~~~~~~~~~~~~~
# used modules
# ~~~~~~~~~~~~~~~~
# UnixFile does not use other modules

USED_MODULES:
	


# ~~~~~~~~~~~~~~~~
# module: UnixFile
# ~~~~~~~~~~~~~~~~

UF_OBJS = $(UF_MODULES) $(UF_MAIN)

UF_MAIN = $(UF)/UnixFile_main.o

UF_MODULES = $(UF)/UnixFile_obst.o $(UF)/UnixFile.o

ALL_MODULES: USED_MODULES $(UF_MODULES)


$(UF)/UnixFile_obst.h $(UF)/UnixFile_use.h $(UF)/UnixFile_obst.C: \
	   $(UF)/UnixFile.obst
	$(OBST.CMP) UnixFile ; \
	cd $(UF1);make realclean;cd $(UF2);make realclean 

$(UF)/UnixFile_obst.o: $(UF)/UnixFile_obst.C $(UF)/UnixFile_obst.h
	$(OBST.GEN.CC) $(UF)/UnixFile_obst.C

$(UF)/UnixFile.o: $(UF)/UnixFile_obst.h $(UF)/UnixFile.C
	$(OBST.CC) $(UF)/UnixFile.C


$(UF)/UnixFile_main.o: $(UF)/UnixFile_use.h $(UF)/UnixFile_main.C
	$(COMP.CC) $(UF)/UnixFile_main.C

$(UF)/UnixFile: ALL_MODULES $(UF_MAIN) $(OBSTLIB)/libOBST*
	$(LINK.CC) $(UF_OBJS) $(libOBST)  $(LDFLAGS)
