[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Pkg-octave-devel] Patch for making octave-forge buidl with GNU make 3.81



The following bug report has been filed against the octave-forge
Debian package:

    http://bugs.debian.org/344995
    
Joaquim Ortega has investigated the problem and traced it down to a
change in the way GNU make version 3.81 treats multiple defined pattern
rules.

Briefly, the problem is the following: the top srcdir Makeconf defines the
following default pattern rule:

    %.o: %.cc ; $(MKOCTFILE) -c $<

Makefiles like main/comm/Makefile have the following:

    sinclude ../../Makeconf
    [...]
    %.o:%.cc
           @echo "Compiling $@"; \
           $(MKOCTFILE) $(MOFLAGS) $(DEFINES) -c $< 

With GNU make 3.80 or earlier, the second pattern rule overrode the one
defined in Makeconf.  However, GNU make 3.81 interprets these two rules
as two unrelated rules.  Frankly, I do not undertand the rationale for
this change in the GNU make behavior because using the semicolon should
make no semantic difference in the rule interpretaion.

At any rate, it seems that changing the second rule to:

    %.o:%.cc ; @echo "Compiling $@"; \
           $(MKOCTFILE) $(MOFLAGS) $(DEFINES) -c $< 

fixes the problem.

I just uploaded a new version of the octave-forge package to debian
unstable which contains a patch for fixing the above problem.  This patch
is attached below.

I am a member of the octave-forge project @ SF.  If you think the patch
below is okay, I would gladly apply it to CVS.

P.S.: I am also attaching below a patch to extra/pdb/Makefile which fixes a
minor problem, namely that make clean fails in extra/pdb when Makeconf does
not exist at the top srcdir.

-- 
Rafael
#! /bin/sh /usr/share/dpatch/dpatch-run
## 50_make-pattern-rules.dpatch by  <root@laboiss2.intra.mpipf-muenchen.mpg.de>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: New patch generated from octave-forge 2005.06.13-6 diff.gz

@DPATCH@

--- octave-forge-2005.06.13.orig/main/comm/Makefile
+++ octave-forge-2005.06.13/main/comm/Makefile
@@ -67,7 +67,7 @@
 	@echo "Depending $<"; \
 	$(MKOCTFILE) $(MOFLAGS) $(DEFINES) -M $<
 
-%.o:%.cc
+%.o:%.cc ; \
 	@echo "Compiling $@"; \
 	$(MKOCTFILE) $(MOFLAGS) $(DEFINES) -c $< 
 
--- octave-forge-2005.06.13.orig/main/fixed/Makefile
+++ octave-forge-2005.06.13/main/fixed/Makefile
@@ -162,9 +162,7 @@
 	@echo "Depending $<"; \
 	$(MKOCTFILE) $(MOFLAGS) $(DEFINES) -M $<
 
-%.o:%.cc
-%.o:%.cc %.d
-	@echo "Compiling $@"; \
+%.o:%.cc ; @echo "Compiling $@"; \
 	$(MKOCTFILE) $(MOFLAGS) $(DEFINES) -c $< 
 
 clean: $(SUBDIRS)
--- octave-forge-2005.06.13.orig/main/fixed/examples/Makefile
+++ octave-forge-2005.06.13/main/fixed/examples/Makefile
@@ -45,7 +45,7 @@
 	@echo "Depending $<"; \
 	$(MKOCTFILE) $(MOFLAGS) $(DEFINES) -M $<
 
-%.o: %.cc
+%.o: %.cc ; \
 	@echo "Compiling $@"; \
 	$(MKOCTFILE) $(MOFLAGS) $(DEFINES) -c $< 
 
#! /bin/sh /usr/share/dpatch/dpatch-run
## 50_extra-pdb-sinclude.dpatch by Rafael Laboissiere <rafael@debian.org>
##
## DP: Avoid failures for make clean

@DPATCH@

--- octave-forge-2005.06.13.orig/extra/pdb/Makefile
+++ octave-forge-2005.06.13/extra/pdb/Makefile
@@ -1,4 +1,4 @@
-include ../../Makeconf
+sinclude ../../Makeconf
 
 all: creadpdb.oct plotpdb.m
 

Reply to: