[GRASS-dev] compiling vdigit in wxPython

Glynn Clements glynn at gclements.plus.com
Mon Feb 25 01:36:35 EST 2008


Michael Barton wrote:

> > That's strange - I wonder where that "-dynamic" came from?  That's  
> > a linker option, and this is just a compile step.  That may be what  
> > is causing the unhelpful error.
> >
> 
> OK. I made the link and still got a similar, but a bit different error
> 
> Michael
> 
> 
> cmb-MBP-2:~/grass_dev/grass_src/gui/wxpython/vdigit cmbarton$ make
> Makefile:23: warning: overriding commands for target `clean'
> ../../../include/Make/Rules.make:72: warning: ignoring old commands  
> for target `clean'
> c++ -c -fpic -I/Users/cmbarton/grass_dev/grass_src/dist.i686-apple- 
> darwin8.11.1/include -I/Library/Frameworks/GDAL.framework/Versions/ 
> 1.4/unix/include -I/Library/Frameworks/Python.framework/Versions/2.5/ 
> include/python2.5 -I/Library/Frameworks/Python.framework/Versions/2.5/ 
> include/python2.5 -arch ppc -arch i386 -isysroot /Developer/SDKs/ 
> MacOSX10.4u.sdk -fno-strict-aliasing -Wno-long-double -no-cpp-precomp  
> -mno-fused-madd -fno-common -dynamic -DNDEBUG -g -O3 -I/usr/local/lib/ 
> wxPython-unicode-2.8.7.1/lib/wx/include/mac-unicode-debug-2.8 -I/usr/ 
> local/lib/wxPython-unicode-2.8.7.1/include/wx-2.8 - 
> D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXDEBUG__ -D__WXMAC__    
> driver.cpp -o OBJ.i686-apple-darwin8.11.1/driver.o
> driver.cpp:1: warning: -fpic is not supported; -fPIC assumed
> driver.cpp:1: warning: -fpic is not supported; -fPIC assumed
> lipo: can't create output file: OBJ.i686-apple-darwin8.11.1/driver.o  
> (No such file or directory)

The OBJ.<arch> directory isn't being created.

Normally, this is done by the following in Rules.make

	$(OBJDIR):
		-test -d $(OBJDIR) || $(MKDIR) $(OBJDIR)
	
	ifeq ($(BROKEN_MAKE),)
	...
	$(OBJDIR)/%.o : %.cpp $(LOCAL_HEADERS) $(EXTRA_HEADERS) | $(OBJDIR)
		$(CXX) $(CXXFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(EXTRA_INC) $(INC) -o $@ -c $<
	else
	...
	$(OBJDIR)/%.o : %.cpp $(LOCAL_HEADERS) $(EXTRA_HEADERS)
		$(MAKE) $(OBJDIR)
		$(CC) $(CXXFLAGS) $(EXTRA_CFLAGS) $(NLS_CFLAGS) $(EXTRA_INC) $(INC) -o $@ -c $<
	endif

[NOTE: the latter rule incorrectly uses $(CC) instead of $(CXX), which
I'll fix shortly.]

vdigit/Makefile has a conflicting rule:

	$(OBJARCH)/%.o: %.cpp $(LOCAL_HEADERS)
		$(CXX) $(CXXFLAGS) $(INCLUDE_DIRS) $< -o $@

When multiple single-colon rules exist for a target, the dependencies
are merged while the commands from the second override those from the
first.

In the case where $(BROKEN_MAKE) isn't set, the order-only dependency
upon $(OBJDIR) is retained, which causes $(OBJDIR) to be created
first. But in the case where $(BROKEN_MAKE) is set, there is no
dependency, and the command to create the directory isn't executed
because the commands in vdigit/Makefile override it.

The best solution is to discard the rule from vdigit/Makefile, and
just use the one from Rules.make, setting EXTRA_INC to $(INCLUDE_DIRS).

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list