# --------------------------------------------------------------------------
# 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)/Shellscript

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

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

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

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

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

all    : COMP Shellscript

depend : 
	mkdefs -rootmacro SHELLSCRIPT -libmacro SHELLSCRIPT . \
		> $(srcdir)/Shellscript_defs.mk

clean  :	
	rm -f Shellscript *.o

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

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

SHELLOBJS     =  $(Shellscript_obst.o) $(Shellscript.o) $(UnixFile_obst.o)\
		$(UnixFile.o) $(TextFile_obst.o) $(TextFile.o)\
		$(Compiler_obst.o) $(Compiler.o) $(Shellscript_main.o)
SHELLLIBS     =$(libOBST)
SHELLLIBS_dep =$(OBSTLIB)/lib*


COMP :
	cd $(COMPILER); make

$(SHELLSCRIPT)/Shellscript_obst.h $(SHELLSCRIPT)/Shellscript_use.h \
$(SHELLSCRIPT)/Shellscript_obst.C : $(SHELLSCRIPT)/Shellscript.obst
	$(OBST.CMP) Shellscript

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

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

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

Shellscript : $(SHELLOBJS) $(SHELLLIBS_dep) 
	$(LINK.CC) $(SHELLOBJS) $(SHELLLIBS) $(LDFLAGS)

