From 99853361819bff87e7cf8103c5205721ec195c32 Mon Sep 17 00:00:00 2001 From: umarcor Date: Tue, 5 Jan 2021 20:46:15 +0100 Subject: mv dist/* scripts/ --- scripts/gcc/Make-lang.in | 218 +++++++++++++++++++++++++++++++++++++++++++++ scripts/gcc/config-lang.in | 36 ++++++++ scripts/gcc/lang-options.h | 29 ++++++ scripts/gcc/lang-specs.h | 28 ++++++ 4 files changed, 311 insertions(+) create mode 100644 scripts/gcc/Make-lang.in create mode 100644 scripts/gcc/config-lang.in create mode 100644 scripts/gcc/lang-options.h create mode 100644 scripts/gcc/lang-specs.h (limited to 'scripts/gcc') diff --git a/scripts/gcc/Make-lang.in b/scripts/gcc/Make-lang.in new file mode 100644 index 000000000..108b05bdc --- /dev/null +++ b/scripts/gcc/Make-lang.in @@ -0,0 +1,218 @@ +# Top level -*- makefile -*- fragment for vhdl (GHDL). +# Copyright (C) 2002 +# Free Software Foundation, Inc. + +#This file is part of GNU CC. + +#GNU CC is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 2, or (at your option) +#any later version. + +#GNU CC is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. + +#You should have received a copy of the GNU General Public License +#along with GNU CC; see the file COPYING. If not, write to +#the Free Software Foundation, 59 Temple Place - Suite 330, +#Boston, MA 02111-1307, USA. + +# This file provides the language dependent support in the main Makefile. +# Each language makefile fragment must provide the following targets: +# +# foo.all.build, foo.all.cross, foo.start.encap, foo.rest.encap, +# foo.info, foo.dvi, +# foo.install-normal, foo.install-common, foo.install-info, foo.install-man, +# foo.uninstall, foo.mostlyclean, foo.clean, foo.distclean, foo.extraclean, +# foo.maintainer-clean, foo.stage1, foo.stage2, foo.stage3, foo.stage4 +# +# where `foo' is the name of the language. +# +# It should also provide rules for: +# +# - making any compiler driver (eg: g++) +# - the compiler proper (eg: cc1plus) +# - define the names for selecting the language in LANGUAGES. +# tool definitions +MV = mv +RM = rm -f + + +# Extra flags to pass to recursive makes. +GHDL_ADAFLAGS=-gnata -gnaty3befhkmr -gnatwa -gnatwC +GNATBIND = gnatbind +GNATMAKE = gnatmake + +# Define the names for selecting vhdl in LANGUAGES. +vhdl VHDL: ghdl1$(exeext) ghdl$(exeext) + +# Tell GNU Make to ignore these, if they exist. +.PHONY: vhdl VHDL + +GHDL1_OBJS = attribs.o vhdl/ortho-lang.o + +# To be put in ALL_HOST_FRONTEND_OBJS, so that generated files are created +# before. +vhdl_OBJS=vhdl/ortho-lang.o + +# The compiler proper. +# It is compiled into the vhdl/ subdirectory to avoid file name clashes but +# linked in in gcc directory to be able to access to gcc object files. +ghdl1$(exeext): force $(GHDL1_OBJS) $(BACKEND) $(LIBDEPS) + # Create object file in vhdl/subdir + $(GNATMAKE) -c -aI$(srcdir)/vhdl --subdirs=vhdl ortho_gcc-main \ + -cargs $(CFLAGS) $(GHDL_ADAFLAGS) + $(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \ + -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \ + -bargs -E \ + -largs --LINK=$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GHDL1_OBJS) \ + $(filter-out main.o,$(BACKEND)) $(LIBS) $(BACKENDLIBS) + +vhdl_target1:=$(subst -gnu,,$(target)) +vhdl_targ:=$(subst -, ,$(vhdl_target1)) +ifeq ($(words $(vhdl_targ)),2) + vhdl_osys:=$(word 2,$(vhdl_targ)) +else + vhdl_osys:=$(word 3,$(vhdl_targ)) +endif + +# Set target files. +ifeq ($(filter-out mingw32 mingw64,$(vhdl_osys)),) + VHDL_SOEXT=.dll +else ifeq ($(filter-out darwin%,$(vhdl_osys)),) + VHDL_SOEXT=.dylib +else + VHDL_SOEXT=.so +endif + +vhdl/default_paths.ads: Makefile + echo "-- DO NOT EDIT" > tmp-dpaths.ads + echo "-- This file is created by Makefile" >> tmp-dpaths.ads + echo "package Default_Paths is" >> tmp-dpaths.ads + echo " -- Accept long lines." >> tmp-dpaths.ads + echo " pragma Style_Checks (\"M999\");" >> tmp-dpaths.ads + echo " Install_Prefix : constant String :=" >> tmp-dpaths.ads + echo " \"$(exec_prefix)\";" >> tmp-dpaths.ads + suffix=`expr @"$(libexecdir)" : @"$(prefix)/\(.*\)"`; \ + if test x"$$suffix" = x; then suffix="$(libexecdir)"; fi; \ + echo " Compiler_Gcc : constant String :=" >> tmp-dpaths.ads; \ + echo " \"$$suffix/gcc/$(target_noncanonical)/$(version)/ghdl1$(exeext)\";" >> tmp-dpaths.ads + echo " Compiler_Debug : constant String := \"\";" >> tmp-dpaths.ads + echo " Compiler_Mcode : constant String := \"\";" >> tmp-dpaths.ads + echo " Compiler_Llvm : constant String := \"\";" >> tmp-dpaths.ads + echo " Post_Processor : constant String := \"\";" >> tmp-dpaths.ads + echo " Lib_Prefix : constant String :=">> tmp-dpaths.ads + echo " \"lib/ghdl\";" >> tmp-dpaths.ads + echo " Shared_Library_Extension : constant String :=">> tmp-dpaths.ads + echo " \"$(VHDL_SOEXT)\";" >> tmp-dpaths.ads + echo " Default_Pie : constant Boolean := False;" >> tmp-dpaths.ads + echo "end Default_Paths;" >> tmp-dpaths.ads + $(srcdir)/../move-if-change tmp-dpaths.ads $@ + +GHDL_GRT_OBJS=vhdl/grt-cstdio.o + +# The driver for ghdl. Depends on ghdl1 to use object files in vhdl/ subdir. +ghdl$(exeext): ghdl1$(exeext) $(GHDL_GRT_OBJS) vhdl/default_paths.ads force + $(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aI$(srcdir)/vhdl/ghdldrv \ + -aIvhdl -aOvhdl ghdl_gcc \ + -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \ + -bargs -E \ + -largs --LINK=$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) \ + $(GHDL_GRT_OBJS) $(LIBS) + +# Build hooks: + +vhdl.all.build: + +vhdl.all.cross: + @echo "No support for building vhdl cross-compiler" + exit 1 + +vhdl.start.encap: +vhdl.rest.encap: + +# Documentation hooks +doc/ghdl.info: vhdl/ghdl.texi + -rm -f doc/ghdl.info* + $(MAKEINFO) $(MAKEINFOFLAGS) -o $@ $< + +doc/ghdl.dvi: vhdl/ghdl.texi + $(TEXI2DVI) -o $@ $< + +vhdl.info: doc/ghdl.info + +vhdl.man: + +vhdl.dvi: doc/ghdl.dvi + +vhdl.generated-manpages: + +# Install hooks: +# ghdl1 is installed elsewhere as part of $(COMPILERS). + +vhdl.install-normal: + +vhdl.install-plugin: + +# Install the driver program as ghdl. +vhdl.install-common: ghdl$(exeext) ghdl1$(exeext) + -mkdir $(DESTDIR)$(bindir) + -$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext) + $(INSTALL_PROGRAM) ghdl$(exeext) $(DESTDIR)$(bindir)/ghdl$(exeext) + -mkdir $(DESTDIR)$(libdir) + -mkdir $(DESTDIR)$(libdir)/ghdl + $(INSTALL_DATA) ../libbacktrace/.libs/libbacktrace.a $(DESTDIR)$(libdir)/ghdl + +install-info:: $(DESTDIR)$(infodir)/ghdl.info + +vhdl.install-info: $(DESTDIR)$(infodir)/ghdl.info + +vhdl.install-man: $(DESTDIR)$(man1dir)/ghdl$(man1ext) + +$(DESTDIR)$(man1dir)/ghdl$(man1ext): $(srcdir)/vhdl/ghdl.1 + -rm -f $@ + -$(INSTALL_DATA) $< $@ + -chmod a-x $@ + +vhdl.uninstall: + -$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext) + + +# Clean hooks: +# A lot of the ancillary files are deleted by the main makefile. +# We just have to delete files specific to us. + +vhdl.mostlyclean: + -$(RM) vhdl/*$(objext) vhdl/*.ali vhdl/b~*.ad? + -$(RM) vhdl/default_paths.ads +vhdl.clean: + -$(RM) vhdl/*$(objext) + -$(RM) vhdl/default_paths.ads +vhdl.distclean: + -$(RM) vhdl/Makefile + -$(RM) ghdl$(exeext) +vhdl.extraclean: + +vhdl.maintainer-clean: + + +# Stage hooks: +# The main makefile has already created stage?/vhdl + +vhdl.stage1: + -$(MV) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c stage1/vhdl + -$(MV) vhdl/stamp-* stage1/vhdl +vhdl.stage2: + -$(MV) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c stage2/vhdl + -$(MV) vhdl/stamp-* stage2/vhdl +vhdl.stage3: + -$(MV) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c stage3/vhdl + -$(MV) vhdl/stamp-* stage3/vhdl +vhdl.stage4: + -$(MV) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c stage4/vhdl + -$(MV) vhdl/stamp-* stage4/vhdl + +# No vhdl-specific selftests +selftest-vhdl: diff --git a/scripts/gcc/config-lang.in b/scripts/gcc/config-lang.in new file mode 100644 index 000000000..3ce9851f3 --- /dev/null +++ b/scripts/gcc/config-lang.in @@ -0,0 +1,36 @@ +# Top level configure fragment for GNU vhdl (GHDL). +# Copyright (C) 1994-2001 Free Software Foundation, Inc. + +#This file is part of GNU CC. + +#GNU CC is free software; you can redistribute it and/or modify +#it under the terms of the GNU General Public License as published by +#the Free Software Foundation; either version 2, or (at your option) +#any later version. + +#GNU CC is distributed in the hope that it will be useful, +#but WITHOUT ANY WARRANTY; without even the implied warranty of +#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +#GNU General Public License for more details. + +#You should have received a copy of the GNU General Public License +#along with GNU CC; see the file COPYING. If not, write to +#the Free Software Foundation, 59 Temple Place - Suite 330, +#Boston, MA 02111-1307, USA. + +# Configure looks for the existence of this file to auto-config each language. +# We define several parameters used by configure: +# +# language - name of language as it would appear in $(LANGUAGES) +# boot_language - "yes" if we need to build this language in stage1 +# compilers - value to add to $(COMPILERS) +# stagestuff - files to add to $(STAGESTUFF) + +language="vhdl" +boot_language=no + +compilers="ghdl1\$(exeext)" + +stagestuff="ghdl\$(exeext) ghdl1\$(exeext)" + +gtfiles="\$(srcdir)/vhdl/ortho-lang.c" diff --git a/scripts/gcc/lang-options.h b/scripts/gcc/lang-options.h new file mode 100644 index 000000000..c92b12132 --- /dev/null +++ b/scripts/gcc/lang-options.h @@ -0,0 +1,29 @@ +/* Definitions for switches for vhdl. + Copyright (C) 2002 + Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +DEFINE_LANG_NAME ("vhdl") + +/* This is the contribution to the `lang_options' array in gcc.c for ghdl. */ + + {"--ghdl-", "Specify options to GHDL"}, + + + diff --git a/scripts/gcc/lang-specs.h b/scripts/gcc/lang-specs.h new file mode 100644 index 000000000..050443521 --- /dev/null +++ b/scripts/gcc/lang-specs.h @@ -0,0 +1,28 @@ +/* Definitions for specs for vhdl. + Copyright (C) 2002 + Free Software Foundation, Inc. + +This file is part of GNU CC. + +GNU CC is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU CC is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ + +/* This is the contribution to the `default_compilers' array in gcc.c for + GHDL. */ + + {".vhd", "@vhdl", 0, 0, 0}, + {".vhdl", "@vhdl", 0, 0, 0}, + {"@vhdl", + "ghdl1 %i %(cc1_options) %{!fsyntax-only:%(invoke_as)}", 0, 0, 0}, -- cgit v1.2.3