VPATH = /home/mfrank/mfrank/projects/05-08-10/try3/ece511/apps/parser
XTOOLS_DIR = /home/mfrank/polyflow-tools/
all: mipsver

# STRIP OFF THE .c and .f
STEMS = $(patsubst %.f,%, $(patsubst %.c,%, $(SOURCES)))
OBJS = $(patsubst %,%.o,$(STEMS))
SPLITOBJS = $(patsubst %,%.split.o,$(STEMS))


SOURCES	  = analyze-linkage.c and.c build-disjuncts.c extract-links.c \
	    fast-match.c idiom.c main.c massage.c parse.c \
	    post-process.c print.c prune.c read-dict.c utilities.c \
	    xalloc.c word-file.c strncasecmp.c
CFLAGS = -Wall -O3

mipsver: $(OBJS)
	$(RLD) -EL -o $@ $(LIBDIR_FLAGS) \
		$^ $(XTOOLS_DIR)/lib/crt0.o \
		-lc -lm -lgcc

unixver: $(SOURCES)
	gcc $(CFLAGS) -D_user_main=main -o $@ $^ -lm

test.out: mipsver data-links
	$(PIPESIM) mipsver 2.1.dict -batch < src/data/test.in | tee test.out

smred.out: mipsver data-links
	$(PIPESIM) mipsver 2.1.dict -batch < src/data/smred.in | tee smred.out

super-small.out: mipsver
	$(ARCHSIM) mipsver src/data/super-small.dict -batch < src/data/smred.in | tee super-small.out

data-links:
	-ln -s src/data/2.1.dict
	-ln -s src/data/words

include $(XTOOLS_DIR)/Makefile.include
