This is the mail archive of the
mailing list for the GCC project.
Re: plugin includes for MELT
A mere quick portability review:
* Basile STARYNKEVITCH wrote on Thu, Feb 28, 2008 at 05:39:47PM CET:
>> echo '#generated compile-basilys-defs' > $@
>> echo 'ALL_CFLAGS="' $(ALL_CFLAGS) '"' >> $@
>> echo 'ALL_CPPFLAGS="' -I$(PWD) $(ALL_CPPFLAGS) '"' >> $@
You should output to a temporary file and mv that to the target.
That avoids incomplete (yet seemingly up to date) files when the
user aborts with CTRL-\. See other targets that do similar.
>> 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
>> $(CC) -MT run-basilys-deps -MMD $(ALL_CFLAGS) $(ALL_CPPFLAGS) $<
The build compiler may not be gcc and may not understand -MT and -MMD.
Wasn't there a proposal to use depcomp in gcc a while ago?
>> mkdir -p $(melt_build_include_dir); \
mkdir -p is not portable, use $(mkinstalldirs).
>> for f in $^ ; do \
>> cf=$(echo $$f | sed -q ":^$(srcdir)/config/:$(melt_build_include_dir)/config:"); \
Did you mean `echo ... ` here? make will interpret $(echo ...) wrongly,
I think this command will do nothing. Also, I think two spaces extra
indentation is normal in the GCC Makefile command lines.
"sed -q" is not portable, but "sed -n" is. Also, your sed script looks
very weird. Did you mean to use the 's' command? If yes, you rely on
"$(srcdir)/config/" not containing any colons nor any other characters
special to sed. You might want to use '|' as delimiter instead of ':'.
>> if [ -n "$$cf" ] ; then \
>> cp -va $$f $$cf ; \
"cp -va" is not portable. You can use cp -pR.
>> else \
>> cp -va $$f $(melt_build_include_dir)/ ; \
>> fi; \