[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
FYI: allow subdirectories in EXTRA_DIR
From: |
Alexandre Duret-Lutz |
Subject: |
FYI: allow subdirectories in EXTRA_DIR |
Date: |
Sun, 13 Jan 2002 20:51:16 +0100 |
User-agent: |
Gnus/5.090004 (Oort Gnus v0.04) Emacs/21.1 (i386-debian-linux-gnu) |
I've run across the following this afternoon.
If foo/bar/ is a directory, EXTRA_DIR=foo/bar leads to
$(srcdir)/foo/bar/* being installed as $(distdir)/bar/* by `make
distdir', ignoring the `foo/' part of the name...
Index: ChangeLog
===================================================================
RCS file: /cvs/automake/automake/ChangeLog,v
retrieving revision 1.1725
diff -u -r1.1725 ChangeLog
--- ChangeLog 2002/01/13 19:37:10 1.1725
+++ ChangeLog 2002/01/13 19:38:04
@@ -1,5 +1,11 @@
2002-01-13 Alexandre Duret-Lutz <address@hidden>
+ * lib/am/distdir.am (distdir): Handle subdirectories.
+ * tests/extra6.test: New file.
+ * tests/Makefile.am (TESTS): Add it.
+
+2002-01-13 Alexandre Duret-Lutz <address@hidden>
+
* tests/extra2.test: Run $ACLOCAL.
2002-01-12 Alexandre Duret-Lutz <address@hidden>
Index: lib/am/distdir.am
===================================================================
RCS file: /cvs/automake/automake/lib/am/distdir.am,v
retrieving revision 1.29
diff -u -r1.29 distdir.am
--- distdir.am 2001/12/30 13:53:01 1.29
+++ distdir.am 2002/01/13 19:38:04
@@ -76,7 +76,10 @@
##
dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
if test "$$dir" != "$$file" && test "$$dir" != "."; then \
- $(mkinstalldirs) "$(distdir)/$$dir"; \
+ dir="/$$dir"; \
+ $(mkinstalldirs) "$(distdir)$$dir"; \
+ else \
+ dir=''; \
fi; \
##
## In loop, test for file existence because sometimes a file gets
@@ -90,7 +93,7 @@
## Don't mention $$file in destination argument, since this fails if
## destination directory already exists. Also, use `-R' and not `-r'.
## `-r' is almost always incorrect.
- cp -pR $$d/$$file $(distdir) \
+ cp -pR $$d/$$file $(distdir)$$dir \
|| exit 1; \
else \
test -f $(distdir)/$$file \
Index: tests/Makefile.am
===================================================================
RCS file: /cvs/automake/automake/tests/Makefile.am,v
retrieving revision 1.369
diff -u -r1.369 Makefile.am
--- Makefile.am 2002/01/12 09:25:02 1.369
+++ Makefile.am 2002/01/13 19:38:04
@@ -143,6 +143,7 @@
extra3.test \
extra4.test \
extra5.test \
+extra6.test \
flibs.test \
fnoc.test \
fo.test \
Index: tests/extra6.test
===================================================================
RCS file: extra6.test
diff -N extra6.test
--- /dev/null Tue May 5 13:32:27 1998
+++ extra6.test Sun Jan 13 11:38:04 2002
@@ -0,0 +1,43 @@
+#! /bin/sh
+
+# Check to make sure EXTRA_DIST can contain a directory or
+# a subdirectory, in $(builddir) or $(srcdir).
+
+. $srcdir/defs || exit 1
+
+set -e
+
+echo AC_OUTPUT >> configure.in
+
+cat > Makefile.am << 'END'
+EXTRA_DIST=foo/bar baz foo2/bar2 baz2
+
+check: distdir
+ test -f $(distdir)/foo/bar/baz
+ test -f $(distdir)/baz/foo
+ test -f $(distdir)/foo2/bar2/baz2
+ test -f $(distdir)/baz2/foo2
+END
+
+# Create some files in $(srcdir)
+mkdir foo
+mkdir foo/bar
+touch foo/bar/baz
+mkdir baz
+touch baz/foo
+
+$ACLOCAL
+$AUTOMAKE
+$AUTOCONF
+mkdir build
+cd build
+../configure
+
+# Create some files in $(builddir)
+mkdir foo2
+mkdir foo2/bar2
+touch foo2/bar2/baz2
+mkdir baz2
+touch baz2/foo2
+
+make check
--
Alexandre Duret-Lutz
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- FYI: allow subdirectories in EXTRA_DIR,
Alexandre Duret-Lutz <=