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

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


SOURCES	  = bits.c deflate.c gzip.c getopt.c inflate.c lzw.c \
						spec.c trees.c unlzh.c unlzw.c unpack.c unzip.c  \
						util.c zip.c
CFLAGS = -Wall -O3 -DMFRANK_GROUP -DSPEC_GZIP 

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

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

#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
#
include $(XTOOLS_DIR)/Makefile.include
