# Makefile.in # $Id$ SHELL= /bin/sh PREFIX= @prefix@ BINDIR= @BINDIR@ SRCDIR= `pwd` SERVERNAME= `uname -n` SYSTEM= `uname -s` VERSION= `cat src/CMD/VERSION | head -1` # Get the major release number from the version for appending to gmake, # gmakelinks, and grass command names eg VERSION = 5.0beta8 NAME_VER = 5 NAME_VER= `cat src/CMD/VERSION | head -1 | sed 's/\..*//'` INSTALL= @INSTALL@ INSTALL_DATA= @INSTALL_DATA@ -m 644 INSTALL_PROGRAM= @INSTALL_PROGRAM@ INSTALL_SCRIPT= @INSTALL@ -m 755 ####INSTALL_DATA_DIR= install -d -m 755 INSTALL_DATA_DIR= mkdir -p -m 755 ENV= @ENV@ MAKE= make # these variables will be passed to the scripts below: MAKE_ENV= GRASSSRC=${SRCDIR}/src GMAKE=${SRCDIR}/src/CMD/gmake5.0 MAKE=${MAKE} IS64BIT= ${SRCDIR}/src/CMD/generic/is64bit.sh MAKE_GMAKE_ENV= UNIX_BIN=${BINDIR} SRC=${SRCDIR} MAKE=${MAKE} NAME_VER=${NAME_VER} MAKE_POST_ENV= GISBASE=${PREFIX} MACHINENAME=${SERVERNAME} # the cutline we need to find out to shorten the ChangeLog: CUTLINE= `grep -n '1999-12-29 16:12' ChangeLog |cut -d':' -f1 | head -1` ####################### #make targets: all: pre-install install: pre-install do-install pre-install: test -d ${PREFIX} || ${INSTALL_DATA_DIR} ${PREFIX} test -d src/CMD/next_step || mkdir -p src/CMD/next_step ${MAKE_GMAKE_ENV} ${MAKE_POST_ENV} ${SHELL} src/CMD/generic/CREATE_GMAKE.sh @if [ $? != 0 ] ; then echo "An error occured. Stop." ; exit 1 ; fi ${SHELL} ${IS64BIT} echo "Now proceed with make install" do-install: ${MAKE_ENV} ${SHELL} src/CMD/generic/GISGEN.sh ${MAKE_ENV} ${SHELL} src/CMD/generic/MAKELINKS.sh ${MAKE_POST_ENV} ${SHELL} src/CMD/generic/POST_INSTALL.sh # GRASS source code cleaning options: # # There are three options for cleaning the GRASS source code. Each option # performs the following operations: # # make clean - delete all object files and the next step file, keep the # compiled GRASS libraries - good for saving disk space # make distclean - delete object files, next step file, libraries, and # generated directories like etc/ and dev/ - good for # recompiling on the same system (keep configure files) # make veryclean - delete object files, next step file, libraries, generated # directories, head file, configure files, and Makefile - good # for starting the whole installation from scratch # # Note that some files may not be deleted due to difficulties in specifying # them in this Makefile. These files include the C files generated by lex and # yacc, and any other file that is not listed in the options above. clean: echo "Performing simple clean..." find . -name 'OBJ*' -exec rm -rf {} \; 2>/dev/null ; true rm -f src/CMD/next_step/* 2>/dev/null ; true # Simple clean finished distclean: clean echo "Performing compilation clean..." find . -name 'LIB*' -exec rm -rf {} \; 2>/dev/null ; true rm -f src.garden/grass.hdf/HDF4.1r3/hdf/src/libdf.a 2>/dev/null ; true rm -f ${BINDIR}/gmake${NAME_VER} 2>/dev/null ; true rm -f ${BINDIR}/gmakelinks${NAME_VER} 2>/dev/null ; true rm -f ${BINDIR}/grass${NAME_VER} 2>/dev/null ; true rm -rf ${PREFIX}/bin/* 2>/dev/null ; true rm -rf ${PREFIX}/bwidget/ 2>/dev/null ; true rm -rf ${PREFIX}/dev/ 2>/dev/null ; true rm -rf ${PREFIX}/driver/ 2>/dev/null ; true rm -rf ${PREFIX}/etc/ 2>/dev/null ; true rm -rf ${PREFIX}/fonts/ 2>/dev/null ; true rm -rf ${PREFIX}/include/ 2>/dev/null ; true rm -rf ${PREFIX}/lib/ 2>/dev/null ; true rm -rf ${PREFIX}/man/help/ 2>/dev/null ; true rm -rf ${PREFIX}/man/1/ 2>/dev/null ; true rm -rf ${PREFIX}/man/2/ 2>/dev/null ; true rm -rf ${PREFIX}/man/3/ 2>/dev/null ; true rm -rf ${PREFIX}/man/4/ 2>/dev/null ; true rm -rf ${PREFIX}/man/5/ 2>/dev/null ; true rm -rf ${PREFIX}/locks/ 2>/dev/null ; true rm -rf ${PREFIX}/scripts/ 2>/dev/null ; true rm -rf ${PREFIX}/tcltkgrass/ 2>/dev/null ; true rm -rf ${PREFIX}/txt/ 2>/dev/null ; true rm -f error.log 2>/dev/null ; true # Compilation clean finished veryclean: distclean echo "Performing complete installation clean..." rm -f src/CMD/head/head 2>/dev/null ; true rm -f config.cache config.log config.status 2>/dev/null ; true rm -f src/scripts/shells/create_fifos.sh 2>/dev/null ; true rm -f src/include/config.h 2>/dev/null ; true rm -f Makefile 2>/dev/null ; true # Complete installation clean finished # make a source package for distribution: srcdist: veryclean echo "create Changelog file without initial messages..." # cvs2cl.pl creates a GNU style ChangeLog file: # http://www.red-bean.com/~kfogel/cvs2cl.shtml cvs2cl.pl echo "reduce Changelog file... Dont want the initial upload included." head -${CUTLINE} ChangeLog > ChangeLog.cut echo " initial CVS import" >> ChangeLog.cut mv ChangeLog.cut ChangeLog rm -f ChangeLog.bak tar cvfz grass${VERSION}_src.tar.gz * --exclude=CVS echo "Distribution source package: grass${VERSION}_src.tar.gz ready." # make a binary package for distribution: # Bug: VER is not expanded properly (wrong directory): bindist: cp GPL.TXT ${PREFIX}/COPYRIGHT (cd ${PREFIX}; tar cvfz grass${VERSION}_${SYSTEM}_bin.tar.gz * ) echo "Distribution binary package: grass${VERSION}_${SYSTEM}_bin.tar.gz ready."