#
#	This is the Makefile for the Modula-2 profiler
#

$INCLUDE "../Metafile.defines"

.SUFFIXES:
.SUFFIXES: .o .mod .def .c
MODFLAGS = -O -a -g -C -B../lib
MOD = ../mod/mod

.def.mod:
	touch $*.mod
.mod.o:
	$(MOD) -c ${MODFLAGS} $*.mod

all: modprof

modprof:	modprof.o
	$(MOD) -o modprof $(MODFLAGS) modprof.o

Makefile: Metafile ../Metafile.defines
	mv Makefile Makefile.bak
	../prep/prep -Dvax=$(VAX) -Dmips=$(MIPS) <Metafile > Makefile

quickinstall: ${DESTDIR}$(BINDIR)
	install -c -s modprof ${DESTDIR}$(BINDIR)/$(MODPROFBINNAME)

install: ${DESTDIR}$(BINDIR) ${DESTDIR}$(BINDIR)/$(MODPROFBINNAME)

${DESTDIR}$(BINDIR):
	-test -d $@ || $(MKDIR) $@

${DESTDIR}$(BINDIR)/$(MODPROFBINNAME): modprof
	install -c -s modprof ${DESTDIR}$(BINDIR)/$(MODPROFBINNAME)

clean:
	-$(RM) *.o modprof

ci:
