#############################################################################
# Makefile:
#    This is a makefile for maintaining the
#    '/stroke/users/trick_dev/trick_source/trick_adt/test_program'
#    directory.  This make file was automatically generated by the
#    "make_build" program.
#
#############################################################################
# Creation:
#    Author: Trick auto makefile program - "make_build", Version 1998.1.Beta
#      Date: 13:46:16 on Monday 16 February 1998
#
#############################################################################
#
# To get a desription of the arguments accepted by this makefile,
# type 'make help'
#
#############################################################################


#############################################################################
##                         DIRECTORY DEFINITIONS                           ##
#############################################################################
ifndef TRICK_HOST_CPU
TRICK_HOST_CPU := $(shell gte TRICK_HOST_CPU)
endif

ifndef TRICK_HOST_TYPE
TRICK_HOST_TYPE := $(shell gte TRICK_HOST_TYPE)
endif


TRICK_VER = 1998.1.Beta
CWD_DIR = /stroke/users/trick_dev/trick_source/trick_adt/test_program
SRC_DIR = 
OBJ_DIR = object_${TRICK_HOST_CPU}
MODEL_BIN_DIR = $(OBJ_DIR)


#############################################################################
##                          UTILITY DEFINITIONS                            ##
#############################################################################
SHELL = /bin/sh
AWK   = awk
SED   = sed
LEX   = lex
YACC  = yacc
CD    = cd
MV    = mv
RM    = rm


#
# Make information
#
MAKEFILE    = Makefile
AWKTEMPFILE = awk.temp
SEDTEMPFILE = sed.temp
MAKEDEPEND  = makedepend
FTNDEPEND   = ftn_depend

#
# Awk program to filter out system include dependencies
#
AWK_PRGM = $(TRICK_HOME)/bin/depend.awk


#############################################################################
##                         COMPILER DEFINITIONS                            ##
#############################################################################

#
# C Compilation Variables
#
CPP_PRE_DEFS =
CPP_POST_DEFS =
CPPFLAGS = $(CPP_PRE_DEFS) $(TRICK_CFLAGS) $(CPP_POST_DEFS)

ifeq ($(TRICK_FORCE_32BIT), 1)
 CPPFLAGS += -m32
endif

#
# FORTRAN Compilation Variables
#
FCFLAGS = $(TRICK_FTNFLAGS)




#############################################################################
##                        FILE NAME DEFINITIONS                            ##
#############################################################################

MODEL_C_SRC = \
    $(SRC_DIR)test.c

MODEL_IO_SRC =

MODEL_FTN_SRC =

MODEL_C_OBJS = \
    $(OBJ_DIR)/test.o

MODEL_IO_OBJS =

MODEL_FTN_OBJS =

#############################################################################
##                           SPECIAL TARGETS                               ##
#############################################################################

.PRECIOUS: $(MODEL_C_SRC) $(MODEL_FTN_SRC)

#############################################################################
##                            MODEL TARGETS                                ##
#############################################################################

default: verify_trick_version object_files

verify_trick_version:
	@if ( test `trick_version $(TRICK_VER)` != $(TRICK_VER) ) then \
		echo "Make ERROR:" ; \
		echo "  The current Makefile was generated with version $(TRICK_VER) of the Trick" ; \
		echo "  processors which is incompatible with the the current Trick version," ; \
		echo "  `trick_version`. Run 'catalog -versions' to get a complete list of" ; \
		echo "  potential incompatibility problems. You must delete this Makefile" ; \
		echo "  before make_build will generate a new Makefile." ; \
		exit 1 ; \
	fi
object_files: $(OBJ_DIR) $(MODEL_IO_OBJS) $(MODEL_C_OBJS) $(MODEL_FTN_OBJS)
	@ echo "$(CWD_DIR) object files up to date"

help :
	@ echo "\
Source Directory Make Options:\n\
    make               - Compiles are source files\n\
\n\
    make ICG           - Deletes the io_src directory and runs ICG\n\
                         on all pertinent *.h files\n\
\n\
    make catalog       - Deletes the local catalog and builds a new one\n\
\n\
    make depend        - Adds file dependencies to Makefile\n\
\n\
    make io_clean      - Deletes the local io_src directory\n\
\n\
    make catalog_clean - Deletes the local catalog directory\n\
\n\
    make clean         - Deletes the object code directory\n\
\n\
    make real_clean    - Deletes html/, io_src/, catalog/,\n\
                         and object_${TRICK_HOST_CPU}/ directories\n"

$(OBJ_DIR):
	@ mkdir -p $(OBJ_DIR)
	@ echo "Created $(OBJ_DIR)"


#
# MODEL_IO_OBJS
#


#
# MODEL_IO_SRC
#


#
# MODEL_C_OBJS
#
$(OBJ_DIR)/test.o : $(SRC_DIR)test.c
	$(TRICK_CC) $(CPPFLAGS) -c test.c -o $(OBJ_DIR)/test.o
	$(TRICK_CC)   ${TRICK_CFLAGS} $(OBJ_DIR)/test.o -L${TRICK_HOME}/lib_${TRICK_HOST_CPU} -o test -ltrick_adt



#
# LEX/YACC SOURCE
#


#
# MODEL_F_OBJS
#


#
# ICG Target
#
ICG: verify_trick_version io_clean $(OBJ_DIR) $(MODEL_IO_OBJS)
	@ echo "IO files are up to date!"

#############################################################################
##                         MAINTENANCE TARGETS                             ##
#############################################################################

depend:
	$(MAKEDEPEND) -f $(MAKEFILE)
	@ touch $(AWKTEMPFILE)
	@ $(MAKEDEPEND) -f $(AWKTEMPFILE) -Iinclude -- $(CPPFLAGS) -- $(MODEL_C_SRC) $(MODEL_IO_SRC)
	@ $(FTNDEPEND) -- $(FCFLAGS) -- $(MODEL_FTN_SRC) >> $(AWKTEMPFILE)
	@ $(AWK) -f $(AWK_PRGM) $(AWKTEMPFILE) >> $(SEDTEMPFILE)
	@ $(RM) -f $(AWKTEMPFILE)
	@ $(SED) -e 's:$(TRICK_HOME):$$(TRICK_HOME):' $(SEDTEMPFILE) >> $(AWKTEMPFILE)
	@ $(SED) s:\$\(MODEL_BIN_DIR\)/src:\$\(MODEL_BIN_DIR\): $(AWKTEMPFILE) >> $(MAKEFILE)
	@ $(RM) -f $(AWKTEMPFILE) $(AWKTEMPFILE).bak $(SEDTEMPFILE)
	@ echo "Appended dependencies to $(MAKEFILE)"

io_clean: verify_trick_version
	$(RM) -rf io_src

real_clean: verify_trick_version clean io_clean
	$(RM) -rf html *~ *.bak core
	@ echo "Directory is really clean!"

clean: verify_trick_version
	$(RM) -rf $(LIB) $(OBJ_DIR)
	@ echo "Object files successfully removed"

catalog_clean : verify_trick_version
	$(RM) -rf catalog
	@ echo "Catalog purged"

catalog : verify_trick_version catalog_clean $(MODEL_IO_SRC)
	MIS
	@ echo "$(CWD_DIR) Catalog rebuilt"

#############################################################################
#------------------------------------------------------------------------
#  Below this are the object module dependencies, built with makedepend.
#------------------------------------------------------------------------
# DO NOT DELETE THIS LINE -- make depend depends on it.

$(MODEL_BIN_DIR)/test.o: ../bst.h
