# --------------------------------------------------------------------------
# Copyright 1992-1994 by Forschungszentrum Informatik (FZI)
# All rights reserved.
#
# You can use and distribute this software under the terms of the license
# you should have received along with this software; either version 1.1 of
# the license, or (at your option) any later version.
# For a copy of the license or for additional information about this software,
# write to Xcc Software, Durlacher Allee 53, D-76131 Karlsruhe, Germany;
# Email: obst@xcc-ka.de.
# --------------------------------------------------------------------------
include ../tut_common.mk

srcdir_rel =.
srcdir_abs = $(TUTPATH)/Compiler

TEXTFILE = $(TUTPATH)/TextFile
UNIXFILE = $(TUTPATH)/UnixFile
COMPILER = $(srcdir_abs) 


include $(COMPILER)/Compiler_defs.mk
include $(TEXTFILE)/TextFile_defs.mk
include $(UNIXFILE)/UnixFile_defs.mk

#-----------------------------------------------

OPT_CCFLAG   =#$(CC_DO_OPT)
PROF_CCFLAG  =#$(CC_DO_PROF)
DEBUG_CCFLAG =$(CC_DO_DEBUG)
INCLUDES     =$(OBST_INCLUDES) -I$(TEXTFILE) -I$(UNIXFILE)

#-----------------------------------------------

all    :  TEXT Compiler  

depend : 
	mkdefs -rootmacro COMPILER -libmacro COMPILER . \
	> $(srcdir)/Compiler_defs.mk

clean  :	
	rm -f Compiler *.o

realclean : clean
	rm -f *_obst.[Cch] *_use.h *_scp.C
	touch *.obst
	
#------------------------------------------------

COMOBJS     =  $(Compiler_obst.o) $(Compiler.o) $(UnixFile_obst.o)\
$(UnixFile.o) $(TextFile_obst.o) $(TextFile.o) $(Compiler_main.o)
COMLIBS     =$(libOBST)
COMLIBS_dep =$(OBSTLIB)/lib*
 
TEXT : 
	cd $(TEXTFILE); make

$(COMPILER)/Compiler_obst.h $(COMPILER)/Compiler_use.h\
$(COMPILER)/Compiler_obst.C : $(COMPILER)/Compiler.obst
	$(OBST.CMP) Compiler

$(Compiler_obst.o) : $(Compiler_obst.C)
	$(OBST.GEN.CC) Compiler_obst.C 

$(Compiler.o) : $(Compiler.C)
	$(OBST.CC) Compiler.C

$(Compiler_main.o) : $(Compiler_main.C)
	$(COMP.CC) Compiler_main.C

Compiler : $(COMOBJS) $(COMLIBS_dep) 
	$(LINK.CC) $(COMOBJS) $(COMLIBS) $(LDFLAGS)

