Files
mercury/mfilterjavac/Mmakefile
Zoltan Somogyi f9c185e5e8 Start actively using --generate-dependencies-ints.
configure.ac:
    Require the installed compiler to support both the option,
    and the Mmake rules that invoke it.

compiler/Mmakefile:
library/Mmakefile:
mdbcomp/Mmakefile:
mfilterjavac/Mmakefile:
ssdb/Mmakefile:
    Get the mmake depend to depend on prog.depend_ints, not prog.depend,

    Give the prog.depend_ints targets themselves the same prerequisites
    as the existing prog.depend targets.

    In mfilterjavac/Mmakefile, fix what looks like an old problem
    by making the depend target a prerequisite of the check and ints targets.
2023-10-20 20:11:45 +11:00

185 lines
5.2 KiB
Makefile

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab ft=make
#-----------------------------------------------------------------------------#
# Copyright (C) 2013 The University of Melbourne.
# This file may only be copied under the terms of the GNU General
# Public Licence - see the file COPYING in the Mercury distribution.
#-----------------------------------------------------------------------------#
# This is the Mmakefile for building the mfilterjavac tool.
MERCURY_DIR=..
LINK_STATIC=yes
include $(MERCURY_DIR)/Mmake.common
#----------------------------------------------------------------------------#
-include Mmake.mfilterjavac.params
# Override the default rule in `mmake --use-mmc-make' that asks `mmc' to
# create a missing optional params file.
Mmake.mfilterjavac.params:
# Module-specific options should go in Mercury.options so they can be found
# by `mmc --make'. But this hasn't been used in this directory so far,
# so it is commented out.
# include Mercury.options
MAIN_TARGET = all
ALL_MODULES = mfilterjavac
MAIN_TARGET=all
MERCURY_MAIN_MODULES=$(ALL_MODULES)
DEPENDS=$(patsubst %,%.depends,$(ALL_MODULES))
DEPEND_INTS=$(patsubst %,%.depend_ints,$(ALL_MODULES))
PDBS=$(patsubst %,%.pdb,$(ALL_MODULES))
VPATH = $(LIBRARY_DIR) $(SSDB_DIR)
#-----------------------------------------------------------------------------#
MLFLAGS += --shared
MCFLAGS += --flags MFILTERJAVAC_FLAGS $(CONFIG_OVERRIDE)
#-----------------------------------------------------------------------------#
# Tell the C# compiler where the stdlib assembly is.
#
ifneq ("$(filter csharp%,$(GRADE))","")
CSCFLAGS=-lib:../library -r:mer_std.dll
endif
#-----------------------------------------------------------------------------#
ifneq ("$(filter csharp% java%,$(GRADE))","")
MLOBJS =
endif
#-----------------------------------------------------------------------------#
.PHONY: nothing
nothing:
.PHONY: depend
depend: $(DEPEND_INTS)
$(DEPENDS): MFILTERJAVAC_FLAGS
$(DEPEND_INTS): MFILTERJAVAC_FLAGS
.PHONY: all
all: $(ALL_MODULES) $(TAGS_FILE_EXISTS)
#-----------------------------------------------------------------------------#
# Add some additional dependencies, so that Mmake knows to remake the
# profiler if one of the libraries changes.
ifeq ("$(filter csharp% java%,$(GRADE))","")
mfilterjavac: \
$(RUNTIME_DIR)/lib$(RT_LIB_NAME).$A \
$(LIBRARY_DIR)/lib$(STD_LIB_NAME).$A
endif
$(cs_subdir)mfilterjavac.c: $(UTIL_DIR)/mkinit$(EXT_FOR_EXE)
#-----------------------------------------------------------------------------#
.PHONY: check
check: depend $(patsubst %,%.check,$(ALL_MODULES))
.PHONY: ints
ints: depend $(patsubst %,%.ints,$(ALL_MODULES))
#-----------------------------------------------------------------------------#
# We need the shenanigans with .mfilterjavac_tags to avoid situations in
# which an "mmake tags" in this directory does nothing even in the absence
# of a tags file in this directory, because mmake uses VPATH to find
# ../library/tags and believes it to be the tags file we are asking for.
.PHONY: tags
tags: .mfilterjavac_tags
.mfilterjavac_tags: $(MTAGS) $(wildcard *.m) $(wildcard $(LIBRARY_DIR)/*.m)
$(MTAGS) *.m $(LIBRARY_DIR)/*.m
@touch .mfilterjavac_tags
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; \
then \
echo making tags; \
$(MTAGS) *.m $(LIBRARY_DIR)/*.m; \
touch .mfilterjavac_tags; \
fi
#-----------------------------------------------------------------------------#
.PHONY: dates
dates:
touch $(mfilterjavac.dates)
#-----------------------------------------------------------------------------#
# The documentation of the reason for this set of rules
# can be found in library/Mmakefile.
.PHONY: os cs css javas
ifeq ($(MMAKE_USE_MMC_MAKE),yes)
all_os: mfilterjavac.all_os
all_cs: mfilterjavac.all_cs
all_css: mfilterjavac.all_css
all_javas: mfilterjavac.all_javas
else
ifneq ($(origin mfilterjavac.all_os),undefined)
all_os: $(mfilterjavac.all_os)
all_cs: $(mfilterjavac.all_cs)
all_css: $(mfilterjavac.all_css)
all_javas: $(mfilterjavac.all_javas)
else
all_os:
mmake depend; mmake all_os
all_cs:
mmake depend; mmake all_cs
all_css:
mmake depend; mmake all_css
all_javas:
mmake depend; mmake all_javas
endif
endif
#-----------------------------------------------------------------------------#
realclean_local:
rm -f .mfilterjavac_tags tags \
MFILTERJAVAC_FLAGS MFILTERJAVAC_FLAGS.date $(PDBS) vc*.pdb
#-----------------------------------------------------------------------------#
# Installation target.
# See the comment above the 'install_compiler' target in compiler/Mmakefile
# for the reasons why we handle the java grade specially here.
#
ifeq ($(findstring java,$(GRADE)),java)
INSTALL_PROGRAM=mfilterjavac.jar
else
INSTALL_PROGRAM=mfilterjavac$(EXT_FOR_EXE)
endif
install: mfilterjavac
-test -d $(INSTALL_MERC_BIN_DIR) || mkdir -p $(INSTALL_MERC_BIN_DIR)
cp `vpath_find $(INSTALL_PROGRAM)` $(INSTALL_MERC_BIN_DIR)/$(INSTALL_PROGRAM)
#-----------------------------------------------------------------------------#
.PHONY: uninstall
uninstall:
-rm -f $(INSTALL_MERC_BIN_DIR)/$(INSTALL_PROGRAM)
#-----------------------------------------------------------------------------#