public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Basile STARYNKEVITCH <basile@starynkevitch.net>
To: Tom Tromey <tromey@redhat.com>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: Patch: automatic dependencies for gcc
Date: Wed, 26 Mar 2008 15:05:00 -0000	[thread overview]
Message-ID: <47EA57BB.7000509@starynkevitch.net> (raw)
In-Reply-To: <m3skydllrn.fsf@fleche.redhat.com>

Tom Tromey wrote:
>>>>>> "Richard" == Richard Guenther <richard.guenther@gmail.com> writes:
> 
> Richard> It seems that changes in builtins.def or builtin-types.def do
> Richard> not cause re-builds of their dependencies.
> 
> A while back I was thinking, "I wish I got more response to my patches".
> I'm kind of regretting that now.


Back to the subject of automatic dependencies for GCC my MELT branch
http://gcc.gnu.org/wiki/MiddleEndLispTranslator has similar needs.

See http://gcc.gnu.org/ml/gcc/2008-03/msg00839.html
http://gcc.gnu.org/ml/gcc/2008-03/msg00810.html
http://gcc.gnu.org/ml/gcc/2008-03/msg00668.html
http://gcc.gnu.org/ml/gcc/2008-03/msg00549.html
http://gcc.gnu.org/ml/gcc/2008-03/msg00524.html
http://gcc.gnu.org/ml/gcc/2008-03/msg00152.html
http://gcc.gnu.org/ml/gcc/2008-02/msg00682.html
http://gcc.gnu.org/ml/gcc/2008-02/msg00632.html
http://gcc.gnu.org/ml/gcc/2008-02/msg00419.html
and other messages in the referenced threads

MELT is able to generate C code and to tldl_dlopenext (almost like 
dlopen-ing a dynamic library) the binary dynamically loadable stuff (a 
*.so ELF shared object on Linux & Solaris...) obtained from the 
generated code. Notice that this code generation and dynamic loading may 
happen within cc1 (for some peculiar long-lasting passes and compile flags).

Each such generated C code needs include files internal to GCC. They are 
all wrapped in one particular include gcc/run-basilys.h which is the 
only #include in such generated C code.

So I need to copy all the files needed by this gcc/run-basilys.h in a 
suitable place. At the moment I have the following (near the end of) my 
gcc/Makefile.in (in MELT branch):

#########################
# we want to generate all the direct (non system) dependencies of 
#run-basilys.h
# the following should work if $(CC) is some recent version of GCC 
#(probably >= 4.x)

# we first generate the make-dependencies using -MMD
# this should write into run-basilys.d some stuff like
## run-basilys-deps: srcdir.../gcc/run-basilys.h  config.h auto-host.h ....
# with the srcdir... replaced by the source directory
# however, there are also config/ files in the dependency list
# config/ files should be handled specially since they are the only 
#include-d files
# which are not flat, ie in a subdirectory, like 
srcdir.../gcc/config/i386/x86-64.h
# there is also a dependency on tm.h (in objdir) which contains stuff 
like #include "config/i386/x86-64.h"
run-basilys.d: run-basilys.h \
    $(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) $(TM_H)  $(TREE_H)  $(GGC_H)  \
    tree-pass.h basilys.h gt-basilys.h
## perhaps this should really use depcomp, because this works only if
## CC is some gcc 4.x since it use the precompiled headers feature
	$(CC) -MT run-basilys-deps -MMD -MF $@ $(ALL_CFLAGS) $(ALL_CPPFLAGS) $< 
-o run-basilys.h.gch

.PHONY: run-basilys-deps
## the include below defines the dependencies of run-basilys-deps
## included file run-basilys.d is generated above
-include run-basilys.d


## copy all the file in the dependency of run-basilys-deps into 
#$(melt_build_include_dir)
## but handle the $(srcdir)/config/ files specially by copying them 
#within a config/ directory
run-basilys-deps:
#	echo '***' IN run-basilys-deps TARGET '***'
	$(mkinstalldirs) $(melt_build_include_dir); \
	for f in $^ ; do \
	  cf=`echo $$f | sed 
"s:$(srcdir)/config/:$(melt_build_include_dir)/config/:"`; \
	  if [ "x$$f" != "x$$cf" ] ;  then  \
	    $(mkinstalldirs) `dirname $$cf` ; \
	    cp -p $$f $$cf ; \
	  else  \
	    cp -p $$f $(melt_build_include_dir)/ ; \
		fi; \
	done
