apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Erenkrantz <jerenkra...@apache.org>
Subject [PATCH] Get dependency generation working with VPATH
Date Thu, 18 Apr 2002 18:04:35 GMT
Since this is a fairly large patch, I'll post it first to give
people a chance to comment.

This attempts to get "make depend" working when using VPATH.  Since
we rely on $(srcdir) to always be defined, I'm adding srcdir and
VPATH to all Makefiles.  This also has the (good) side-effect of
making these variables persist across config.status invocations.

I also switched from using the mkdep.sh script to creating a .deps
file (which is what httpd-2.0 uses).  Is there any reason to keep
on using the old way?  I much prefer creating a .deps file than
hacking the Makefile.

Thoughts?  -- justin

Index: Makefile.in
===================================================================
RCS file: /home/cvs/apr/Makefile.in,v
retrieving revision 1.73
diff -u -r1.73 Makefile.in
--- Makefile.in	15 Apr 2002 22:01:39 -0000	1.73
+++ Makefile.in	18 Apr 2002 17:59:13 -0000
@@ -42,6 +42,7 @@
 includedir=@includedir@
 installbuilddir=@installbuilddir@
 srcdir=@srcdir@
+VPATH=@srcdir@
 top_srcdir=@top_srcdir@
 top_blddir=@top_builddir@
 
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.430
diff -u -r1.430 configure.in
--- configure.in	18 Apr 2002 09:14:53 -0000	1.430
+++ configure.in	18 Apr 2002 17:59:14 -0000
@@ -1717,13 +1717,7 @@
 
 if test -n "$USE_VPATH"; then
   for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do
-    dir=`echo $makefile|sed 's%/*[^/][^/]*$%%'`
-    (cat <<EOF
-srcdir = $apr_srcdir/$dir
-VPATH  = $apr_srcdir/$dir
-
-EOF
-)    |  cat - $makefile | \
+    cat $makefile | \
         sed \
 		-e 's#-I\($(INCDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' \
 		-e 's#-I\($(OSDIR[0-9]*)\)#-I\1 -I$(srcdir)/\1#g' \
Index: atomic/os390/Makefile.in
===================================================================
RCS file: /home/cvs/apr/atomic/os390/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- atomic/os390/Makefile.in	22 Mar 2002 19:01:03 -0000	1.1
+++ atomic/os390/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = atomic.lo
 
Index: atomic/solaris_sparc/Makefile.in
===================================================================
RCS file: /home/cvs/apr/atomic/solaris_sparc/Makefile.in,v
retrieving revision 1.7
diff -u -r1.7 Makefile.in
--- atomic/solaris_sparc/Makefile.in	29 Mar 2002 18:20:57 -0000	1.7
+++ atomic/solaris_sparc/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS =  @apr_atomic_sparc_compile@
 
@@ -8,7 +10,6 @@
 
 # bring in rules.mk for standard functionality
 @INCLUDE_RULES@
-srcdir=@srcdir@
 
 apr_atomic_sparc.lo: $(srcdir)/apr_atomic_sparc.s
 	$(ASCPP) $(ASCPPFLAGS) $(srcdir)/$*.s > $*.S
Index: atomic/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/atomic/unix/Makefile.in,v
retrieving revision 1.1
diff -u -r1.1 Makefile.in
--- atomic/unix/Makefile.in	12 Feb 2002 21:51:30 -0000	1.1
+++ atomic/unix/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = apr_atomic.lo
 
Index: build/Makefile.in
===================================================================
RCS file: /home/cvs/apr/build/Makefile.in,v
retrieving revision 1.3
diff -u -r1.3 Makefile.in
--- build/Makefile.in	17 May 2001 22:25:56 -0000	1.3
+++ build/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,6 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
+
 TARGETS=
 INCLUDES=
 DISTCLEAN_TARGETS = rules.mk
Index: build/rules.mk.in
===================================================================
RCS file: /home/cvs/apr/build/rules.mk.in,v
retrieving revision 1.23
diff -u -r1.23 rules.mk.in
--- build/rules.mk.in	13 Mar 2002 20:39:08 -0000	1.23
+++ build/rules.mk.in	18 Apr 2002 17:59:14 -0000
@@ -195,10 +195,9 @@
 local-all: $(TARGETS)
 
 local-depend: x-local-depend
