# NOTE: If you are not using the fancy CMU version of make that looks
# at Makeconf, uncomment one the the following.

# Enable all the speed hacks:
# DEFINES = -DFAST
# CFLAGS = -O -s

# Enable some hopefully unnecessary checks:
# DEFINES =
# CFLAGS = -g

# Disable the method cache:
# DEFINES = -DFAST -DNO_METH_CACHE
# CFLAGS = -O -s

all: emulator .linted

OBJFILES = emulator.o mymalloc.o worldio.o gc.o stacks.o weak.o $(EXTRAS)
INCLUDES = emulator.h config.h stacks.h gc.h
MISC = Makefile

CFILES = $(OBJFILES:.o=.c)

$(OBJFILES) : emulator.h config.h
emulator.o gc.o stacks.o : stacks.h
gc.o weak.o : gc.h

.c.o: ; $(CC) $(CFLAGS) $(DEFINES) -c $*.c

emulator: $(OBJFILES)
	$(CC) $(CFLAGS) -o $@ $(OBJFILES)

.linted: $(CFILES) $(INCLUDES)
	lint -b $(DEFINES) $(CFILES)
	touch .linted

release:
	copy ../../fast/makefile  ../../../$(RELEASEDIR)/src/fast
	copy ../../safe/makefile  ../../../$(RELEASEDIR)/src/safe
	copy ../../Makeconf       ../../../$(RELEASEDIR)/src
	copy ../../src/*.[ch]     ../../../$(RELEASEDIR)/src/src
	copy ../../src/Makefile   ../../../$(RELEASEDIR)/src/src
#	copy $(CFILES) $(INCLUDES) $(MISC) ../../../$(RELEASEDIR)/src/src
