PROF=-prof -auto-all
#PROF=
OPTIMISE=-O2 -fvia-C -O2-for-C
SYSLIBS=-syslib lang
HCFLAGS=$(PROF) $(SYSLIBS) $(OPTIMISE) -c -Wall
LINKFLAGS=$(PROF) $(SYSLIBS) $(OPTIMISE) -Wall
HC = ghc

LS_SRC=MD5.lhs MD5Sum.lhs
LS_OBJ=MD5.o MD5Sum.o

all: MD5Sum.o
	$(HC) $(SYSLIBS) -o md5sum $(LINKFLAGS) $(LS_OBJ)

%.o: %.lhs
	$(HC) $(HCFLAGS) $<

clean:
	rm -f *.o *.hi core md5sum *~ *.bak

depend:
	ghc -M $(SYSLIBS) $(LS_SRC)
	sed "s/\([^\*\\]\)\.hi/\1.o/g" < Makefile > Makefile.new
	mv Makefile.new Makefile

# DO NOT DELETE: Beginning of Haskell dependencies
MD5.o : MD5.lhs
MD5Sum.o : MD5Sum.lhs
MD5Sum.o : ./MD5.o
# DO NOT DELETE: End of Haskell dependencies
