DST = /usr/local/lib/lmlc
ASM = ../../bin/asm
.SUFFIXES:
.SUFFIXES: .M .o .c

all: runtime.o cinterface

runtime.o:	mrun.o crun.o Makefile traceback.o
	ld -x -r crun.o mrun.o traceback.o -o runtime.o
	cp runtime.o ../lib/runtime.o

runtime_p.o:	mrun_p.o crun_p.o Makefile
	ld -x -r crun_p.o mrun_p.o -o runtime_p.o
	cp runtime_p.o ../lib/runtime_p.o

#install: runtime.o runtime_p.o
#	cp runtime.o runtime_p.o $(DST)/lib
install: runtime.o
	cp runtime.o $(DST)/lib

mrun.o:	runtime.M
	$(ASM) runtime.M; mv runtime.o mrun.o

mrun_p.o:	runtime.M
	$(ASM) -DPROFILE runtime.M; mv runtime.o mrun_p.o

crun.o:	*.c
	cc -DPARALLEL=0 -c -g ${CFLAGS} crun.c

crun_p.o:	*.c
	cc -DPARALLEL=0 -c -pg ${CFLAGS} crun.c; mv crun.o crun_p.o


cinterface:	cinterface.c
		cc cinterface.c -o cinterface
