#========================================================================
#
# Makefile.config
#
# Miscellaneous configuration, to be included in all makefiles.
#
#========================================================================

#------------------------------------------------------------------------
#
# Before compiling, read through this file and select the options
# appropriate to your system.
#
# Eventually, this will be done by an automated script.  If you have to
# make any changes for your system, please send them to me
# (derekn@ece.cmu.edu).
#
# The following special options can be used by adding the appropriate
# flag(s) to CFLAGS2.
#
# -DNO_POPEN   Don't use the popen() function to run uncompress.
#              Instead, uncompress the file on disk and then fopen() the
#              uncompressed file.  This is useful for non-UNIX operating
#              systems which don't have a popen function.
#
# -DUSE_GZIP   Use "gzip -d" (equivalent to gunzip) instead of
#              uncompress.  This is useful for systems without
#              uncompress or where gzip is faster than uncompress.
#
#------------------------------------------------------------------------

#------------------------------------------------------------------------
# C compiler.
#------------------------------------------------------------------------

# You can use the GNU C compiler:
CC = gcc

# Or use your system's default C compiler:
#CC = cc

#------------------------------------------------------------------------
# C++ compiler.
#------------------------------------------------------------------------

# Use the GNU C++ compiler.  Gcc is used instead of g++: gcc recognizes
# C++ files (by their .cc extension) and has the advantage of not linking
# with libg++ which causes problems on some systems (Solaris, Linux-ELF).
CXX = gcc

# Use g++.  There shouldn't be any reason to use this.
#CXX = g++

# Or use your system's default C++ compiler:
#CXX = CC

#------------------------------------------------------------------------
# Library indexer.
#------------------------------------------------------------------------

# For most systems, just use ranlib:
RANLIB = ranlib

# Solaris 2.x and SCO Unix don't need a ranlib:
#RANLIB = /bin/true

#------------------------------------------------------------------------
# Binary stripper.
#------------------------------------------------------------------------

# For smaller binaries:
STRIP = strip

# To keep debugging info:
#STRIP = /bin/true

#------------------------------------------------------------------------
# Extra flags for the C compiler.
# This can include things like -I and -L if your include files or
# libraries are in non-standard places.
#------------------------------------------------------------------------

# This will work for most systems:
CFLAGS2 = -O2 -Wall

# If you're using g++ 2.7.x, you'll want to use -Wno-unused:
#CFLAGS2 = -O2 -Wall -Wno-unused

# For Linux/FreeBSD/NetBSD systems using XFree86:
#CFLAGS2 = -O2 -Wall -I/usr/X11R6/include -Wno-unused

# For official FreeBSD port (using the FreeBSD makefiles):
#CFLAGS2 = -O2 -Wall -I$(X11BASE)/include -Wno-unused

# For Solaris:
#CFLAGS2 = -O2 -Wall -I/usr/openwin/include

# For debugging:
#CFLAGS2 = -g -O -Wall -DDEBUG_MEM -Wno-unused

#------------------------------------------------------------------------
# Extra flags for the C++ compiler.
#------------------------------------------------------------------------

# This is generally the same as CFLAGS2:
CXXFLAGS2 = $(CFLAGS2)

#------------------------------------------------------------------------
# Any flags necessary to link in libX11.
#------------------------------------------------------------------------

# For most systems, just grab the X library:
XLIBS = -lX11

# For Linux/FreeBSD/NetBSD systems using XFree86:
#XLIBS = -L/usr/X11R6/lib -lX11

# For official FreeBSD port (using the FreeBSD makefiles):
#XLIBS = -L$(X11BASE)/lib -lX11

# For Solaris:
#XLIBS = -L/usr/openwin/lib -lX11 -lnsl -lsocket

# For UnixWare and probably other SysV-ish Unixes:
#XLIBS = -lX11 -lnsl -lsocket

# For SCO Unix:
#XLIBS = -lX11_s -lsocket -lmalloc -lintl

# For some old Ultrix systems and maybe others, pick up a newer
# X library:
#XLIBS = -lX11-mit

# For RISC/os (MIPS)
#XLIBS = -L/usr/X11/lib -lX11 -lbsd -lsun

#------------------------------------------------------------------------
# C++ compilation rule.
# Different versions of make have different C++ rules.  This rule makes
# everything consistent.  You shouldn't need to change this.
#------------------------------------------------------------------------

.SUFFIXES: .cc
.cc.o:
	$(CXX) $(CXXFLAGS) -c -o $@ $<
