## Copyright (C) 1993,1994 by the author(s).
# 
# This software is published in the hope that it will be useful, but
# WITHOUT ANY WARRANTY for any part of this software to work correctly
# or as described in the manuals. See the ShapeTools Public License
# for details.
#
# Permission is granted to use, copy, modify, or distribute any part of
# this software but only under the conditions described in the ShapeTools 
# Public License. A copy of this license is supposed to have been given
# to you along with ShapeTools in a file named LICENSE. Among other
# things, this copyright notice and the Public License must be
# preserved on all copies.

#
# shape_CM environment -- standard variants
#
# Authors: Andreas Lampen (Andreas.Lampen@cs.tu-berlin.de)
#          Axel Mahler (Axel.Mahler@cs.tu-berlin.de)
#
# $Header: stdvar[6.0] Fri Jul 30 16:39:56 1993 andy@cs.tu-berlin.de frozen $
#

#
# vclass system
#
vclass system ::= (s_aix, s_hpux, s_irix, s_mach, s_sunos_4, s_svr_4, s_ultrix)

s_aix:+
	VARCFLAGS = -Ds_aix
	SYSLIBS = -lPW
	HOSTSYSTEM = s_aix

s_hpux:+
	VARCFLAGS = -Ds_hpux
	SYSLIBS = -lPW
	HOSTSYSTEM = s_hpux

s_irix:+
	VARCFLAGS = -Ds_irix
	SYSLIBS = -lsun
	HOSTSYSTEM = s_irix

s_mach:+
	VARCFLAGS = -Ds_mach
	HOSTSYSTEM = s_mach

s_sunos_4:+
	VARCFLAGS = -Ds_sunos_4
	HOSTSYSTEM = s_sunos_4

s_svr_4:+
	VARCFLAGS = -Ds_svr_4
	SYSLIBS = -lnsl -lgen
	HOSTSYSTEM = s_svr_4

s_ultrix:+
	VARCFLAGS = -Ds_ultrix
	HOSTSYSTEM = s_ultrix

#
# vclass compiler
#
vclass compiler ::= (pcc, gnu, gnu_ansi)

pcc:+
	CC=cc
	COMPILER=pcc

gnu:+
	CC=gcc -W
	COMPILER=gnu

gnu_ansi:+
	CC=gcc -ansi -Wall
	COMPILER=gnu_ansi

gnu_posix:+
	CC=gcc -ansi -Wall -D_POSIX_SOURCE
	COMPILER=gnu_posix

#
# vclass quality
#
vclass quality ::= (debug, debug_static, profiling, \
		    profiling_static, optimize, maxoptimize)

debug:+
	VARCFLAGS=-g
	VARLDFLAGS=-g
	MAKECFLAGS=
	MAKELDFLAGS=
	QUALITY=debug

debug_static:+
	VARCFLAGS=-g -Bstatic
	VARLDFLAGS=-g -Bstatic
	MAKECFLAGS=
	MAKELDFLAGS=
	QUALITY=debug_static

profiling:+
	VARCFLAGS=-pg -g
	VARLDFLAGS=-pg -g
	MAKECFLAGS=
	MAKELDFLAGS=
	QUALITY=profiling

profiling_static:+
	VARCFLAGS=-pg -g -Bstatic
	VARLDFLAGS=-pg -g -Bstatic
	MAKECFLAGS=
	MAKELDFLAGS=
	QUALITY=profiling_static

optimize:+
	VARCFLAGS=-O
	VARLDFLAGS=-s
	MAKECFLAGS=
	MAKELDFLAGS=
	QUALITY=optimize

maxoptimize:+
	VARCFLAGS=-O -fcombine-regs -fstrength-reduce
	VARLDFLAGS=-s
	MAKECFLAGS=
	MAKELDFLAGS=
	QUALITY=maxoptimize

#
# memory checks
#
vclass memory_checks ::= (electric_fence, malloc_debug)

electric_fence:+
	SYSLIBS = /usr/local/lib/electric_fence.o

malloc_debug:+
	INCLUDES = -I$(LOCALINCLUDEPATH) -I/usr/local/debug_include
	VARCFLAGS = -DDEBUG_MALLOC
	LOCALLIBS = $(LOCALLIBPATH)/libAtFStk_malloc_debug.a $(LOCALLIBPATH)/libAtFS_malloc_debug.a $(LOCALLIBPATH)/libsttk_malloc_debug.a
	SYSLIBS = /usr/local/lib/libdbmalloc.a

#
# local variants
#
andy_localtest:+
	LOCALBASE = /home/stone/andy
	INCLUDES  = -I$(LOCALBASE)/atfstk -I$(LOCALBASE)/atfs1/src -I$(LOCALBASE)/shape/sttk -I$(BASE)/include
	LOCALLIBS = $(LOCALBASE)/atfstk/libAtFStk.a $(LOCALBASE)/shape/sttk/libsttk.a $(LOCALBASE)/atfs1/src/libAtFS.a
	VARCFLAGS= -D$(HOSTSYSTEM)