-	@if test -n "`ls *.c 2> /dev/null`"; then \
-	    echo $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \
-	    CC=${CC} $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \
-	fi
+	@if test -n "`ls $(srcdir)/*.c 2> /dev/null`"; then \
+		$(CC) -MM $(ALL_CPPFLAGS) $(ALL_INCLUDES) $(srcdir)/*.c | sed 's/\.o:/.lo:/' > .deps
|| true;           \
+    fi
 
 # to be filled in by the actual Makefile
 x-local-depend x-local-clean x-local-distclean x-local-extraclean:
Index: dso/aix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/dso/aix/Makefile.in,v
retrieving revision 1.8
diff -u -r1.8 Makefile.in
--- dso/aix/Makefile.in	2 Apr 2001 19:33:05 -0000	1.8
+++ dso/aix/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = dso.lo
 
Index: dso/beos/Makefile.in
===================================================================
RCS file: /home/cvs/apr/dso/beos/Makefile.in,v
retrieving revision 1.9
diff -u -r1.9 Makefile.in
--- dso/beos/Makefile.in	9 Jan 2001 11:05:38 -0000	1.9
+++ dso/beos/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = dso.lo
 
Index: dso/os2/Makefile.in
===================================================================
RCS file: /home/cvs/apr/dso/os2/Makefile.in,v
retrieving revision 1.10
diff -u -r1.10 Makefile.in
--- dso/os2/Makefile.in	9 Jan 2001 11:05:40 -0000	1.10
+++ dso/os2/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = dso.lo
 
Index: dso/os390/Makefile.in
===================================================================
RCS file: /home/cvs/apr/dso/os390/Makefile.in,v
retrieving revision 1.5
diff -u -r1.5 Makefile.in
--- dso/os390/Makefile.in	12 Feb 2001 20:45:58 -0000	1.5
+++ dso/os390/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = dso.lo
 
Index: dso/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/dso/unix/Makefile.in,v
retrieving revision 1.15
diff -u -r1.15 Makefile.in
--- dso/unix/Makefile.in	9 Jan 2001 11:05:44 -0000	1.15
+++ dso/unix/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = dso.lo
 
Index: file_io/os2/Makefile.in
===================================================================
RCS file: /home/cvs/apr/file_io/os2/Makefile.in,v
retrieving revision 1.23
diff -u -r1.23 Makefile.in
--- file_io/os2/Makefile.in	2 Feb 2002 06:12:34 -0000	1.23
+++ file_io/os2/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	dir.lo \
Index: file_io/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/file_io/unix/Makefile.in,v
retrieving revision 1.24
diff -u -r1.24 Makefile.in
--- file_io/unix/Makefile.in	1 Feb 2002 01:40:38 -0000	1.24
+++ file_io/unix/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	copy.lo \
Index: i18n/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/i18n/unix/Makefile.in,v
retrieving revision 1.11
diff -u -r1.11 Makefile.in
--- i18n/unix/Makefile.in	9 Jan 2001 11:05:51 -0000	1.11
+++ i18n/unix/Makefile.in	18 Apr 2002 17:59:14 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = xlate.lo
 
Index: locks/beos/Makefile.in
===================================================================
RCS file: /home/cvs/apr/locks/beos/Makefile.in,v
retrieving revision 1.19
diff -u -r1.19 Makefile.in
--- locks/beos/Makefile.in	13 Apr 2002 13:52:25 -0000	1.19
+++ locks/beos/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	thread_mutex.lo \
Index: locks/os2/Makefile.in
===================================================================
RCS file: /home/cvs/apr/locks/os2/Makefile.in,v
retrieving revision 1.19
diff -u -r1.19 Makefile.in
--- locks/os2/Makefile.in	9 Apr 2002 07:05:29 -0000	1.19
+++ locks/os2/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	thread_mutex.lo \
Index: locks/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/locks/unix/Makefile.in,v
retrieving revision 1.24
diff -u -r1.24 Makefile.in
--- locks/unix/Makefile.in	9 Apr 2002 06:56:56 -0000	1.24
+++ locks/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	thread_mutex.lo \
Index: memory/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/memory/unix/Makefile.in,v
retrieving revision 1.8
diff -u -r1.8 Makefile.in
--- memory/unix/Makefile.in	28 Sep 2001 14:05:23 -0000	1.8
+++ memory/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = apr_pools.lo
 
Index: misc/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/misc/unix/Makefile.in,v
retrieving revision 1.29
diff -u -r1.29 Makefile.in
--- misc/unix/Makefile.in	11 Nov 2001 07:23:57 -0000	1.29
+++ misc/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	start.lo getopt.lo otherchild.lo errorcodes.lo rand.lo \
Index: mmap/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/mmap/unix/Makefile.in,v
retrieving revision 1.18
diff -u -r1.18 Makefile.in
--- mmap/unix/Makefile.in	9 Jan 2001 11:06:03 -0000	1.18
+++ mmap/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = mmap.lo common.lo
 
Index: network_io/beos/Makefile.in
===================================================================
RCS file: /home/cvs/apr/network_io/beos/Makefile.in,v
retrieving revision 1.15
diff -u -r1.15 Makefile.in
--- network_io/beos/Makefile.in	9 Jan 2001 11:06:05 -0000	1.15
+++ network_io/beos/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = poll.lo sendrecv.lo socketcommon.lo
 
Index: network_io/os2/Makefile.in
===================================================================
RCS file: /home/cvs/apr/network_io/os2/Makefile.in,v
retrieving revision 1.16
diff -u -r1.16 Makefile.in
--- network_io/os2/Makefile.in	19 Mar 2001 12:35:14 -0000	1.16
+++ network_io/os2/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	poll.lo \
Index: network_io/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/network_io/unix/Makefile.in,v
retrieving revision 1.22
diff -u -r1.22 Makefile.in
--- network_io/unix/Makefile.in	9 Jan 2001 11:06:09 -0000	1.22
+++ network_io/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	poll.lo \
Index: passwd/Makefile.in
===================================================================
RCS file: /home/cvs/apr/passwd/Makefile.in,v
retrieving revision 1.5
diff -u -r1.5 Makefile.in
--- passwd/Makefile.in	9 Jan 2001 11:06:12 -0000	1.5
+++ passwd/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = apr_md5.lo apr_getpass.lo
 
Index: shmem/beos/Makefile.in
===================================================================
RCS file: /home/cvs/apr/shmem/beos/Makefile.in,v
retrieving revision 1.2
diff -u -r1.2 Makefile.in
--- shmem/beos/Makefile.in	11 Jan 2002 12:16:40 -0000	1.2
+++ shmem/beos/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = shm.lo
 
Index: shmem/os2/Makefile.in
===================================================================
RCS file: /home/cvs/apr/shmem/os2/Makefile.in,v
retrieving revision 1.8
diff -u -r1.8 Makefile.in
--- shmem/os2/Makefile.in	10 Jan 2002 02:09:20 -0000	1.8
+++ shmem/os2/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = shm.lo
 
Index: shmem/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/shmem/unix/Makefile.in,v
retrieving revision 1.18
diff -u -r1.18 Makefile.in
--- shmem/unix/Makefile.in	10 Jan 2002 00:20:06 -0000	1.18
+++ shmem/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = shm.lo
 
Index: strings/Makefile.in
===================================================================
RCS file: /home/cvs/apr/strings/Makefile.in,v
retrieving revision 1.9
diff -u -r1.9 Makefile.in
--- strings/Makefile.in	23 May 2001 14:15:43 -0000	1.9
+++ strings/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	apr_cpystrn.lo \
Index: tables/Makefile.in
===================================================================
RCS file: /home/cvs/apr/tables/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- tables/Makefile.in	9 Jan 2001 11:06:18 -0000	1.6
+++ tables/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = apr_tables.lo apr_hash.lo
 
Index: test/Makefile.in
===================================================================
RCS file: /home/cvs/apr/test/Makefile.in,v
retrieving revision 1.80
diff -u -r1.80 Makefile.in
--- test/Makefile.in	21 Feb 2002 17:10:55 -0000	1.80
+++ test/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 PROGRAMS = \
 	client@EXEEXT@ \
Index: threadproc/beos/Makefile.in
===================================================================
RCS file: /home/cvs/apr/threadproc/beos/Makefile.in,v
retrieving revision 1.19
diff -u -r1.19 Makefile.in
--- threadproc/beos/Makefile.in	9 Jan 2001 11:06:21 -0000	1.19
+++ threadproc/beos/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	proc.lo \
Index: threadproc/os2/Makefile.in
===================================================================
RCS file: /home/cvs/apr/threadproc/os2/Makefile.in,v
retrieving revision 1.13
diff -u -r1.13 Makefile.in
--- threadproc/os2/Makefile.in	9 Jan 2001 11:06:23 -0000	1.13
+++ threadproc/os2/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	proc.lo \
Index: threadproc/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/threadproc/unix/Makefile.in,v
retrieving revision 1.28
diff -u -r1.28 Makefile.in
--- threadproc/unix/Makefile.in	9 Jan 2001 11:06:25 -0000	1.28
+++ threadproc/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = \
 	proc.lo \
Index: time/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/time/unix/Makefile.in,v
retrieving revision 1.21
diff -u -r1.21 Makefile.in
--- time/unix/Makefile.in	9 Jan 2001 11:06:26 -0000	1.21
+++ time/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = time.lo timestr.lo
 
Index: user/unix/Makefile.in
===================================================================
RCS file: /home/cvs/apr/user/unix/Makefile.in,v
retrieving revision 1.6
diff -u -r1.6 Makefile.in
--- user/unix/Makefile.in	28 Jan 2001 01:18:04 -0000	1.6
+++ user/unix/Makefile.in	18 Apr 2002 17:59:15 -0000
@@ -1,3 +1,5 @@
+srcdir = @srcdir@
+VPATH = @srcdir@
 
 TARGETS = userinfo.lo groupinfo.lo
 

Mime
View raw message