Files
mercury/util/Mmakefile
Julien Fischer 2a366cf295 Deprecate --no-ansi and --no-ansi-c.
--no-ansi (mgnuc) and --no-ansi-c (mmc) have not actually done anything for
many years now. Deprecate these options and remove their "use" throughout most
of the Mercury system. (The remaining uses are in the Makefiles for the Boehm
GC, which need to be updated separately.)

Also deprecate the internal compiler option --cflags-for-ansi.

compiler/options.m:
    Document that --no-ansi-c is now deprecated.

    Document that the internal option --cflags-for-ansi is now
    deprecated.

compiler/compile_target_code.m:
    Do not pass the ANSI options to the C compiler.

scripts/mgnuc.in:
scripts/mgnuc_file_opts.sh-subr:
    Deprecate the --no-ansi option; delete code that no longer does
    anything useful.

configure.ac:
    Delete the configuration variable CFLAGS_FOR_ANSI; it is only ever
    set to be empty. (The comment talks about --no-ansi doing other things
    in the mgnuc script. It used to also cause some preprocessor macros
    to be defined for compatibility with the system headers on some
    platforms -- that has not been the case since 2013.)

doc/user_guide.texi:
    Document that --no-ansi-c is deprecated.

bytecode/Mmakefile:
compiler/Mercury.options:
library/Mercury.options:
extras/odbc/odbc.m:
runtime/Mmakefile:
scripts/Mercury.config.bootstrap.in:
scripts/Mercury.config.in:
tests/hard_coded/Mercury.options:
tests/valid/Mercury.options:
trace/Mmakefile:
util/Mmakefile:
    Conform to the above change.

NEWS.md:
    Announce the above.
2023-05-31 17:44:26 +10:00

87 lines
2.6 KiB
Makefile

#-----------------------------------------------------------------------------#
# vim: ts=8 sw=8 noexpandtab ft=make
#-----------------------------------------------------------------------------#
# Copyright (C) 1995-2002, 2005, 2006-2007, 2010, 2012 The University of Melbourne.
# Copyright (C) 2013, 2019 The Mercury team.
# 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 utilities directory
MAIN_TARGET=all
#-----------------------------------------------------------------------------#
MERCURY_DIR=..
include $(MERCURY_DIR)/Mmake.common
#-----------------------------------------------------------------------------#
CFLAGS = -I$(RUNTIME_DIR) -I../getopt
PROGS=mkinit mdemangle mfiltercc info_to_mdb
PROGFILENAMES=$(PROGS:%=%$(EXT_FOR_EXE))
SRC=$(PROGS:%=%.c)
# Link in local copy of getopt() only if required.
ifeq ("$(HAVE_GETOPT)","no")
GETOPT_SRC=../getopt/getopt.c
else
GETOPT_SRC=
endif
# For the C distribution mfiltercc may not be available until after we build
# it here.
MGNUCFLAGS-mfiltercc = --no-filter-cc
#-----------------------------------------------------------------------------#
all: $(PROGFILENAMES) $(TAGS_FILE_EXISTS)
ifeq ($(USING_MICROSOFT_CL_COMPILER),yes)
.c$(EXT_FOR_EXE):
$(MGNUC) --no-mercury-stdlib-dir \
$(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -Fe$@ $< $(GETOPT_SRC)
mkinit$(EXT_FOR_EXE): mkinit.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
$(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -Fe$@ \
mkinit.c mkinit_common.c $(GETOPT_SRC)
else
.c$(EXT_FOR_EXE):
$(MGNUC) --no-mercury-stdlib-dir \
$(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ $< $(GETOPT_SRC)
mkinit$(EXT_FOR_EXE): mkinit.c mkinit_common.c mkinit_common.h
$(MGNUC) --no-mercury-stdlib-dir \
$(GRADEFLAGS) $(ALL_MGNUCFLAGS) $(ALL_LDFLAGS) -o $@ \
mkinit.c mkinit_common.c $(GETOPT_SRC)
endif
tags:
ctags $(SRC)
.PHONY: tags_file_exists
tags_file_exists:
@if test ! -f tags; then echo making tags; \
ctags $(SRC) ; fi
#-----------------------------------------------------------------------------#
.PHONY: install
install: $(PROGFILENAMES)
[ -d $(INSTALL_BINDIR) ] || mkdir -p $(INSTALL_BINDIR)
cp `vpath_find $(PROGFILENAMES)` $(INSTALL_BINDIR)
.PHONY: uninstall
uninstall:
-cd $(INSTALL_BINDIR) && rm $(PROGS)
#-----------------------------------------------------------------------------#
realclean_local:
-rm -f $(PROGFILENAMES)
#-----------------------------------------------------------------------------#