From 7f4a026cbc1e6ae96a987ea0903d757f63661e2f Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Thu, 20 Feb 2025 00:38:53 +0100 Subject: [PATCH] Add generic documentation --- .gitignore | 1 + gcc/Make-lang.in | 34 +++++++++++- gcc/elna-spec.cc | 2 +- gcc/elna1.cc | 8 +++ gcc/gelna.texi | 135 ++++++++++++++++++++++++++++++++++++++++++++++ gcc/lang-specs.h | 4 +- gcc/lang.opt.urls | 2 + 7 files changed, 182 insertions(+), 4 deletions(-) create mode 100644 gcc/gelna.texi create mode 100644 gcc/lang.opt.urls diff --git a/.gitignore b/.gitignore index 84c048a..0ee919a 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /build/ +a.out diff --git a/gcc/Make-lang.in b/gcc/Make-lang.in index e8d5369..3e7190b 100644 --- a/gcc/Make-lang.in +++ b/gcc/Make-lang.in @@ -61,6 +61,14 @@ elna.rest.encap: # No elna-specific selftests. selftest-elna: +ELNA_TEXI_FILES = \ + elna/gcc/gelna.texi \ + $(srcdir)/doc/include/fdl.texi \ + $(srcdir)/doc/include/gpl_v3.texi \ + $(srcdir)/doc/include/funding.texi \ + $(srcdir)/doc/include/gcc-common.texi \ + gcc-vers.texi + elna.install-common: installdirs -rm -f $(DESTDIR)$(bindir)/$(ELNA_INSTALL_NAME)$(exeext) $(INSTALL_PROGRAM) gelna$(exeext) $(DESTDIR)$(bindir)/$(ELNA_INSTALL_NAME)$(exeext) @@ -68,16 +76,38 @@ elna.install-common: installdirs ( cd $(DESTDIR)$(bindir) && \ $(LN) $(ELNA_INSTALL_NAME)$(exeext) $(ELNA_TARGET_INSTALL_NAME)$(exeext) ); \ +$(build_htmldir)/gelna/index.html: $(ELNA_TEXI_FILES) + $(mkinstalldirs) $(@D) + rm -f $(@D)/* + $(TEXI2HTML) -I $(gcc_docdir)/include -I $(srcdir)/elna -o $(@D) $< + # Required goals, they still do nothing elna.install-man: elna.install-info: elna.install-pdf: elna.install-plugin: -elna.install-html: + +elna.install-html: $(build_htmldir)/gelna + @$(NORMAL_INSTALL) + test -z "$(htmldir)" || $(mkinstalldirs) "$(DESTDIR)$(htmldir)" + @for p in $(build_htmldir)/gelna; do \ + if test -f "$$p" || test -d "$$p"; then d=""; else d="$(srcdir)/"; fi; \ + f=$(html__strip_dir) \ + if test -d "$$d$$p"; then \ + echo " $(mkinstalldirs) '$(DESTDIR)$(htmldir)/$$f'"; \ + $(mkinstalldirs) "$(DESTDIR)$(htmldir)/$$f" || exit 1; \ + echo " $(INSTALL_DATA) '$$d$$p'/* '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d$$p"/* "$(DESTDIR)$(htmldir)/$$f"; \ + else \ + echo " $(INSTALL_DATA) '$$d$$p' '$(DESTDIR)$(htmldir)/$$f'"; \ + $(INSTALL_DATA) "$$d$$p" "$(DESTDIR)$(htmldir)/$$f"; \ + fi; \ + done + elna.info: elna.dvi: elna.pdf: -elna.html: +elna.html: $(build_htmldir)/gelna/index.html elna.man: elna.mostlyclean: elna.clean: diff --git a/gcc/elna-spec.cc b/gcc/elna-spec.cc index 3489958..5d1ace1 100644 --- a/gcc/elna-spec.cc +++ b/gcc/elna-spec.cc @@ -22,7 +22,7 @@ void lang_specific_driver(struct cl_decoded_option ** /* in_decoded_options */, } /* Called before linking. Returns 0 on success and -1 on failure. */ -int lang_specific_pre_link (void) +int lang_specific_pre_link(void) { return 0; } diff --git a/gcc/elna1.cc b/gcc/elna1.cc index d083ead..a6d8331 100644 --- a/gcc/elna1.cc +++ b/gcc/elna1.cc @@ -186,6 +186,11 @@ static tree elna_langhook_builtin_function(tree decl) return decl; } +static unsigned int elna_langhook_option_lang_mask(void) +{ + return CL_Elna; +} + /* Creates an expression whose value is that of EXPR, converted to type TYPE. This function implements all reasonable scalar conversions. */ tree convert(tree type, tree expr) @@ -222,6 +227,9 @@ tree convert(tree type, tree expr) #undef LANG_HOOKS_IDENTIFIER_SIZE #define LANG_HOOKS_IDENTIFIER_SIZE sizeof(struct tree_identifier) +#undef LANG_HOOKS_OPTION_LANG_MASK +#define LANG_HOOKS_OPTION_LANG_MASK elna_langhook_option_lang_mask + struct lang_hooks lang_hooks = LANG_HOOKS_INITIALIZER; #include "gt-elna-elna1.h" diff --git a/gcc/gelna.texi b/gcc/gelna.texi new file mode 100644 index 0000000..e4bc6ce --- /dev/null +++ b/gcc/gelna.texi @@ -0,0 +1,135 @@ +\input texinfo @c -*-texinfo-*- +@setfilename gelna.info +@settitle The GNU Elna Compiler + +@c Create a separate index for command line options +@defcodeindex op +@c Merge the standard indexes into a single one. +@syncodeindex fn cp +@syncodeindex vr cp +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex tp cp + +@include gcc-common.texi + +@c Copyright years for this manual. +@set copyrights-elna 2025 + +@copying +@c man begin COPYRIGHT +Copyright @copyright{} @value{copyrights-elna} Free Software Foundation, Inc. + +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.3 or +any later version published by the Free Software Foundation; with no +Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. +A copy of the license is included in the +@c man end +section entitled ``GNU Free Documentation License''. +@ignore +@c man begin COPYRIGHT +man page gfdl(7). +@c man end +@end ignore +@end copying + +@ifinfo +@format +@dircategory Software development +@direntry +* Gelna: (gelna). A GCC-based compiler for the Elna language +@end direntry +@end format + +@insertcopying +@end ifinfo + +@titlepage +@title The GNU Elna Compiler +@versionsubtitle +@author Eugen Wissner + +@page +@vskip 0pt plus 1filll +Published by the Free Software Foundation @* +51 Franklin Street, Fifth Floor@* +Boston, MA 02110-1301, USA@* +@sp 1 +@insertcopying +@end titlepage +@contents +@page + +@node Top +@top Introduction + +This manual describes how to use @command{gelna}, the GNU compiler for +the Elna programming language. This manual is specifically about how to +invoke @command{gelna}. + +@menu +* Copying:: The GNU General Public License. +* GNU Free Documentation License:: + How you can share and copy this manual. +* Invoking gelna:: How to run gelna. +* Option Index:: Index of command line options. +* Keyword Index:: Index of concepts. +@end menu + + +@include gpl_v3.texi + +@include fdl.texi + + +@node Invoking gelna +@chapter Invoking gelna + +@c man title gelna A GCC-based compiler for the Elna language + +@ignore +@c man begin SYNOPSIS gelna +gelna [@option{-c}|@option{-S}] + [@option{-g}] [@option{-pg}] + [@option{-o} @var{outfile}] @var{infile}@dots{} + +Only the most useful options are listed here; see below for the +remainder. +@c man end +@c man begin SEEALSO +gpl(7), gfdl(7), fsf-funding(7), gcc(1) +and the Info entries for @file{gelna} and @file{gcc}. +@c man end +@end ignore + +@c man begin DESCRIPTION gelna + +The @command{gelna} command is a frontend to @command{gcc} and +supports many of the same options. @xref{Option Summary, , Option +Summary, gcc, Using the GNU Compiler Collection (GCC)}. This manual +only documents the options specific to @command{gelna}. + +@c man end + +@c man begin OPTIONS gelna + +@c man end + +@node Option Index +@unnumbered Option Index + +@command{gelna}'s command line options are indexed here without any +initial @samp{-} or @samp{--}. Where an option has both positive and +negative forms (such as -foption and -fno-option), relevant entries in +the manual are indexed under the most appropriate form; it may sometimes +be useful to look up both forms. + +@printindex op + +@node Keyword Index +@unnumbered Keyword Index + +@printindex cp + +@bye diff --git a/gcc/lang-specs.h b/gcc/lang-specs.h index e8585fa..ac3611d 100644 --- a/gcc/lang-specs.h +++ b/gcc/lang-specs.h @@ -19,7 +19,9 @@ along with GCC; see the file COPYING3. If not see {".elna", "@elna", nullptr, 0, 0}, {"@elna", "elna1 %i \ - %{!Q:-quiet} \ + %{!Q:-quiet} " DUMPS_OPTIONS("") " %{m*} %{aux-info*} \ + %{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs} \ + %{pg:-p} %{p} %{f*} %{undef} \ %{!fsyntax-only:%{S:%W{o*}%{!o*:-o %w%b.s}}} \ %{fsyntax-only:-o %j} %{-param*} \ %{!fsyntax-only:%(invoke_as)}", diff --git a/gcc/lang.opt.urls b/gcc/lang.opt.urls new file mode 100644 index 0000000..a383952 --- /dev/null +++ b/gcc/lang.opt.urls @@ -0,0 +1,2 @@ +; Autogenerated by regenerate-opt-urls.py from gcc/lang.opt and generated HTML +