[m-rev.] diff: fix problem with recompilation_check.c
Fergus Henderson
fjh at cs.mu.OZ.AU
Sat Jun 30 01:56:22 AEST 2001
Simon's change which added "recompilation_check.m" stopped the compiler from
compiling in MLDS grades. The problem was that it was conflicting with the
Mmake rule which I added to runtime/Mmakefile and which Zoltan moved to
Mmake.common.in:
| # This rule helps to check that header files is self-contained, i.e. that
| # each header file foo.h includes any other header files that define types
| # used by foo.h. It creates a foo_check.c file that contains only a single
| # `#include' statement that includes foo.h; compiling foo_check.c will fail
| # if foo.h is not self-contained.
|
| %_check.c : %.h
| echo "#include \"$*.h\"" > $*_check.c
Unfortunately this rule was taking precedence over the "%.c: %.m" rule,
with unfortunately consequences...
Hence the following fix.
----------
Estimated hours taken: 0.5
Branches: main
Mmake.common.in:
runtime/Mmakefile:
trace/Mmakefile:
Change "_check." to ".check.", to avoid a problem
where the rule for %_check.c: %.h was being accidentally
triggered for compiler/recompilation_check.c.
Workspace: /mnt/mars/home/mars/fjh/ws1/mercury
Index: Mmake.common.in
===================================================================
RCS file: /home/mercury1/repository/mercury/Mmake.common.in,v
retrieving revision 1.57
diff -u -d -r1.57 Mmake.common.in
--- Mmake.common.in 2001/06/05 14:14:52 1.57
+++ Mmake.common.in 2001/06/29 15:49:40
@@ -256,12 +256,12 @@
# This rule helps to check that header files is self-contained, i.e. that each
# header file foo.h includes any other header files that define types
-# used by foo.h. It creates a foo_check.c file that contains only a single
-# `#include' statement that includes foo.h; compiling foo_check.c will fail
+# used by foo.h. It creates a foo.check.c file that contains only a single
+# `#include' statement that includes foo.h; compiling foo.check.c will fail
# if foo.h is not self-contained.
-%_check.c : %.h
- echo "#include \"$*.h\"" > $*_check.c
+%.check.c : %.h
+ echo "#include \"$*.h\"" > $*.check.c
# This rule checks whether a header file defines any macros it shouldn't.
# It generates the list of macros defined in the header file, and filters this
@@ -270,10 +270,10 @@
# the HEADER_CLEAN_FILTER make variable to contain this command.
AWK = awk
-%_check.macros: %.h %_check.c
+%.check.macros: %.h %.check.c
-$(MGNUC) $(ALL_GRADEFLAGS) $(ALL_MGNUCFLAGS) \
-DMERCURY_BOOTSTRAP_H \
- -E $*_check.c \
+ -E $*.check.c \
-nostdinc -dN \
2> /dev/null | $(AWK) '/^#define/ { print $$2; }' | \
$(HEADER_CLEAN_FILTER) | sort -u > $@
Index: runtime/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/runtime/Mmakefile,v
retrieving revision 1.73
diff -u -d -r1.73 Mmakefile
--- runtime/Mmakefile 2001/06/22 03:14:31 1.73
+++ runtime/Mmakefile 2001/06/29 15:50:10
@@ -191,9 +191,9 @@
esac \
`
-HDR_CHECK_CS = $(HDRS:.h=_check.c)
-HDR_CHECK_OBJS = $(HDRS:.h=_check.$O)
-HDR_CHECK_MACROS = $(HDRS:.h=_check.macros)
+HDR_CHECK_CS = $(HDRS:.h=.check.c)
+HDR_CHECK_OBJS = $(HDRS:.h=.check.$O)
+HDR_CHECK_MACROS = $(HDRS:.h=.check.macros)
OBJ_CHECKS = $(OBJS:%=%.obj_check)
#-----------------------------------------------------------------------------#
Index: trace/Mmakefile
===================================================================
RCS file: /home/mercury1/repository/mercury/trace/Mmakefile,v
retrieving revision 1.22
diff -u -d -r1.22 Mmakefile
--- trace/Mmakefile 2001/05/18 14:23:59 1.22
+++ trace/Mmakefile 2001/06/29 15:50:18
@@ -76,9 +76,9 @@
OBJS = $(CFILES:.c=.$O)
PIC_OBJS = $(CFILES:.c=.$(EXT_FOR_PIC_OBJECTS))
-HDR_CHECK_CS = $(HDRS:.h=_check.c)
-HDR_CHECK_OBJS = $(HDRS:.h=_check.$O)
-HDR_CHECK_MACROS = $(HDRS:.h=_check.macros)
+HDR_CHECK_CS = $(HDRS:.h=.check.c)
+HDR_CHECK_OBJS = $(HDRS:.h=.check.$O)
+HDR_CHECK_MACROS = $(HDRS:.h=.check.macros)
OBJ_CHECKS = $(OBJS:%=%.obj_check)
LDFLAGS = -L$(BROWSER_DIR) -L$(LIBRARY_DIR) \
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post: mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------
More information about the reviews
mailing list