From 0d57b5eca852274c47df8dbce01dd5ffb6344edb Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Mon, 17 Nov 2014 22:03:44 +0100 Subject: Fix dist/gcc makefiles --- dist/gcc/Make-lang.in | 50 ++++++++++++++++++++++++++++++++++++++------------ dist/gcc/Makefile.in | 41 ++--------------------------------------- 2 files changed, 40 insertions(+), 51 deletions(-) (limited to 'dist/gcc') diff --git a/dist/gcc/Make-lang.in b/dist/gcc/Make-lang.in index cde3e6c07..fea35efb0 100644 --- a/dist/gcc/Make-lang.in +++ b/dist/gcc/Make-lang.in @@ -73,27 +73,54 @@ GHDL1_OBJS = attribs.o vhdl/ortho-lang.o # before. vhdl_OBJS=vhdl/ortho-lang.o +vhdl_srcdir := $(shell cd $(srcdir)/vhdl; pwd) + # 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) - CURDIR=`pwd`; cd $(srcdir)/vhdl; VHDLSRCDIR=`pwd`; cd $$CURDIR/vhdl; \ - $(GNATMAKE) -c -aI$$VHDLSRCDIR ortho_gcc-main \ + # Create object file in vhdl/subdir + cd vhdl; $(GNATMAKE) -c -aI$(vhdl_srcdir) ortho_gcc-main \ -cargs $(CFLAGS) $(GHDL_ADAFLAGS) $(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aOvhdl ortho_gcc-main \ -bargs -E -cargs $(CFLAGS) $(GHDL_ADAFLAGS) \ -largs --LINK=$(LLINKER) $(ALL_LINKERFLAGS) $(LDFLAGS) $(GHDL1_OBJS) \ $(filter-out main.o,$(BACKEND)) $(LIBS) $(BACKENDLIBS) -# The driver for ghdl. -ghdl$(exeext): force - $(MAKE_IN_VHDL) ../ghdl$(exeext) +vhdl/default_pathes.ads: + echo "-- DO NOT EDIT" > tmp-dpathes.ads + echo "-- This file is created by Makefile" >> tmp-dpathes.ads + echo "package Default_Pathes is" >> tmp-dpathes.ads + echo " -- Accept long lines." >> tmp-dpathes.ads + echo " pragma Style_Checks (\"M999\");" >> tmp-dpathes.ads + echo " Install_Prefix : constant String :=" >> tmp-dpathes.ads + echo " \"$(exec_prefix)\";" >> tmp-dpathes.ads + echo " Compiler_Gcc : constant String :=" >> tmp-dpathes.ads + echo " \"libexec/gcc/$(target_noncanonical)/$(version)/ghdl1$(exeext)\";" >> tmp-dpathes.ads + echo " Compiler_Debug : constant String := \"\";" >> tmp-dpathes.ads + echo " Compiler_Mcode : constant String := \"\";" >> tmp-dpathes.ads + echo " Compiler_Llvm : constant String := \"\";" >> tmp-dpathes.ads + echo " Post_Processor : constant String := \"\";" >> tmp-dpathes.ads + echo " Lib_Prefix : constant String :=">> tmp-dpathes.ads + echo " \"lib/gcc/$(target_noncanonical)/$(version)/vhdl/lib/\";" >> tmp-dpathes.ads + echo "end Default_Pathes;" >> tmp-dpathes.ads + $(srcdir)/../move-if-change tmp-dpathes.ads $@ + +# The driver for ghdl. Depends on ghdl1 to use object files in vhdl/ subdir. +ghdl$(exeext): ghdl1$(exeext) vhdl/default_pathes.ads force + $(GNATMAKE) -o $@ -aI$(srcdir)/vhdl -aI$(srcdir)/vhdl/ghdldrv \ + -aIvhdl -aOvhdl ghdl_gcc \ + -bargs -E -cargs $(ADA_CFLAGS) $(GHDL_ADAFLAGS) -largs $(LIBS) # Ghdl libraries. -ghdllib: ghdl$(exeext) ghdl1$(exeext) $(GCC_PASSES) force +ghdllib: ghdl$(exeext) ghdl1$(exeext) $(GCC_PASSES) vhdl/Makefile force $(MAKE_IN_VHDL) GRT_FLAGS="-O -g" $(FLAGS_TO_PASS) \ ADAC=$(COMPILER_FOR_BUILD) ghdllib +vhdl/Makefile: config.status $(srcdir)/vhdl/Makefile.in + CONFIG_HEADERS= CONFIG_LINKS= CONFIG_COMMANDS= \ + CONFIG_FILES=vhdl/Makefile $(SHELL) config.status + # Build hooks: vhdl.all.build: @@ -129,7 +156,7 @@ vhdl.install-normal: vhdl.install-plugin: # Install the driver program as ghdl. -vhdl.install-common: ghdl$(exeext) +vhdl.install-common: ghdl$(exeext) vhdl/Makefile -mkdir $(DESTDIR)$(bindir) -$(RM) $(DESTDIR)$(bindir)/ghdl$(exeext) $(INSTALL_PROGRAM) ghdl$(exeext) $(DESTDIR)$(bindir)/ghdl$(exeext) @@ -138,10 +165,7 @@ vhdl.install-common: ghdl$(exeext) install-info:: $(DESTDIR)$(infodir)/ghdl.info -vhdl.install-info: doc/ghdl.info - -rm -rf $(infodir)/ghdl.info* - $(INSTALL_DATA) doc/ghdl.info* $(DESTDIR)$(infodir) - -chmod a-x $(DESTDIR)$(infodir)/ghdl.info* +vhdl.install-info: $(DESTDIR)$(infodir)/ghdl.info install-ghdllib: $(MAKE) -f vhdl/Makefile $(FLAGS_TO_PASS) $(VHDL_FLAGS_TO_PASS) install-ghdllib @@ -162,9 +186,11 @@ vhdl.uninstall: # We just have to delete files specific to us. vhdl.mostlyclean: - -$(RM) vhdl/*$(objext) vhdl/*.ali vhdl/b_*.c + -$(RM) vhdl/*$(objext) vhdl/*.ali vhdl/b~*.ad? + -$(RM) vhdl/default_pathes.ads vhdl.clean: -$(RM) vhdl/*$(objext) + -$(RM) vhdl/default_pathes.ads vhdl.distclean: -$(RM) vhdl/Makefile -$(RM) ghdl$(exeext) diff --git a/dist/gcc/Makefile.in b/dist/gcc/Makefile.in index 6c5fffd8e..ad8a3bfd6 100644 --- a/dist/gcc/Makefile.in +++ b/dist/gcc/Makefile.in @@ -146,56 +146,18 @@ version := $(shell cat $(srcdir)/../BASE-VER) # Definition of `all' is here so that new rules inserted by sed # do not specify the default target. -all: all.indirect +all: # This tells GNU Make version 3 not to put all variables in the environment. .NOEXPORT: -# Now figure out from those variables how to compile and link. - -all.indirect: Makefile - -# This tells GNU make version 3 not to export all the variables -# defined in this file into the environment. -.NOEXPORT: - -Makefile: $(srcdir)/Makefile.in $(srcdir)/../configure - cd ..; $(SHELL) config.status force: SED=sed -drvdir/default_pathes.ads: drvdir Makefile - echo "-- DO NOT EDIT" > tmp-dpathes.ads - echo "-- This file is created by Makefile" >> tmp-dpathes.ads - echo "package Default_Pathes is" >> tmp-dpathes.ads - echo " -- Accept long lines." >> tmp-dpathes.ads - echo " pragma Style_Checks (\"M999\");" >> tmp-dpathes.ads - echo " Install_Prefix : constant String :=" >> tmp-dpathes.ads - echo " \"$(exec_prefix)\";" >> tmp-dpathes.ads - echo " Compiler_Gcc : constant String :=" >> tmp-dpathes.ads - echo " \"libexec/gcc/$(target_noncanonical)/$(version)/ghdl1$(exeext)\";" >> tmp-dpathes.ads - echo " Compiler_Debug : constant String := \"\";" >> tmp-dpathes.ads - echo " Compiler_Mcode : constant String := \"\";" >> tmp-dpathes.ads - echo " Compiler_Llvm : constant String := \"\";" >> tmp-dpathes.ads - echo " Post_Processor : constant String := \"\";" >> tmp-dpathes.ads - echo " Lib_Prefix : constant String :=">> tmp-dpathes.ads - echo " \"lib/gcc/$(target_noncanonical)/$(version)/vhdl/lib/\";" >> tmp-dpathes.ads - echo "end Default_Pathes;" >> tmp-dpathes.ads - $(srcdir)/../../move-if-change tmp-dpathes.ads $@ - -../ghdl$(exeext): drvdir drvdir/default_pathes.ads force - CURDIR=`pwd`; cd $(srcdir); SRCDIR=`pwd`; cd $$CURDIR/drvdir; \ - $(GNATMAKE) -o ../$@ -aI$$SRCDIR/ghdldrv -aI$$SRCDIR -aO.. ghdl_gcc \ - -bargs -E -cargs $(ADA_CFLAGS) $(GHDL_ADAFLAGS) -largs $(LIBS) - -drvdir: - mkdir $@ - clean: grt-clean ghdllibs-clean force $(RM) *.o *.ali - $(RM) default_pathes.ads # Additionnal rules @@ -288,6 +250,7 @@ install-ghdllib: ghdllib grt.lst $(STD93_SRCS) $(STD87_SRCS) \ $(MAKE) -f $$PDIR/Makefile REL_DIR=../../.. LIBSRC_DIR="src" \ LIB93_DIR=lib/v93 LIB87_DIR=lib/v87 LIB08_DIR=lib/v08 \ ANALYZE="$$PDIR/../ghdl -a --GHDL1=$$PDIR/../ghdl1 --ieee=none" \ + ANALYZE_DEP="$$PDIR/../ghdl1" \ std.v87 ieee.v87 synopsys.v87 \ std.v93 ieee.v93 synopsys.v93 mentor.v93 \ std.v08 ieee.v08 -- cgit v1.2.3