#
# Makefile for creating a user version of dstool
#
# Instructions:
#	Set the DSTOOL environment variable to the top of the source
#	directory structure.
#       Set the ARCH environment variable to sun4 of iris.
#
# 	"make all" - will create libraries in any subdirectories
#	"make"     - will attempt to make the executable only
#

#
# The following section should not need to be modified.
#
          TOP = $(DSTOOL)
       CONFIG = $(TOP)/config
  CURRENT_DIR = my_dstool
  INCLUDE_DIR = $(DSTOOL)/src/include

include $(CONFIG)/Makefile.defs

#
# Specify a directory and name for the executable
#

  USER_BINDIR = bin/$(ARCH)
    USER_PROG = $(USER_BINDIR)/my_dstool

#
# Add your computational code here
#
    USER_SRCS = user.c
    USER_OBJS = user.o

#
# If you put code in SUBDIRS which you would like to be made
# include the subdir name here.  It is best to compile it
# into a library in this directory under the command "make all".
# Then include this library as a USER_LIB.
#
    SUBDIRS = tcl


#
# Add any of your libraries here
#
    USER_LIBS =



#
# MODIFY BELOW HERE ONLY IF YOU DOING SOMETHING UNUSUAL!
#

         SRCS = $(USER_SRCS)
         OBJS = $(USER_OBJS)

     STD_LIBS = \
		$(LIBDIR)/libinit.a \
		$(LIBDIR)/libmodels.a \
		$(LIBDIR)/libmult.a \
		$(LIBDIR)/liborbit.a \
		$(LIBDIR)/libinteg.a \
		$(LIBDIR)/libiter.a \
		$(LIBDIR)/libalg.a \
		$(LIBDIR)/libfixed.a \
		$(LIBDIR)/libcont.a \
		$(LIBDIR)/libbifmodes.a \
		$(LIBDIR)/libbrowser.a \
		$(LIBDIR)/libsvld.a \
		$(LIBDIR)/libparser.a \
		$(LIBDIR)/libpo.a \
		$(LIBDIR)/libpm.a \
		$(LIBDIR)/libview.a \
		$(LIBDIR)/libmem.a \
		$(LIBDIR)/libutil.a \
		$(LIBDIR)/libmutil.a \
		$(LIBDIR)/libeigen.a

     STD_OBJS = $(LIBDIR)/tkAppInit.o version.o

    OTHER_FILES = README rgb_color.txt GENERIC.c bin/dstool_tk 

$(USER_PROG) : Makefile $(USER_OBJS) $(USER_LIBS) $(STD_OBJS) $(STD_LIBS)
	@$(MKDIRHIER) $(USER_BINDIR)
	$(CC) $(ALL_FLAGS) -o $(USER_PROG) $(STD_OBJS) $(USER_OBJS) $(STD_LIBS) $(USER_LIBS) $(ALL_LIBS)

version.c: FORCE
	@echo "/* FILE AUTOMATICALLY CREATED - manual edits will be lost */" > version.c
	@echo "#include \"version.h\"" >> version.c
	@echo "char PROGRAM_TITLE[] = \"DsTool(user)\";" >> version.c
	@echo "char VERSION[] = \"USER DsTool for $(ARCH), Version" `cat $(DSTOOL)/VERSION`"\";" >> version.c
	@echo "char BUILD_INFO[] = \"Built by $(USER)@$(HOST), `date`\";" >> version.c

include $(CONFIG)/Makefile.rules

clean::
	$(RM) version.c

all:: $(USER_PROG)

