Files
mercury/bytecode/Mmakefile
Bert Thompson fd811ddee7 For consistency with the rest of Mercury, we use an Mmakefile in
Estimated hours taken: 2

For consistency with the rest of Mercury, we use an Mmakefile in
the bytecode directory.

bytecode/Mmakefile:
	Added Mmakefile.
1997-03-26 07:25:38 +00:00

92 lines
2.4 KiB
Plaintext

#-----------------------------------------------------------------------------#
# Copyright (C) 1997 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 bytecode utilities
MAIN_TARGET=all
MERCURY_DIR=..
include $(MERCURY_DIR)/Mmake.common
#-----------------------------------------------------------------------------#
INCPATH = -I$(MERCURY_DIR)/runtime -I$(MERCURY_DIR)/boehm_gc -I.
CFLAGS = -g $(EXTRA_CFLAGS) -D_POSIX_SOURCE $(INCPATH)
MGNUC = MERCURY_C_INCL_DIR=. $(SCRIPTS_DIR)/mgnuc
MGNUCFLAGS = $(CFLAGS)
MAKEDEPEND = makedepend
# We need VPATH so we can find getopt.h (!)
VPATH = $(MERCURY_DIR)/runtime
#-----------------------------------------------------------------------------#
HDRS = bytecode.h disasm.h getopt.h mbi.h mem.h machine.h \
mdis.h static_data.h template.h util.h
ORIG_CS = bytecode.c disasm.c machine.c mbi.c mdis.c mem.c \
static_data.c template.c util.c
OBJS = $(ORIG_CS:.c=.o)
#-----------------------------------------------------------------------------#
$(OBJS) $(PIC_OBJS): $(HDRS) $(MACHHDRS)
#-----------------------------------------------------------------------------#
.PHONY: all
all: mdis mbi
mdis: bytecode.o disasm.o mdis.o mem.o util.o
$(MGNUC) $(CFLAGS) -o mdis $^
mbi: bytecode.o mbi.o mem.o util.o
$(MGNUC) $(CFLAGS) -o mbi $^
tags: $(ORIG_CS)
ctags $(ORIG_CS)
.PHONY: check_headers
check_headers:
for file in $(HDRS); do \
echo "$$file"; \
echo "#include \"$$file\"" > tmp.c; \
$(MGNUC) $(MGNUCFLAGS) -c tmp.c || exit 1; \
done
rm -f tmp.c
# Create dependencies.
depend: $(ORIG_CS) $(HDR)
if test ! -f depend.mk ; then touch depend.mk ; else true ; fi
$(MAKEDEPEND) $(INCPATH) -f depend.mk $^
#-----------------------------------------------------------------------------#
# installation rules
install:
echo "Module \"bytecode\" does not yet install anything."
uninstall:
echo "Nothing to uninstall for module \"bytecode\""
#-----------------------------------------------------------------------------#
clean:
rm -f *.o *.pic_o
realclean: clean
-$(RM) mbi mdis depend.mk*
#-----------------------------------------------------------------------------#
-include depend.mk
#-----------------------------------------------------------------------------#