#-----------------------------------------------------------------------------#
# Copyright (C) 1995 University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public License - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#

# Mmake - Mmake file for the Mercury util library

MAIN_TARGET=all

#-----------------------------------------------------------------------------#

MERCURY_DIR=..
include ../Mmake.common

#-----------------------------------------------------------------------------#

MGNUC	= ../scripts/mgnuc
CFLAGS	= -I ../runtime
# we need -I ../runtime for "getopt.h"

#-----------------------------------------------------------------------------#

all: mkinit mdemangle

mkinit:	mkinit.c
	$(MGNUC) -s $(GRADE) $(CFLAGS) -o mkinit mkinit.c

mdemangle: mdemangle.c
	$(MGNUC) -s $(GRADE) $(CFLAGS) -o mdemangle mdemangle.c

#-----------------------------------------------------------------------------#

.PHONY: install
install: mkinit mdemangle
	[ -d $(INSTALL_BINDIR) ] || mkdir -p $(INSTALL_BINDIR)
	cp `vpath_find mkinit mdemangle` $(INSTALL_BINDIR)

#-----------------------------------------------------------------------------#

realclean:
	-rm -f mkinit mdemangle

#-----------------------------------------------------------------------------#
