[GRASS-dev] installed makefile cleanup

William Kyngesburye woklist at kyngchaos.com
Tue Oct 2 15:52:57 EDT 2007


I sortof understand this.  Until you can work out the necessary  
changes (if you decide to), how about some minimal changes to the the  
extension compilation working?  Here are my revised changes to get it  
working:

- platform.make.in:

RUN_GISBASE         = ${ARCH_DISTDIR}
RUN_GISRC           = ${RUN_GISBASE}/demolocation/.grassrc$ 
{GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}

this allows those to be overridden together in the make step, yet  
still keeps the same configured default for a source build.

- grass.make.in: add after "ifdef INST_NOW":

ifdef INST_XTN
ARCH_INC = -I$(ARCH_DISTDIR)/include -I$(MODULE_TOPDIR)/include
ARCH_LIBPATH = -L$(ARCH_LIBDIR) -L$(MODULE_TOPDIR)/lib
endif

to look for includes and libs in both the module source/dist and the  
installed GRASS

- grass.make.in: add at end:

ifdef INST_XTN
include $(MODULE_TOPDIR)/include/Make/Install_xtn.make
endif

and have a new Install_xtn.make fragment.  This is just a trimmed  
version of the main makefile with just install targets and any  
unnecessary bits removed.  It expects INST_DIR_XTN to be set in the  
make command.

- module.make: for the bin/pgm and etc/pgm targets, conditionalize  
the dependencies:

ifdef INST_XTN
$(BIN)/$(PGM)$(EXE): $(ARCH_CMD_OBJS)
else
$(BIN)/$(PGM)$(EXE): $(ARCH_CMD_OBJS) $(DEPENDENCIES)
endif

...

ifdef INST_XTN
$(ETC)/$(PGM)$(EXE): $(ARCH_CMD_OBJS)
else
$(ETC)/$(PGM)$(EXE): $(ARCH_CMD_OBJS) $(DEPENDENCIES)
endif

since the dependencies are based off ARCH_LIBDIR, which will be in  
the extension source dir, they won't be found.


Then, to compile an extension, cd to its source and:

make INST_XTN=y GRASS_HOME=. MODULE_TOPDIR=/path/to/installed/grass  
RUN_GISBASE=/path/to/installed/grass

Note: I still had problems with having an inst_xtn: target (similar  
to the inst_now target) and putting INST_XTN=y before make.  No  
infinite loop now, but after completing the compilation  
(successfully) it exits with an error:

/Applications/GRASS-6.3.app/Contents/MacOS/tools/mkhtml.sh  
v.strahler ; mkdir -p ./dist.i686-apple-darwin8.10.1/docs/html ; /usr/ 
bin/install -c  -m 644 v.strahler.tmp.html ./dist.i686-apple- 
darwin8.10.1/docs/html/v.strahler.html ; for file in  *.png *.jpg ;  
do head -n 1 $file | grep '^#!' > /dev/null ; if [ $? -ne 0 ] ; then / 
usr/bin/install -c  -m 644 $file ./dist.i686-apple-darwin8.10.1/docs/ 
html ; fi done 2> /dev/null ; true
INST_XTN= make
make[2]: *** No rule to make target `dist.i686-apple-darwin8.10.1/lib/ 
libgrass_display.dylib', needed by `dist.i686-apple-darwin8.10.1/bin/ 
v.strahler'.  Stop.
make[1]: *** [inst_xtn] Error 2
make: *** [first] Error 2
rm v.strahler.tmp.html

It looks like, when done, INST_XTN gets set to something other than  
"Y" and it tries to do a normal compile (thus trying to compile  
dependencies).

Is there a particular reason for doing it this way, instead of having  
no extra make target and putting INST_XTN after make?

To install the extension in a user-specified location:

make INST_XTN=y GRASS_HOME=. MODULE_TOPDIR=/path/to/installed/grass  
RUN_GISBASE=/path/to/installed/grass INST_DIR_XTN=/path/to/user/xtn/ 
dir install


On Sep 23, 2007, at 8:17 PM, Glynn Clements wrote:

...
>
> As for the rest of it, we're probably better off starting from basics.
>
> The following might all be independently variable (with example
> locations):
>
> 1. Where to find the GRASS source tree (/usr/local/src/grass)
> 2. Where to find the extension code which is being compiled (/usr/ 
> local/src/mygrassext)
> 3. Where to find output files (/usr/local/src/grass/<module path>/ 
> OBJ.<arch>)
> 4. Where to find "part-installed" files (/usr/local/src/grass/ 
> dist.<arch>)
> 5. Where to find the installed version of GRASS (/usr/local/grass6.3)
> 6. Where to put output files (/usr/local/src/grass/<module path>/ 
> OBJ.<arch>)
> 7. Where to put "part-installed" files (/usr/local/src/grass/ 
> dist.<arch>)
> 8. Where to install everything (/usr/local/grass6.3)
> 9. Where to find the Makefile fragments.
>
> AFAICT, there are three main cases:
>
> A. Compiling GRASS from scratch.
> B. Compiling additional modules on a system where a compiled GRASS  
> is already installed.
> C. Compiling extensions on a system where a compiled GRASS is  
> already installed.
>
...

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

"Time is an illusion - lunchtime doubly so."

- Ford Prefect





More information about the grass-dev mailing list