[GRASS-dev] installed makefile cleanup

William Kyngesburye woklist at kyngchaos.com
Sat Sep 22 16:28:32 EDT 2007


I started looking at the installed makefile fragments to get them in  
working order to build addons.  I'm mainly interested in building for  
external installation, so I'm doing a separate INST_XTN setup based  
on the existing INST_NOW (which builds into the GRASS installation).

This is what I have so far (all tests, nothing in CVS yet):

- first, a problem with INST_NOW.  In Grass.make, the first: target has:

first: pre default
	@if test -n "$(INST_NOW)" ; then \
		$(MAKE) inst_now ; \
	fi

then there is an inst_now: target:

inst_now:
	INST_NOW= $(MAKE)

That got into a nasty infinite loop for me when used as suggested:

make GRASS_HOME=. MODULE_TOPDIR=/Applications/GRASS-6.3.app/Contents/ 
MacOS INST_NOW=y

So I ignored that for creating my INST_XTN variation.


- installed a copy of demolocation in the installed GRASS.   
edited .grassrc63 to set GISDBASE to the INST_DIR.


- Grass.make - add below the "ifdef INST_NOW" block:

ifdef INST_XTN
ARCH_DISTDIR    = $(INST_DIR)
XTN_DISTDIR     = $(GRASS_HOME)/dist.$(ARCH)
ARCH_INC        = -I$(ARCH_DISTDIR)/include -I$(XTN_DISTDIR)/include
ARCH_LIBPATH	= -L$(ARCH_LIBDIR) -L$(XTN_DISTDIR)/lib
BIN             = $(XTN_DISTDIR)/bin
ETC             = $(XTN_DISTDIR)/etc
DRIVERDIR       = $(XTN_DISTDIR)/driver
DBDRIVERDIR     = $(XTN_DISTDIR)/driver/db
endif

I needed to split ARCH_DISTDIR, which points to the installed GRASS,  
from the distdir for building the extension into.  So, that required  
a few other changes in the other makefile frags:


- platform.make - replace the RUN_GISBASE setting:

ifdef INST_XTN
RUN_GISBASE         = $(INST_DIR)
else
RUN_GISBASE         = /Users/Shared/src/GRASS/cvs/grass6/dist.i686- 
apple-darwin8.10.1
endif

I guess, to get INST_NOW to also work, the source RUN_GISBASE should  
also be changed to the installed GRASS path.


- html.make - conditionally refer to ARCH_DISTDIR or XTN_DISTDIR as  
needed:

htmlgen:
	@$(MODULE_TOPDIR)/tools/mkhtml.sh $(PGM)
	-if [ "${INST_XTN}" = "y" ] ; then \
		$(MKDIR) $(XTN_DISTDIR)/docs/html ; \
		mv -f $(PGM).tmp.html $(XTN_DISTDIR)/docs/html/$(PGM).html ; \
	else \
		$(MKDIR) $(ARCH_DISTDIR)/docs/html ; \
		mv -f $(PGM).tmp.html $(ARCH_DISTDIR)/docs/html/$(PGM).html ; \
	fi
	-for file in  *.png *.jpg ; do \
		head -n 1 $$file | grep '^#!' > /dev/null ; \
		if [ $$? -ne 0 ] ; then \
			if [ "${INST_XTN}" = "y" ] ; then \
				$(INSTALL_DATA) $$file $(XTN_DISTDIR)/docs/html ; \
			else \
				$(INSTALL_DATA) $$file $(ARCH_DISTDIR)/docs/html ; \
			fi \
		fi \
		done 2> /dev/null ; true

- install tools/mkhtml.sh in the installed GRASS


This works mostly.  The compilation works.  But html.make is having  
problems - running the module to generate the htmldesc complains  
about GISDBASE not being set and all I get is the description and no  
module options/usage.

GISDBASE is set correctly in .grassrc63 in the demolocation I  
installed.  Setting a higher DEBUG level doesn't give me any helpful  
info.

-----
William Kyngesburye <kyngchaos*at*kyngchaos*dot*com>
http://www.kyngchaos.com/

Theory of the Universe

There is a theory which states that if ever anyone discovers exactly  
what the universe is for and why it is here, it will instantly  
disappear and be replaced by something even more bizarrely  
inexplicable.  There is another theory which states that this has  
already happened.

-Hitchhiker's Guide to the Galaxy 2nd season intro





More information about the grass-dev mailing list