diff mbox series

Add 'cobol' to Makefile.def

Message ID 20241009164159.c2c1393fdc681345a0fb70b6@schemamania.org
State New
Headers show
Series Add 'cobol' to Makefile.def | expand

Commit Message

James K. Lowden Oct. 9, 2024, 8:41 p.m. UTC
Hello, 

I just joined the list to begin contributing patches for the COBOL
front end we've been touting for the last 4 years.  It's my first
attempt.  Please tell me if you'd like to see something different.  

What follows mimics to some degree the output of "git format-patch".  I
don't think I can use that command literally, but if I can and that
would be better, I'm happy to follow instructions.  

My plan is to send patches for one file at a time, starting from
the top of the tree.  Very soon we'll get to the front end proper, in
gcc/cobol.  After we work our way through those, there is a runtiime
library.  After that I have tests and documentation.  And then we'll be
done. Right?  ;-)  

This patch adds "cobol" as a language and subdirectory.  

--jkl


From 216ec55cdb2ad95728612d4b9b5550324e9b506fpatch 4 Oct 2024 12:01:22 -0400
From: "James K. Lowden" <jklowden@symas.com>
Date: Thu Oct 10 14:28:48 EDT 2024
Subject: [PATCH]  Add 'cobol' to 1 file

---
a/Makefile.def | +++++++
1 file changed, 7 insertions(+), 0 deletions(-)

Comments

Richard Biener Oct. 11, 2024, 12:44 p.m. UTC | #1
On Thu, Oct 10, 2024 at 9:07 PM James K. Lowden
<jklowden@schemamania.org> wrote:
>
> Hello,
>
> I just joined the list to begin contributing patches for the COBOL
> front end we've been touting for the last 4 years.  It's my first
> attempt.  Please tell me if you'd like to see something different.
>
> What follows mimics to some degree the output of "git format-patch".  I
> don't think I can use that command literally, but if I can and that
> would be better, I'm happy to follow instructions.

I checked and the patch applies using 'git am', so I think it works as-is
from a technical side.

What's missing here is a short description (what would be the git
commit message) which should also contain a properly formatted
ChangeLog part.  For this patch for example

\t* Makefile.def: Add libgcobol module and cobol language.

Specifically this patch on its own splits at unwanted granularity
and should at least come together with adding stubs in
the libgcobol toplevel directory and the gcc/cobol directory and
corresponding changes to Makefile.tpl and regenerating Makefile.in.

Possibly separate patches for libgcobol and gcc/cobol both with
changes to Makefile.def would work as well.  The idea is that
the parts when applied in series produce trees that configure
and build OK.

Richard.

