INCLUDEDIR   = .                           # where all the header files are
LIBSTD       = ../libStd.a                 # the library name

## Which files do I need to compile to create the library ?
OBJS = StdTypes.o \
       StdArrChar.o   StdArrDouble.o StdArrFloat.o StdArrInt.o \
       StdArrUnchar.o StdArrUnint.o  StdArrUnshort.o \
       StdString.o \
       StdVector.o \
       StdBitString.o \
       StdMatDouble.o StdMatFloat.o StdMatInt.o \
       StdRandom.o \
       StdPDensity.o \
       StdTable.o \

## The name of the library file to create from the .o files
LIB = $(LIBSTD)

## The compiler options =====================================================
CC = g++   

## Compiler flags
#CFLAGS += -g         # include debugging information
#CFLAGS += -p         # include profiling information
 CFLAGS += -Wall      # spit out all warnings
#CFLAGS += -DASSERT   # compile with assertions turned on
 CFLAGS += -O3        # force all compilations to use optimizer
 CFLAGS += -fno-implicit-templates   # Templates are instantiated externally

## Rules and dependancies ===================================================

.c.o:                               # Generate a .o file from any .c file 
	$(CC) $(CFLAGS) -I$(INCLUDEDIR) -c $*.c

newlib:                              # Delete the library
	rm -f $(LIB)

lib : $(OBJS)                        # Make the library
	ar rv $(LIB) $(OBJS)
	ranlib $(LIB)

clean:                               # Remove all the .o files
	rm -f *.o
	ls -l

backup:                              # Revision control system backup
	ci -l -m"backup"  *.c *.h *.html


.KEEP_STATE:                         # This rule will create a .make.state 
                                     # file containing dependancy and 
                                     # compilation history information.







