This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
automatic dependencies, adding new files in branch...
- From: Basile Starynkevitch <basile at starynkevitch dot net>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 1 Oct 2013 11:39:23 +0200
- Subject: automatic dependencies, adding new files in branch...
- Authentication-results: sourceware.org; auth=none
- References: <878uykkg96 dot fsf at fleche dot redhat dot com> <5431262 dot H2jzGh502a at polaris> <87y56ebdys dot fsf at fleche dot redhat dot com>
Hello Tom and all
A big thanks for the automatic dependencies patch.
I want to merge the current trunk into the MELT branch, and I have some trouble
understanding how one should add new files into GCC (i.e. into a branch)
For the MELT branch, I just want to add gcc/melt-runtime.cc [which requires melt/generated/meltrunsup.h and melt-runtime.h and melt-predef.h headers); until now,
I had the following rules in its gcc/Makefile.in i.e. in
http://gcc.gnu.org/viewcvs/gcc/branches/melt-branch/gcc/Makefile.in
#########
MELT_H= $(srcdir)/melt/generated/meltrunsup.h \
$(srcdir)/melt-runtime.h \
melt-predef.h
MELT_RUNTIME_C= $(srcdir)/melt-runtime.cc
## file melt-runtime-params-inc.c is generated and #include-d in melt-runtime.cc
melt-runtime-params-inc.c: build/melt-make-string$(build_exeext) Makefile
./build/melt-make-string$(build_exeext) \
melt_source_dir '$(melt_source_dir)' \
melt_header_dir '$(melt_header_dir)' \
melt_module_dir '$(melt_module_dir)' \
melt_module_make_command '$(MAKE)' \
melt_module_makefile '$(melt_installed_module_makefile)' \
melt_module_cflags '$(melt_installed_cflags)' \
melt_revision '$(shell echo -n $(REVISION_c) | tr -s [:space:] _)' \
melt_default_probe '$(melt_default_probe)' \
melt_default_modlis '$(melt_default_modules_list)' > $@-tmp
mv $@-tmp $@
MELT_REVISION_STR := $(shell echo -n $(REVISION_c) | sed "s/ /_/g")
MELT_RUNTIME_CPPDEFS= \
-DMELT_REVISION='\"$(MELT_REVISION_STR)\"' \
-DMELT_GCC_VERSION=$(shell cat $(BASEVER) | $(AWK) '{split($$0,vertab,"."); printf "%d", vertab[1]*1000+vertab[2]}')
melt-runtime.args: $(MELT_RUNTIME_C) melt-run-md5.h melt-runtime-params-inc.c $(C_COMMON_H) \
$(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) $(TM_H) $(TREE_H) \
$(GGC_H) $(BASIC_BLOCK_H) $(GIMPLE_H) $(CFGLOOP_H) \
tree-pass.h $(MELT_H) \
$(srcdir)/melt/generated/meltrunsup.h \
$(srcdir)/melt/generated/meltrunsup-inc.cc \
gt-melt-runtime.h $(PLUGIN_H) $(TOPLEV_H) $(VERSION_H) \
Makefile
@echo '@@**@@' building melt-runtime.args
@echo $(ALL_CFLAGS) $(ALL_CPPFLAGS) -I $(srcdir)/melt/generated/ \
$(MELT_RUNTIME_CPPDEFS) > melt-runtime.args-tmp
@echo " -I" $(realpath .) >> melt-runtime.args-tmp
@echo " -I" $(realpath include) >> melt-runtime.args-tmp
@echo " -I" $(realpath include-fixed) >> melt-runtime.args-tmp
@echo $(realpath $(MELT_RUNTIME_C)) >> melt-runtime.args-tmp
$(melt_move_if_change) melt-runtime.args-tmp melt-runtime.args
@echo -n '@@**@@' melt-runtime.args: ; cat melt-runtime.args ; echo
melt-runtime.o: $(MELT_RUNTIME_C) melt-run-md5.h melt-runtime-params-inc.c $(C_COMMON_H) \
$(CONFIG_H) $(SYSTEM_H) $(TIMEVAR_H) $(TM_H) $(TREE_H) \
$(GGC_H) $(BASIC_BLOCK_H) $(GIMPLE_H) $(CFGLOOP_H) \
tree-pass.h $(MELT_H) \
$(srcdir)/melt/generated/meltrunsup.h \
$(srcdir)/melt/generated/meltrunsup-inc.cc \
gt-melt-runtime.h $(PLUGIN_H) $(TOPLEV_H) $(VERSION_H) \
| melt-runtime.args
ls -l melt-runtime.args
$(COMPILER) -c $(shell cat melt-runtime.args) $(OUTPUT_OPTION)
#######
But I cannot figure out easily how to adapt these rules to the new Makefile.in infrastructure.
Do you have any insights, in particular hints generic enough to be valuable
for other branches?
Perhaps adding a comment in the trunk's Makefile.in might be helpful too....
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} ***