> My plan is to send patches for one file at a time, starting from
> the top of the tree.  Very soon we'll get to the front end proper, in
> gcc/cobol.  After we work our way through those, there is a runtiime
> library.  After that I have tests and documentation.  And then we'll be
> done. Right?  ;-)
>
> This patch adds "cobol" as a language and subdirectory.
>
> --jkl
>
>
> From 216ec55cdb2ad95728612d4b9b5550324e9b506fpatch 4 Oct 2024 12:01:22 -0400
> From: "James K. Lowden" <jklowden@symas.com>
> Date: Thu Oct 10 14:28:48 EDT 2024
> Subject: [PATCH]  Add 'cobol' to 1 file
>
> ---
> a/Makefile.def | +++++++
> 1 file changed, 7 insertions(+), 0 deletions(-)
> diff --git a/Makefile.def b/Makefile.def
> index 19954e7d731..1192e852c7a 100644
> --- a/Makefile.def
> +++ b/Makefile.def
> @@ -209,6 +209,7 @@ target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; };
>  target_modules = { module= libitm; lib_path=.libs; };
>  target_modules = { module= libatomic; bootstrap=true; lib_path=.libs; };
>  target_modules = { module= libgrust; };
> +target_modules = { module= libgcobol; };
>
>  // These are (some of) the make targets to be done in each subdirectory.
>  // Not all; these are the ones which don't have special options.
> @@ -324,6 +325,7 @@ flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
>  flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
>  flags_to_pass = { flag= DSYMUTIL_FOR_TARGET ; };
>  flags_to_pass = { flag= FLAGS_FOR_TARGET ; };
> +flags_to_pass = { flag= GCOBOL_FOR_TARGET ; };
>  flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; };
>  flags_to_pass = { flag= GOC_FOR_TARGET ; };
>  flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; };
> @@ -655,6 +657,7 @@ lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; };
>  // built newlib on some targets (e.g. Cygwin).  It still needs
>  // a dependency on libgcc for native targets to configure.
>  lang_env_dependencies = { module=libiberty; no_c=true; };
> +lang_env_dependencies = { module=libgcobol; cxx=true; };
>
>  dependencies = { module=configure-target-fastjar; on=configure-target-zlib; };
>  dependencies = { module=all-target-fastjar; on=all-target-zlib; };
> @@ -690,6 +693,7 @@ dependencies = { module=install-target-libvtv; on=install-target-libgcc; };
>  dependencies = { module=install-target-libitm; on=install-target-libgcc; };
>  dependencies = { module=install-target-libobjc; on=install-target-libgcc; };
>  dependencies = { module=install-target-libstdc++-v3; on=install-target-libgcc; };
> +dependencies = { module=install-target-libgcobol; on=install-target-libstdc++-v3; };
>
>  // Target modules in the 'src' repository.
>  lang_env_dependencies = { module=libtermcap; };
> @@ -727,6 +731,8 @@ languages = { language=d;   gcc-check-target=check-d;
>                                 lib-check-target=check-target-libphobos; };
>  languages = { language=jit;    gcc-check-target=check-jit; };
>  languages = { language=rust;   gcc-check-target=check-rust; };
> +languages = { language=cobol;  gcc-check-target=check-cobol;
> +                               lib-check-target=check-target-libgcobol; };
>
>  // Toplevel bootstrap
>  bootstrap_stage = { id=1 ; };
>
>
>
Arsen Arsenović Oct. 12, 2024, 12:05 p.m. UTC | #2
Hi,

"James K. Lowden" <jklowden@schemamania.org> writes:

> Hello, 
>
> I just joined the list to begin contributing patches for the COBOL
> front end we've been touting for the last 4 years.  It's my first
> attempt.  Please tell me if you'd like to see something different.  
>
> What follows mimics to some degree the output of "git format-patch".  I
> don't think I can use that command literally, but if I can and that
> would be better, I'm happy to follow instructions.  
>
> My plan is to send patches for one file at a time, starting from
> the top of the tree.

It is usually preferable to make each commit a unit of work that one
could check out and run, so it'd be better if the COBOL efforts could be
either merged as one massive patch, or the entire development history is
preserved, or some inbetween IMO.

To those ends, you can use git-rebase to reorganize commits as you see
fit and reapply them on top of current GCC trunk.

The trouble that exists with doing it partially like so is that a commit
might exist that cannot be built due to gcobol being partially merged,
which makes it harder to bisect, test, and roll back.

Thanks for working on a new frontend!  :-)

