Patch for language specific Makefile check targets

Steve Ellcey sje@cup.hp.com
Tue Mar 31 21:09:00 GMT 2009


On Tue, 2009-03-31 at 11:40 +0200, Paolo Bonzini wrote:

> The if is not needed because you are within an "@if gcc" block of
> Makefile.tpl.  Otherwise okay, but please can you investigate generating
> it automatically from Makefile.def, like
> 
> language = { language=c; gcc-check-target=check-gcc; }
> language = { language=fortran; check-target=check-target-libgfortran;
>              gcc-check-target=check-fortran; }
> 
> Thanks!
> 
> Paolo

OK, here is a new version using Makefile.def and generic targets in
Makefile.tpl that get expanded by autogen.  I also added the
check-obj-c++ and check-gcc-obj-c++ targets that David Ayers asked about,
check-obj-c++  tests both the objc and libstdc++-v3 runtime libraries in
addition to the obj-c++ compiler.

OK to checkin?

Steve Ellcey
sje@cup.hp.com


2009-03-31  Steve Ellcey  <sje@cup.hp.com>

	* Makefil.def (languages): New entries.
	* Makefile.tpl (check-gcc-<language>): New generic target.
	(check-gcc-c++): Removed, replaced with above.
	(check-<language>) New generic target.
	(check-c++): Removed, replaced with above.
	* Makefile.in: Regenerate.
	* gcc/doc/sourcebuild.texi: Update front-end requirements.


Index: Makefile.def
===================================================================
--- Makefile.def	(revision 145326)
+++ Makefile.def	(working copy)
@@ -541,6 +541,20 @@ dependencies = { module=all-target-libgl
 dependencies = { module=all-target-winsup; on=all-target-libiberty; };
 dependencies = { module=all-target-winsup; on=all-target-libtermcap; };
 
+languages = { language=c;	gcc-check-target=check-gcc; };
+languages = { language=c++;	gcc-check-target=check-c++;
+				lib-check-target=check-target-libstdc++-v3; };
+languages = { language=fortran;	gcc-check-target=check-fortran;
+				lib-check-target=check-target-libgfortran; };
+languages = { language=java;	gcc-check-target=check-java;
+				lib-check-target=check-target-libjava; };
+languages = { language=ada;	gcc-check-target=check-ada;
+				lib-check-target=check-target-libada; };
+languages = { language=objc;	gcc-check-target=check-objc;
+				lib-check-target=check-target-libobjc; };
+languages = { language=obj-c++;	gcc-check-target=check-obj-c++;
+				lib-check-target="check-target-libobjc check-target-libstdc++-v3"; };
+
 // Toplevel bootstrap
 bootstrap_stage = {
 	id=1 ;
Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 145326)
+++ Makefile.tpl	(working copy)
@@ -1216,19 +1216,15 @@ cross: all-build all-gas all-ld
 @endif gcc-no-bootstrap
 
 @if gcc
-.PHONY: check-gcc-c++
-check-gcc-c++:
-	@if [ -f ./gcc/Makefile ] ; then \
-	  r=`${PWD_COMMAND}`; export r; \
-	  s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	  $(HOST_EXPORTS) \
-	  (cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) check-c++); \
-	else \
-	  true; \
-	fi
-
-.PHONY: check-c++
-check-c++: check-target-libstdc++-v3 check-gcc-c++
+[+ FOR languages +]
+.PHONY: check-gcc-[+language+] check-[+language+]
+check-gcc-[+language+]:
+	r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(HOST_EXPORTS) \
+	(cd gcc && $(MAKE) $(GCC_FLAGS_TO_PASS) [+gcc-check-target+]);
+check-[+language+]: check-gcc-[+language+][+ IF lib-check-target +] [+ lib-check-target +][+ ENDIF lib-check-target +]
+[+ ENDFOR languages +]
 
 # Install the gcc headers files, but not the fixed include files,
 # which Cygnus is not allowed to distribute.  This rule is very
Index: gcc/doc/sourcebuild.texi
===================================================================
--- gcc/doc/sourcebuild.texi	(revision 145326)
+++ gcc/doc/sourcebuild.texi	(working copy)
@@ -499,6 +499,9 @@ directory.  FIXME: document this further
 @item
 Details of the directories of any runtime libraries in
 @file{gcc/doc/sourcebuild.texi}.
+@item
+Check targets in Makefile.def for the top-level Makefile to check just
+the compiler or the compiler and runtime library for the language.
 @end itemize
 
 If the front end is added to the official GCC source repository, the



More information about the Gcc-patches mailing list