#!smake
#
# Makefile for cview
# Generated by RapidApp 1.2
#
# This makefile follows various conventions used by SGI makefiles
# See the RapidApp User's Guide for more information
# This makefile supports most common default rules, including:
#   make (or make all):  build the application or library
#   make install:        install the application or library on the local machine
#   make image(s):       create "inst" images for distribution
#   make clean:          remove .o's, core, etc.
#   make clobber:        make clean + remove the target application.
# You should be able to customize this Makefile by editing
# only the section between the ##---- markers below.
# Specify additional files, compiler flags, libraries
# by changing the appropriate variables

OBJECT_STYLE=32_M3

include $(ROOT)/usr/include/make/commondefs

##---- Start editable code block: definitions

###########################################################
###########################################################
# Modify the following variables to customize this makefile
###########################################################
###########################################################
#
# Local Definitions
#

BASEVERSION=
WANTPARALLEL=yes-please

# Directory in which inst images are placed
# NOTE: do not name this directory 'image', as it will
# cause a cycle in the Makefile graph

IMAGEDIR= images

# Add Additional libraries to USERLIBS:

USERLIBS= 

# While developing, leave OPTIMIZER set to -g.
# For delivery, change to -O2

OPTIMIZER= -g
#
# Add any files added outside RapidApp here
#

USERFILES = 

#
# Add compiler flags here
#

USERFLAGS = 

##---- End editable code block: definitions

#  The GL library being used, if needed

GLLIBS=
COMPONENTLIBS= 


#
# The ViewKit stub help library (-lvkhelp) provides a simple 
# implementation of the SGI help API. Changing this to -lhelpmsg
# switches to the full IRIS Insight help system
#

HELPLIB=

MESSAGELIBS=
LICENSELIB=

EZLIB = -lvkEZ
VIEWKITLIBS= $(MESSAGELIBS) $(EZLIB) -lvk $(HELPLIB) $(LICENSELIB) -lSgm -lXpm

# Local C++ options.
# woff 3262 shuts off warnings about arguments that are declared
# but not referenced.

# WOFF= -woff 3262

LCXXOPTS = -nostdinc  -I. -I$(ROOT)/usr/include/CC -I$(ROOT)/usr/include $(SAFLAG) $(WOFF) $(USERFLAGS) 

LLDLIBS =  -lcpr $(VKLIBS) $(HELPLIB) $(USERLIBS) $(COMPONENTLIBS) $(VIEWKITLIBS) $(GLLIBS) -lXm -lXt -lX11


# SGI makefiles don't recognize all C++ sufixes, so set up
# the one being used here.

CXXO3=$(CXXO2:.C=.o)
CXXOALL=$(CXXO3)

#
# Source Files generated by RapidApp. If files are added
# manually, add them to USERFILES
#

BUILDERFILES =  main.C\
		Checkpoint.C\
		CheckpointUI.C\
		CviewMainWindow.C\
		DeckTabbedDeck.C\
		Restart.C\
		RestartUI.C\
		RmBD.C\
		RmBDUI.C\
		RmDialog.C\
		unimplemented.C\
		$(NULL)

C++FILES = $(BUILDERFILES) $(USERFILES)


#
# The program being built
#

TARGETS=cview
APPDEFAULTS=Cview
default all: $(TARGETS)


$(TARGETS): $(OBJECTS)
	$(C++F) $(OPTIMIZER) $(OBJECTS) $(LDFLAGS) -o $@
#
# These flags instruct the compiler to output
# analysis information for cvstatic
# Uncoment to enable
# Be sure to also disable smake if cvstatic is used

#SADIR= cview.cvdb
#SAFLAG= -sa,$(SADIR)
#$(OBJECTS):$(SADIR)/cvdb.dbd
#$(SADIR)/cvdb.dbd :
#	[ -d $(SADIR) ] || mkdir $(SADIR)
#	cd $(SADIR); initcvdb.sh

#LDIRT=$(SADIR) vista.taf


#
# To install on the local machine, do 'make install'
#

install: all
	$(INSTALL) -F /usr/lib/X11/app-defaults Cview
	$(INSTALL) -F /usr/sbin -m 4755 cview
	$(INSTALL) -F /usr/lib/images Cview.icon

#
# To create inst images, do 'make image'
# An image subdirectory should already exist
#

image images: $(TARGETS)
	[ -d $(IMAGEDIR) ] || mkdir $(IMAGEDIR)
	/usr/sbin/gendist -rbase / -sbase  `pwd` -idb cview.idb \
         -spec cview.spec \
        -dist $(IMAGEDIR)  -all

include $(COMMONRULES)