> Very soon we'll get to the front end proper, in gcc/cobol.  After we
> work our way through those, there is a runtiime library.  After that I
> have tests and documentation.  And then we'll be done. Right?  ;-)
>
> This patch adds "cobol" as a language and subdirectory.  
>
> --jkl
>
>
> From 216ec55cdb2ad95728612d4b9b5550324e9b506fpatch 4 Oct 2024 12:01:22 -0400
> From: "James K. Lowden" <jklowden@symas.com>
> Date: Thu Oct 10 14:28:48 EDT 2024
> Subject: [PATCH]  Add 'cobol' to 1 file
>
> ---
> a/Makefile.def | +++++++
> 1 file changed, 7 insertions(+), 0 deletions(-)
> diff --git a/Makefile.def b/Makefile.def
> index 19954e7d731..1192e852c7a 100644
> --- a/Makefile.def
> +++ b/Makefile.def
> @@ -209,6 +209,7 @@ target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; };
>  target_modules = { module= libitm; lib_path=.libs; };
>  target_modules = { module= libatomic; bootstrap=true; lib_path=.libs; };
>  target_modules = { module= libgrust; };
> +target_modules = { module= libgcobol; };
>  
>  // These are (some of) the make targets to be done in each subdirectory.
>  // Not all; these are the ones which don't have special options.
> @@ -324,6 +325,7 @@ flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
>  flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
>  flags_to_pass = { flag= DSYMUTIL_FOR_TARGET ; };
>  flags_to_pass = { flag= FLAGS_FOR_TARGET ; };
> +flags_to_pass = { flag= GCOBOL_FOR_TARGET ; };
>  flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; };
>  flags_to_pass = { flag= GOC_FOR_TARGET ; };
>  flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; };
> @@ -655,6 +657,7 @@ lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; };
>  // built newlib on some targets (e.g. Cygwin).  It still needs
>  // a dependency on libgcc for native targets to configure.
>  lang_env_dependencies = { module=libiberty; no_c=true; };
> +lang_env_dependencies = { module=libgcobol; cxx=true; };
>  
>  dependencies = { module=configure-target-fastjar; on=configure-target-zlib; };
>  dependencies = { module=all-target-fastjar; on=all-target-zlib; };
> @@ -690,6 +693,7 @@ dependencies = { module=install-target-libvtv; on=install-target-libgcc; };
>  dependencies = { module=install-target-libitm; on=install-target-libgcc; };
>  dependencies = { module=install-target-libobjc; on=install-target-libgcc; };
>  dependencies = { module=install-target-libstdc++-v3; on=install-target-libgcc; };
> +dependencies = { module=install-target-libgcobol; on=install-target-libstdc++-v3; };
>  
>  // Target modules in the 'src' repository.
>  lang_env_dependencies = { module=libtermcap; };
> @@ -727,6 +731,8 @@ languages = { language=d;	gcc-check-target=check-d;
>  				lib-check-target=check-target-libphobos; };
>  languages = { language=jit;	gcc-check-target=check-jit; };
>  languages = { language=rust;	gcc-check-target=check-rust; };
> +languages = { language=cobol;	gcc-check-target=check-cobol;
> +				lib-check-target=check-target-libgcobol; };
>  
>  // Toplevel bootstrap
>  bootstrap_stage = { id=1 ; };
diff mbox series

Patch

diff --git a/Makefile.def b/Makefile.def
index 19954e7d731..1192e852c7a 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -209,6 +209,7 @@  target_modules = { module= libgomp; bootstrap= true; lib_path=.libs; };
 target_modules = { module= libitm; lib_path=.libs; };
 target_modules = { module= libatomic; bootstrap=true; lib_path=.libs; };
 target_modules = { module= libgrust; };
+target_modules = { module= libgcobol; };
 
 // These are (some of) the make targets to be done in each subdirectory.
 // Not all; these are the ones which don't have special options.
@@ -324,6 +325,7 @@  flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
 flags_to_pass = { flag= DSYMUTIL_FOR_TARGET ; };
 flags_to_pass = { flag= FLAGS_FOR_TARGET ; };
+flags_to_pass = { flag= GCOBOL_FOR_TARGET ; };
 flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; };
 flags_to_pass = { flag= GOC_FOR_TARGET ; };
 flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; };
@@ -655,6 +657,7 @@  lang_env_dependencies = { module=libgcc; no_gcc=true; no_c=true; };
 // built newlib on some targets (e.g. Cygwin).  It still needs
 // a dependency on libgcc for native targets to configure.
 lang_env_dependencies = { module=libiberty; no_c=true; };
+lang_env_dependencies = { module=libgcobol; cxx=true; };
 
 dependencies = { module=configure-target-fastjar; on=configure-target-zlib; };
 dependencies = { module=all-target-fastjar; on=all-target-zlib; };
@@ -690,6 +693,7 @@  dependencies = { module=install-target-libvtv; on=install-target-libgcc; };
 dependencies = { module=install-target-libitm; on=install-target-libgcc; };
 dependencies = { module=install-target-libobjc; on=install-target-libgcc; };
 dependencies = { module=install-target-libstdc++-v3; on=install-target-libgcc; };
+dependencies = { module=install-target-libgcobol; on=install-target-libstdc++-v3; };
 
 // Target modules in the 'src' repository.
 lang_env_dependencies = { module=libtermcap; };
@@ -727,6 +731,8 @@  languages = { language=d;	gcc-check-target=check-d;
 				lib-check-target=check-target-libphobos; };
 languages = { language=jit;	gcc-check-target=check-jit; };
 languages = { language=rust;	gcc-check-target=check-rust; };
+languages = { language=cobol;	gcc-check-target=check-cobol;
+				lib-check-target=check-target-libgcobol; };
 
 // Toplevel bootstrap
 bootstrap_stage = { id=1 ; };