
#
# Makefile for the Garbage Collector.
#

#CC = quantify -cache-dir=/usr/u/til/fms/Work/GC/quantify/cache gcc
CC = gcc
CFLAGS = -O2 -DFAST_CLOCK -DNDEBUG -DHARD_LIMIT -DINLINE_INNER_LOOP -DREGISTER_ALLOCATE -Wall
# -DLOGGING to get printouts during runs.
# -DHARD_LIMIT to force collector to stay confined to initial heap size.
# -DNDEBUG to turn off assertions
# -DREGISTER_ALLOCATE to put the allocptr in a register
# -DINLINE_INNER_LOOP to inline the inner loop.
# -DPAGE_BLACKLISTING to blacklist pages.(Doesn't seem to help at all.)
# -DGENERATIONS to turn generations on.
# -DFAST_CLOCK to turn on a fast real time clock for precise measurements.
#
LDFLAGS =

SOURCES = \
	collect.c \
	conservative.c \
	heap.c \
	implicitQueue.c \
	machine.c \
	object.c \
	page.c \
	external.c \
	deque.c \
	debug.c

SOURCES_INLINE = \
	inline.c \
	conservative.c \
	heap.c \
	machine.c \
	page.c \
	external.c \
	deque.c \
	debug.c

HEADERS = \
	dataStructures.h \
	prototypes.h \
	pageHeader.h \
	header.h \
	debug.h \
	macros.h \
	object.h

OBJECTS = $(SOURCES:.c=.o)
OBJECTS_INLINE = $(SOURCES_INLINE:.c=.o)

##############################
# Targets
##############################

gc.a_inline: $(OBJECTS_INLINE)
	ar qc gc.a $(OBJECTS_INLINE)
	ranlib gc.a

gc.a:	$(OBJECTS)
	ar qc gc.a $(OBJECTS)
	ranlib gc.a

mutator: mutator.c $(OBJECTS)
	$(CC) $(CFLAGS) $(LDFLAGS) mutator.c $(OBJECTS) -o mutator

mutator_inline: mutator.c $(OBJECTS_INLINE)
	$(CC) $(CFLAGS) $(LDFLAGS) mutator.c $(OBJECTS_INLINE) -o mutator

objects: $(OBJECTS)

depend:
	-rm -f .depend
	$(CC) $(CFLAGS) -M $(SOURCES) > .depend 

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

# EOF: Makefile
