#===============================================================
# V Makefile - Version 6/25/1996
#
# Copyright (C) 1995  Bruce E. Wampler
#
# This file is part of the V C++ GUI Framework, and is covered
# under the terms of the GNU Library General Public License,
# Version 2. This library has NO WARRANTY. See the source file
# vapp.cpp for more complete information about license terms.
#===============================================================

CC	=	g++

#	default arch is intel
ARCH	= intel
#ARCH	= sun4
#ARCH	= mips
#ARCH	= sgi

Arch = $(ARCH)

ifeq ($(Arch),i586)
Arch = intel
endif
ifeq ($(Arch),i486)
Arch = intel
endif


# Platform dependencies

# Linux
ifeq ($(Arch),intel)
HOMEV	=	/home/bruce
X11INC	=	/usr/X11/include
X11LIB	=	/usr/X11R6/lib
Arch	=	intel
LIBS	=	-lV -lXaw -lXmu -lXt -lXext -lX11
TARCMD	=	czvf v.tgz
endif

# Sun4 - unm
ifeq ($(Arch),sun4)
HOMEV	=	/nfs/u1/wampler
X11INC	=	/usr/local/X11/include
X11LIB	=	/usr/local/X11/lib
LIBS	=	-lV -lXaw -lXmu -lXt -lXext -lX11
TARCMD	=	cvf v.tar
endif


# mips - unm
ifeq ($(Arch),mips)
HOMEV	=	/nfs/u1/wampler
X11INC	=	/usr/local/X11/include
X11LIB	=	/usr/local/X11/lib
LIBS	=	-lV -lXaw -lXmu -lXt -lXext -lX11
TARCMD	=	cvf v.tar
endif

# sgi - unm
ifeq ($(Arch),sgi)
HOMEV	=	/nfs/u1/wampler
X11INC	=	/usr/include
X11LIB	=	/usr/lib
LIBS	=	-lV -lXaw -lXmu -lXt -lXext -lX11
TARCMD	=	cvf v.tar
endif

VPATH	=	../include

# Architecture dependent

VLibDir	=	$(HOMEV)/v/lib/$(Arch)

oDir	=	../obj/$(Arch)

LibDir	=	../lib/$(Arch)

Bin	=	../bin/$(Arch)

# Location of sources and inputs


# Flags for includes and libraries

CFLAGS	=	-O -I$(X11INC) -I$(HOMEV)/v/includex
#CFLAGS	=	-g -I$(X11INC) -I$(HOMEV)/v/includex

LFLAGS	=	-L$(X11LIB) -L$(VLibDir)

# Directory stuff

TestObjs =	$(oDir)/testapp.o \
		$(oDir)/vtcanvas.o \
		$(oDir)/vtcmdwin.o \
		$(oDir)/vtdialog.o


VLIB	=	$(LibDir)/libV.a


#---------------------------------------------------------------------
#
#	OK, the work begins here
#
#---------------------------------------------------------------------

$(Bin)/v1:	$(TestObjs) $(VLIB)
	@echo "Linking V1"
	$(CC) -o $@ $(LFLAGS) $(TestObjs) $(LIBS)

#---------------------------------------------------------------------
#
#  .o's for the test file
#
#---------------------------------------------------------------------

$(oDir)/vtcanvas.o:	vtcanvas.cpp vtcanvas.h vcanvas.h vtextcnv.h vcanvas.h
	$(CC) -c $(CFLAGS) -o $@ $<                     

$(oDir)/vtdialog.o:	vtdialog.cpp vtdialog.h vdialog.h vcolor.h
	$(CC) -c $(CFLAGS) -o $@ $<                     

$(oDir)/vtcmdwin.o:	vtcmdwin.cpp vtcmdwin.h vcmdwin.h bruce.vbm
	$(CC) -c $(CFLAGS) -o $@ $<                     

$(oDir)/testapp.o:	testapp.cpp testapp.h $(BASEDEP) vwindow.h vpane.h vcmdwin.h \
	vtcanvas.h vmenu.h vbtncmd.h vcbtncmd.h vlabelc.h \
	vframec.h vchkboxc.h vradioc.h vsliderc.h vtextinc.h vlistc.h vnotice.h \
	vprogrsc.h vfont.h vreply.h vtdialog.h vfilesel.h \
	vtextcnv.h vcomboc.h vtextc.h
	$(CC) -c $(CFLAGS) -o $@ $<
	chmod 755 $@
