[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: busted 'make swig-py'...

From: Matt Kraai <kraai_at_alumni.cmu.edu>
Date: 2003-03-01 00:11:16 CET

On Fri, Feb 28, 2003 at 10:41:47PM +0000, Joe Orton wrote:
> On Fri, Feb 28, 2003 at 09:16:02AM -0800, Matt Kraai wrote:
> ...
> > I have
> >
> > subversion/bindings/swig/python/svn_client.c: subversion/bindings/swig/svn_client.i
> > $(RUN_SWIG_PY)
> >
> > in my build-outputs.mk and
> >
> > RUN_SWIG_PY = $(SWIG) -c -python -noproxy $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -o $@ $<
> >
> > in my Makefile, so we are telling it how to create the .c for the
> > .i. Furthermore, the command line you sent shows it running the
> > command (except for the $<).
>
> This is a common mistake - you can only use $< in inference rules (.c.o
> style) to be portable.

In that case, the following patch should fix it (and the other
similarly broken rules). Could someone with a BSD system please
test it?

> In the BSD make Ben uses $< will expand to
> nothing in this case - in GNU make it will expand to the left-most
> dependency (or all of them, I can't remember).

From the GNU make manual,

 $<
        The name of the first prerequisite. If the target got its
        commands from an implicit rule, this will be the first
        prerequisite added by the implicit rule ...

Matt

-- 
Oink!
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 5141)
+++ Makefile.in	(working copy)
@@ -117,11 +117,11 @@
 LT_COMPILE = $(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE)
 
 # special compilation for files destined for mod_dav_svn
-COMPILE_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) $(APACHE_INCLUDES) $(INCLUDES) -o $@ -c $<
+COMPILE_APACHE_MOD = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) $(APACHE_INCLUDES) $(INCLUDES) -o $@ -c
 
 # special compilation for files destined for libsvn_swig_* (e.g. swigutil_*.c)
-COMPILE_SWIG_PY = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CPPFLAGS) -DSWIGPYTHON $(CFLAGS) $(SWIG_PY_INCLUDES) $(INCLUDES) -o $@ -c $<
-COMPILE_SWIG_JAVA = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) $(SWIG_JAVA_INCLUDES) $(INCLUDES) -o $@ -c $<
+COMPILE_SWIG_PY = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CPPFLAGS) -DSWIGPYTHON $(CFLAGS) $(SWIG_PY_INCLUDES) $(INCLUDES) -o $@ -c
+COMPILE_SWIG_JAVA = $(LIBTOOL) $(LTFLAGS) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) $(SWIG_JAVA_INCLUDES) $(INCLUDES) -o $@ -c
 
 LINK = $(LIBTOOL) $(LTFLAGS) --mode=link $(CC) $(LT_LDFLAGS) $(CFLAGS) $(LDFLAGS) -rpath $(libdir)
 
@@ -130,12 +130,12 @@
 
 # these commands run SWIG to generate wrapper source files (*.c)
 ### should we protect against swig not being available?
-RUN_SWIG_PY = $(SWIG) -c -python -noproxy $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -o $@ $<
-RUN_SWIG_JAVA = cd ${SWIG_SRC_DIR}/java/org/tigris/subversion/swig && $(SWIG) -c -java -noproxy -package 'org.tigris.subversion.swig' $(SWIG_INCLUDES) -o ${abs_builddir}/$@ ${abs_builddir}/$<
+RUN_SWIG_PY = $(SWIG) -c -python -noproxy $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -o $@
+RUN_SWIG_JAVA = cd ${SWIG_SRC_DIR}/java/org/tigris/subversion/swig && $(SWIG) -c -java -noproxy -package 'org.tigris.subversion.swig' $(SWIG_INCLUDES) -o ${abs_builddir}/$@
 
 # Compilation of SWIG-generated C source code
-COMPILE_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -prefer-pic -c -o $@ $<
-COMPILE_JAVA_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_JAVA_COMPILE) -DSWIGJAVA $(SWIG_INCLUDES) $(SWIG_JAVA_INCLUDES) -prefer-pic -c -o $@ $<
+COMPILE_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_PY_COMPILE) $(SWIG_INCLUDES) $(SWIG_PY_INCLUDES) -prefer-pic -c -o $@
+COMPILE_JAVA_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=compile $(SWIG_JAVA_COMPILE) -DSWIGJAVA $(SWIG_INCLUDES) $(SWIG_JAVA_INCLUDES) -prefer-pic -c -o $@
 
 # these commands link the wrapper objects into an extension library/module
 LINK_PY_WRAPPER = $(LIBTOOL) $(LTFLAGS) --mode=link $(SWIG_PY_LINK) $(SWIG_LDFLAGS) -rpath $(swig_pydir) -avoid-version -module
Index: build/gen_make.py
===================================================================
--- build/gen_make.py	(revision 5141)
+++ build/gen_make.py	(working copy)
@@ -208,14 +208,16 @@
 
     for objname, sources in self.graph.get_deps(gen_base.DT_SWIG_C):
       deps = string.join(sources)
-      self.ofile.write('%s: %s\n\t$(RUN_SWIG_%s)\n'
-                       % (objname, deps, string.upper(objname.lang_abbrev)))
+      self.ofile.write('%s: %s\n\t$(RUN_SWIG_%s) %s\n'
+                       % (objname, deps, string.upper(objname.lang_abbrev),
+                          deps))
 
     for objname, sources in self.graph.get_deps(gen_base.DT_OBJECT):
       deps = string.join(sources)
       cmd = getattr(objname, 'build_cmd', '')
       if cmd:
-        self.ofile.write('%s: %s\n\t%s\n' % (objname, deps, cmd))
+        self.ofile.write('%s: %s\n\t%s %s\n'
+                         % (objname, deps, cmd, deps.split()[0]))
       else:
         self.ofile.write('%s: %s\n' % (objname, deps))
 
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Mar 1 00:13:05 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.