########################

it sort of works on my Debian system, but it is definitely not 
satisfactory (it probably should break on any non Linux/Gcc system). 
Maybe using depcomp could help, but I don't know how.

Comments and suggestions (or even patches in to the latest of MELT 
branch) are appreciated.

Regards


-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***

  reply	other threads:[~2008-03-26 14:04 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-07 21:15 Tom Tromey
2008-03-07 23:20 ` Joseph S. Myers
2008-03-07 23:28   ` Tom Tromey
2008-03-08  0:37 ` Ralf Wildenhues
2008-03-08  0:42   ` Tom Tromey
2008-03-08 14:33 ` Ralf Wildenhues
2008-03-08 16:20   ` Tom Tromey
2008-03-08 16:36     ` Ralf Wildenhues
2008-03-08 18:41       ` Ralf Wildenhues
2008-03-08 19:42         ` Tom Tromey
2008-03-09 14:40           ` Ralf Wildenhues
2008-03-09 15:07             ` Ralf Wildenhues
2008-03-09 16:02             ` Tom Tromey
2008-03-09 16:36               ` Ralf Wildenhues
2008-03-09 16:55                 ` Tom Tromey
2008-03-11  0:01               ` Ben Elliston
2008-03-11  0:11                 ` Tom Tromey
2008-03-18 14:35               ` Paolo Bonzini
2008-03-21 13:43                 ` Tom Tromey
2008-03-21 17:43                   ` Paolo Bonzini
2008-03-24 20:34                     ` Tom Tromey
2008-03-25  8:33                       ` Tom Tromey
2008-03-25  8:42                         ` Paolo Bonzini
2008-03-25 15:43                           ` Tom Tromey
2008-03-25 16:32                             ` Paolo Bonzini
2008-03-25 17:27                               ` Tom Tromey
2008-03-25 17:28                                 ` Tom Tromey
2008-03-25 17:29                                   ` Paolo Bonzini
2008-03-25 17:39                                     ` Tom Tromey
2008-03-25 18:00                                     ` Tom Tromey
2008-03-25 20:41                                 ` Ralf Wildenhues
2008-03-25 20:51                                   ` Tom Tromey
2008-03-25 21:03                                     ` Ralf Wildenhues
2008-03-26  2:08                                       ` Tom Tromey
2008-03-25 22:26                                     ` Andreas Tobler
2008-03-26  3:26                                       ` Tom Tromey
2008-03-26 13:16                                         ` Richard Guenther
2008-03-26 13:17                                           ` Tom Tromey
2008-03-26 13:21                                             ` Richard Guenther
2008-03-26 13:53                                           ` Tom Tromey
2008-03-26 15:05                                             ` Basile STARYNKEVITCH [this message]
2008-03-26 15:27                                               ` Tom Tromey
2008-03-26 16:47                                                 ` Basile STARYNKEVITCH
2008-03-27 12:02                                             ` Richard Guenther
2008-03-27 15:45                                               ` Tom Tromey
2008-03-27 16:40                                                 ` Tom Tromey
2008-03-27 17:14                                                 ` Richard Guenther
2008-03-27 17:41                                                   ` Tom Tromey
2008-03-27 18:34                                                     ` Mark Mitchell
2008-03-27 19:39                                                       ` Tom Tromey
2008-03-27 19:45                                                         ` Diego Novillo
2008-03-27 20:07                                                           ` Tom Tromey
2008-03-27 20:16                                                             ` Diego Novillo
2008-03-27 20:31                                                               ` Paolo Bonzini
2008-03-27 20:20                                                             ` David Daney
2008-03-27 21:42                                                               ` Tom Tromey
2008-03-27 22:43                                                                 ` Ralf Wildenhues
2008-03-27 22:47                                                                   ` Tom Tromey
2008-03-27 19:21                                                     ` Paolo Bonzini
2008-03-25 21:00                                   ` Tom Tromey
2008-03-25 21:07                                     ` Ralf Wildenhues
2008-03-25 21:44                                   ` Tom Tromey
2008-03-20 16:54             ` Tom Tromey
2008-03-27 16:41 Dominique Dhumieres

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47EA57BB.7000509@starynkevitch.net \
    --to=basile@starynkevitch.net \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=tromey@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).