This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] Fix Solaris make gdb/data-directory/ compat. [Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver]
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Andreas Schwab <schwab at linux-m68k dot org>
- Cc: Mark Kettenis <mark dot kettenis at xs4all dot nl>, brobecker at adacore dot com, tromey at redhat dot com, yao at codesourcery dot com, gdb-patches at sourceware dot org
- Date: Sun, 6 Mar 2011 20:05:15 +0100
- Subject: [patch] Fix Solaris make gdb/data-directory/ compat. [Re: [rfa/rfc] Build libcommon.a for gdb and gdbserver]
- References: <m31v4blatz.fsf@fleche.redhat.com> <4D34C9DE.3040603@codesourcery.com> <m3mxmyi6i3.fsf@fleche.redhat.com> <4D375F44.70504@codesourcery.com> <m3oc69xjx8.fsf@fleche.redhat.com> <20110219121448.GA17297@adacore.com> <201102191318.p1JDIQE6005275@glazunov.sibelius.xs4all.nl> <20110306161631.GA15735@host1.jankratochvil.net> <201103061658.p26Gwvni017860@glazunov.sibelius.xs4all.nl> <m2pqq4xix7.fsf@igel.home>
On Sun, 06 Mar 2011 18:23:00 +0100, Andreas Schwab wrote:
> The problem here is that $(PYTHON_FILES) appears as prerequisite of the
> rule and the files are found via VPATH, so Solaris make modified the
> expansion of $(PYTHON_FILES) to prefix it with the VPATH, causing
> PYTHON_SRCDIR to appear twice. (*Note (autoconf) Automatic Rule Rewriting::)
* Automatic Rule Rewriting:: `VPATH' goes wild on Solaris
Thanks for the explanatory documentation reference.
Fixed it on OpenSolaris with /usr/bin/make and checked it is still compatible
with GNU/Linux. Checked both the in-tree and out-of-tree compilation and
installation. Checked out-of-tree build directory in a different number of
subdirectories than the srcdir.
I will even check it in with no comments in some time but a review would be
better.
Thanks,
Jan
gdb/
2011-03-06 Jan Kratochvil <jan.kratochvil@redhat.com>
Fix Solaris make compatibility.
* data-directory/Makefile.in (stamp-syscalls): Copy the files
unconditionally. Drop variable files. Use $^, skip Makefile.
(install-syscalls): Copy the files unconditionally.
(stamp-python): Use $^, skip Makefile. New variable file_pure.
@@ -98,12 +98,9 @@ all: stamp-syscalls stamp-python
stamp-syscalls: Makefile $(SYSCALLS_FILES)
rm -rf ./$(SYSCALLS_DIR)
mkdir ./$(SYSCALLS_DIR)
- files='$(SYSCALLS_FILES)' ; \
- for file in $$files ; do \
- f=$(SYSCALLS_SRCDIR)/$$file ; \
- if test -f $$f ; then \
- $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \
- fi ; \
+ for f in $^ ; do \
+ if test "$$f" = Makefile; then continue; fi; \
+ $(INSTALL_DATA) $$f ./$(SYSCALLS_DIR) ; \
done
touch $@
@@ -120,9 +117,7 @@ install-syscalls:
files='$(SYSCALLS_FILES)' ; \
for file in $$files; do \
f=$(SYSCALLS_SRCDIR)/$$file ; \
- if test -f $$f ; then \
- $(INSTALL_DATA) $$f $(SYSCALLS_INSTALL_DIR) ; \
- fi ; \
+ $(INSTALL_DATA) $$f $(SYSCALLS_INSTALL_DIR) ; \
done
.PHONY: uninstall-syscalls
@@ -140,11 +135,13 @@ uninstall-syscalls:
stamp-python: Makefile $(PYTHON_FILES)
rm -rf ./$(PYTHON_DIR)
- files='$(PYTHON_FILES)' ; \
+ files='$^' ; \
for file in $$files ; do \
- dir=`echo "$$file" | sed 's,/[^/]*$$,,'` ; \
+ if test "$$file" = Makefile; then continue; fi; \
+ file_pure=`echo "$$file" | sed 's,^$(PYTHON_SRCDIR)/*,,'` ; \
+ dir=`echo "$$file_pure" | sed 's,/[^/]*$$,,'` ; \
$(INSTALL_DIR) ./$(PYTHON_DIR)/$$dir ; \
- $(INSTALL_DATA) $(PYTHON_SRCDIR)/$$file ./$(PYTHON_DIR)/$$dir ; \
+ $(INSTALL_DATA) $$file ./$(PYTHON_DIR)/$$dir ; \
done
touch $@