next up previous
Next: Phases Up: A Simple Example: Counting Previous: countassg.cc

Compiling countassg.cc

To compile this example, you must compile the .cc file and link it with the C-Breeze library. The following Makefile should work on the UT CS machines, although the location of the library may have changed. Note that, as of this writing, C-Breeze has been compiled for x86 Linux, so you should be on a x86 Linux machine. (Also note that C-Breeze may be available in some form for other platforms.) You may take the C-Breeze library /projects/c-breeze/release/lib/libc-breeze.a and include files in /projects/c-breeze/release/include to your home Linux box; just make sure you're using the same version of GCC as on the UT CS Linux boxes. As of this writing, that version was GCC 3.03. Here is the Makefile:

CBZHOME = /projects/c-breeze/release

CXX     = g++
LD      = $(CXX)
INCLUDES= -I. -I$(CBZHOME)/include
CFLAGS  = -I$(CBZHOME)/include -DEGCS -g 
LDFLAGS = -L$(CBZHOME)/lib -lc-breeze
#CFLAGS  = -g
YACC    = bison
LEX     = flex
AR = ar
RANLIB   = ranlib
LIBCBZ = $(CBZHOME)/lib/libc-breeze.a

OBJ      = countassg.o

cbz:  $(OBJ)
        $(LD) -g $(CFLAGS) -o cbz $(OBJ) $(LDFLAGS)

countassg.o:  countassg.cc 
        $(CXX) $(CFLAGS) -c countassg.cc

objects: $(OBJ)

clean:
        rm -f *.o *.a *~ *.tab.*

# Implicit rule for compiling all C++ code

.cc.o:
        $(CXX) $(INCLUDES) $(CFLAGS) -c $< -o $@

depend:
        makedepend -Y -- $(CFLAGS) -- $(OBJ:%.o=%.cc)



Calvin Lin
2002-01-31