| 1 | #############################################################################
|
|---|
| 2 | #
|
|---|
| 3 | # MODULE: GRASS Compilation
|
|---|
| 4 | # AUTHOR(S): Original author unknown - probably CERL
|
|---|
| 5 | # Justin Hickey - Thailand - jhickey AT hpcc.nectec.or.th
|
|---|
| 6 | # Markus Neteler - Germany - neteler AT itc.it
|
|---|
| 7 | # Andreas Lange - Germany - Andreas.Lange AT Rhein-Main.de
|
|---|
| 8 | # Radim Blazek - Italy - blazek AT itc.it
|
|---|
| 9 | # PURPOSE: It provides the commands necessary to compile, install,
|
|---|
| 10 | # clean, and uninstall GRASS
|
|---|
| 11 | # See INSTALL file for explanations.
|
|---|
| 12 | # COPYRIGHT: (C) 2002,2004 by the GRASS Development Team
|
|---|
| 13 | #
|
|---|
| 14 | # This program is free software under the GNU General Public
|
|---|
| 15 | # License (>=v2). Read the file COPYING that comes with GRASS
|
|---|
| 16 | # for details.
|
|---|
| 17 | #
|
|---|
| 18 | #############################################################################
|
|---|
| 19 |
|
|---|
| 20 | MODULE_TOPDIR = .
|
|---|
| 21 |
|
|---|
| 22 | include $(MODULE_TOPDIR)/include/Make/Platform.make
|
|---|
| 23 | include $(MODULE_TOPDIR)/include/Make/Grass.make
|
|---|
| 24 |
|
|---|
| 25 | # Install directories
|
|---|
| 26 | exec_prefix= ${prefix}
|
|---|
| 27 | BINDIR= ${UNIX_BIN}
|
|---|
| 28 |
|
|---|
| 29 | # Shell commands
|
|---|
| 30 | MAKE_DIR_CMD= mkdir -p -m 755
|
|---|
| 31 |
|
|---|
| 32 | SUBDIRS = \
|
|---|
| 33 | tools \
|
|---|
| 34 | lib \
|
|---|
| 35 | db \
|
|---|
| 36 | display \
|
|---|
| 37 | doc \
|
|---|
| 38 | general \
|
|---|
| 39 | gui \
|
|---|
| 40 | imagery \
|
|---|
| 41 | misc \
|
|---|
| 42 | ps \
|
|---|
| 43 | raster \
|
|---|
| 44 | raster3d \
|
|---|
| 45 | scripts \
|
|---|
| 46 | sites \
|
|---|
| 47 | vector \
|
|---|
| 48 | visualization \
|
|---|
| 49 | man \
|
|---|
| 50 | macosx \
|
|---|
| 51 | mswindows
|
|---|
| 52 |
|
|---|
| 53 | ifeq ($(strip $(MINGW)),)
|
|---|
| 54 | SUBDIRS += gem
|
|---|
| 55 | endif
|
|---|
| 56 |
|
|---|
| 57 | ifneq ($(strip $(HAVE_NLS)),)
|
|---|
| 58 | LOCALE=1
|
|---|
| 59 | else
|
|---|
| 60 | LOCALE=0
|
|---|
| 61 | endif
|
|---|
| 62 |
|
|---|
| 63 | FILES = AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT contributors.csv contributors_extra.csv translators.csv
|
|---|
| 64 |
|
|---|
| 65 | BIN_DIST_FILES = $(FILES) \
|
|---|
| 66 | grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.tmp \
|
|---|
| 67 | bin \
|
|---|
| 68 | bwidget \
|
|---|
| 69 | docs \
|
|---|
| 70 | driver \
|
|---|
| 71 | etc \
|
|---|
| 72 | fonts \
|
|---|
| 73 | include \
|
|---|
| 74 | lib \
|
|---|
| 75 | man \
|
|---|
| 76 | scripts \
|
|---|
| 77 | tools
|
|---|
| 78 |
|
|---|
| 79 | DOXNAME=grass
|
|---|
| 80 |
|
|---|
| 81 | include $(MODULE_TOPDIR)/include/Make/Docs.make
|
|---|
| 82 | include $(MODULE_TOPDIR)/include/Make/Doxygen.make
|
|---|
| 83 |
|
|---|
| 84 | default: builddemolocation
|
|---|
| 85 | @echo "GRASS GIS compilation log" > $(ERRORLOG)
|
|---|
| 86 | @echo "-------------------------" >> $(ERRORLOG)
|
|---|
| 87 | @echo "Started compilation: `date`" >> $(ERRORLOG)
|
|---|
| 88 | @echo "--" >> $(ERRORLOG)
|
|---|
| 89 | @echo "Errors in:" >> $(ERRORLOG)
|
|---|
| 90 | chmod 755 install-sh
|
|---|
| 91 | @list='$(SUBDIRS)'; \
|
|---|
| 92 | for subdir in $$list; do \
|
|---|
| 93 | $(MAKE) -C $$subdir; \
|
|---|
| 94 | done
|
|---|
| 95 | $(MAKE) manifests
|
|---|
| 96 | if [ ${LOCALE} -eq 1 ] ; then $(MAKE) -C locale; fi
|
|---|
| 97 | -cp -f $(FILES) ${ARCH_DISTDIR}/
|
|---|
| 98 | -cp -f ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} ${ARCH_DISTDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.tmp
|
|---|
| 99 | @test -d ${ARCH_DISTDIR}/tools/ || mkdir -p ${ARCH_DISTDIR}/tools/
|
|---|
| 100 | -${INSTALL} tools/mkhtml.sh ${ARCH_DISTDIR}/tools/ 2>/dev/null
|
|---|
| 101 | @if test -d ${ARCH_DISTDIR}/tools/g.html2man/; then rm -rf ${ARCH_DISTDIR}/tools/g.html2man/; fi
|
|---|
| 102 | -${INSTALL} tools/g.html2man/g.html2man ${ARCH_DISTDIR}/tools/ 2>/dev/null
|
|---|
| 103 | -sed -e 's+tools/g.html2man/g.html2man+tools/g.html2man+' \
|
|---|
| 104 | include/Make/Man.make > ${ARCH_DISTDIR}/include/Make/Man.make
|
|---|
| 105 | @(cd tools ; sh -c "./build_html_index.sh")
|
|---|
| 106 | @if [ `cat "$(ERRORLOG)" | wc -l` -gt 5 ] ; then \
|
|---|
| 107 | echo "--" >> $(ERRORLOG) ; \
|
|---|
| 108 | echo "In case of errors please change into the directory with error and run 'make'." >> $(ERRORLOG) ; \
|
|---|
| 109 | echo "If you get multiple errors, you need to deal with them in the order they" >> $(ERRORLOG) ; \
|
|---|
| 110 | echo "appear in the error log. If you get an error building a library, you will" >> $(ERRORLOG) ; \
|
|---|
| 111 | echo "also get errors from anything which uses the library." >> $(ERRORLOG) ; \
|
|---|
| 112 | else \
|
|---|
| 113 | echo "No errors detected." >> $(ERRORLOG) ; \
|
|---|
| 114 | fi
|
|---|
| 115 | @echo "--" >> $(ERRORLOG)
|
|---|
| 116 | @echo "Finished compilation: `date`" >> $(ERRORLOG)
|
|---|
| 117 | @cat $(ERRORLOG)
|
|---|
| 118 | @if [ `cat "$(ERRORLOG)" | wc -l` -gt 8 ] ; then false ; else true ; fi
|
|---|
| 119 |
|
|---|
| 120 | manifests:
|
|---|
| 121 | ifneq ($(strip $(MINGW)),)
|
|---|
| 122 | find $(ARCH_DISTDIR) -type f -name '*.exe' | \
|
|---|
| 123 | while read file ; do \
|
|---|
| 124 | cmd=`basename "$$file" .exe` ; \
|
|---|
| 125 | sed "s/@CMD@/$$cmd/" mswindows/generic.manifest > "$$file".manifest ; \
|
|---|
| 126 | done
|
|---|
| 127 | endif
|
|---|
| 128 |
|
|---|
| 129 | LIBDIRS = \
|
|---|
| 130 | lib/external/shapelib \
|
|---|
| 131 | lib/datetime \
|
|---|
| 132 | lib/gis \
|
|---|
| 133 | lib/linkm \
|
|---|
| 134 | lib/db \
|
|---|
| 135 | lib/form \
|
|---|
| 136 | lib/vector \
|
|---|
| 137 | db/drivers
|
|---|
| 138 |
|
|---|
| 139 | # Compile libraries only
|
|---|
| 140 | libs:
|
|---|
| 141 | make -C lib/ headers
|
|---|
| 142 | @list='$(LIBDIRS)'; \
|
|---|
| 143 | for subdir in $$list; do \
|
|---|
| 144 | $(MAKE) -C $$subdir; \
|
|---|
| 145 | done
|
|---|
| 146 | -cp -f $(FILES) ${ARCH_DISTDIR}/
|
|---|
| 147 | -cp -fr --parents include ${ARCH_DISTDIR}/
|
|---|
| 148 |
|
|---|
| 149 | #we leave this target for a while so that people can easily upgrade (11/2004):
|
|---|
| 150 | mix:
|
|---|
| 151 | @echo "NOTE: 'make mix' is no longer needed (changed 9 Nov 2004)"
|
|---|
| 152 |
|
|---|
| 153 | mixclean:
|
|---|
| 154 | list='$(SUBDIRS)'; \
|
|---|
| 155 | find include -type l -exec rm {} \; 2>/dev/null; \
|
|---|
| 156 | for subdir in $$list; do \
|
|---|
| 157 | find $$subdir -type l -exec rm {} \; 2>/dev/null; \
|
|---|
| 158 | done
|
|---|
| 159 | -rm -f MIX
|
|---|
| 160 |
|
|---|
| 161 | # Any target that has a dependency on this target will be forced to be made.
|
|---|
| 162 | # If we switch to GNU Make then this feature can be replaced with .PHONY
|
|---|
| 163 | FORCE:
|
|---|
| 164 |
|
|---|
| 165 | cleandistdirs:
|
|---|
| 166 | -rm -rf ${ARCH_DISTDIR}/bin/ 2>/dev/null
|
|---|
| 167 | -rm -rf ${ARCH_DISTDIR}/bwidget/ 2>/dev/null
|
|---|
| 168 | -rm -rf ${ARCH_DISTDIR}/docs/ 2>/dev/null
|
|---|
| 169 | -rm -rf ${ARCH_DISTDIR}/driver/ 2>/dev/null
|
|---|
| 170 | -rm -rf ${ARCH_DISTDIR}/etc/ 2>/dev/null
|
|---|
| 171 | -rm -rf ${ARCH_DISTDIR}/fonts/ 2>/dev/null
|
|---|
| 172 | -rm -rf ${ARCH_DISTDIR}/include/ 2>/dev/null
|
|---|
| 173 | -rm -rf ${ARCH_DISTDIR}/lib/ 2>/dev/null
|
|---|
| 174 | -rm -rf ${ARCH_DISTDIR}/locale/ 2>/dev/null
|
|---|
| 175 | -rm -rf ${ARCH_DISTDIR}/man/ 2>/dev/null
|
|---|
| 176 | -rm -rf ${ARCH_DISTDIR}/scripts/ 2>/dev/null
|
|---|
| 177 | -rm -rf ${ARCH_DISTDIR}/demolocation/ 2>/dev/null
|
|---|
| 178 | -rm -rf ${ARCH_DISTDIR}/tcltkgrass/ 2>/dev/null
|
|---|
| 179 | -rm -rf ${ARCH_DISTDIR}/tools/ 2>/dev/null
|
|---|
| 180 | -rm -rf ${ARCH_DISTDIR}/share/ 2>/dev/null
|
|---|
| 181 | -rm -f ${ARCH_DISTDIR}/AUTHORS ${ARCH_DISTDIR}/CHANGES ${ARCH_DISTDIR}/REQUIREMENTS.html ${ARCH_DISTDIR}/COPYING ${ARCH_DISTDIR}/GPL.TXT \
|
|---|
| 182 | ${ARCH_DISTDIR}/contributors.csv ${ARCH_DISTDIR}/contributors_extra.csv ${ARCH_DISTDIR}/translators.csv \
|
|---|
| 183 | ${ARCH_DISTDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.tmp 2>/dev/null
|
|---|
| 184 | -rmdir ${ARCH_DISTDIR}
|
|---|
| 185 | -rm -f ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} 2>/dev/null
|
|---|
| 186 | -rm -f ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}.bat 2>/dev/null
|
|---|
| 187 | -rmdir ${ARCH_BINDIR}
|
|---|
| 188 |
|
|---|
| 189 | # Clean out the strings extracted from scripts for translation
|
|---|
| 190 | cleanscriptstrings:
|
|---|
| 191 | rm -f locale/scriptstrings/*.c 2>/dev/null
|
|---|
| 192 |
|
|---|
| 193 | clean: cleandistdirs cleanscriptstrings cleandocs
|
|---|
| 194 | @list='$(SUBDIRS)'; \
|
|---|
| 195 | for subdir in $$list; do \
|
|---|
| 196 | $(MAKE) -C $$subdir clean; \
|
|---|
| 197 | done
|
|---|
| 198 |
|
|---|
| 199 | libsclean: cleandistdirs
|
|---|
| 200 | @list='$(LIBDIRS)'; \
|
|---|
| 201 | for subdir in $$list; do \
|
|---|
| 202 | $(MAKE) -C $$subdir clean; \
|
|---|
| 203 | done
|
|---|
| 204 |
|
|---|
| 205 | distclean: clean
|
|---|
| 206 | -rm -f config.cache config.log config.status config.status.${ARCH} 2>/dev/null
|
|---|
| 207 | -rm -f ChangeLog ChangeLog.bak $(ERRORLOG) grass.pc
|
|---|
| 208 | -rm -f include/config.h include/version.h include/winname.h include/Make/Grass.make 2>/dev/null
|
|---|
| 209 | -rm -f include/Make/Platform.make include/Make/Doxyfile_arch_html include/Make/Doxyfile_arch_latex 2>/dev/null
|
|---|
| 210 |
|
|---|
| 211 | strip: FORCE
|
|---|
| 212 | @ if [ ! -f ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} ] ; then \
|
|---|
| 213 | echo "ERROR: GRASS has not been compiled. Try \"make\" first."; \
|
|---|
| 214 | echo " Strip aborted, exiting Make."; \
|
|---|
| 215 | exit; \
|
|---|
| 216 | fi; \
|
|---|
| 217 | cd ${ARCH_DISTDIR} ; find . -type f -perm +111 -exec strip {} \;
|
|---|
| 218 |
|
|---|
| 219 | install: FORCE
|
|---|
| 220 | @ # The following action MUST be a single action. That is, all lines
|
|---|
| 221 | @ # except the last line must have a backslash (\) at the end to
|
|---|
| 222 | @ # continue the statement. The reason for this is that Make does not
|
|---|
| 223 | @ # have an exit command thus, exit terminates the shell. However,
|
|---|
| 224 | @ # Make creates a new shell for each action listed for a target.
|
|---|
| 225 | @ # Therefore, the only way exit will quit Make is if there is only
|
|---|
| 226 | @ # a single action for the target.
|
|---|
| 227 | @ # Check if grass has been compiled, if INST_DIR is writable, and if
|
|---|
| 228 | @ # grass is part of INST_DIR
|
|---|
| 229 | echo ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}
|
|---|
| 230 | @ if [ ! -f ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} ] ; then \
|
|---|
| 231 | echo "ERROR: GRASS has not been compiled. Try \"make\" first."; \
|
|---|
| 232 | echo " Installation aborted, exiting Make."; \
|
|---|
| 233 | exit; \
|
|---|
| 234 | fi; \
|
|---|
| 235 | if [ "${MACOSX_APP}" = "1" ] ; then \
|
|---|
| 236 | ${MAKE} install-macosx; \
|
|---|
| 237 | exit; \
|
|---|
| 238 | fi; \
|
|---|
| 239 | INST_PATH=`dirname ${INST_DIR}`; \
|
|---|
| 240 | while [ ! -d $$INST_PATH ]; do \
|
|---|
| 241 | INST_PATH=`dirname $$INST_PATH`; \
|
|---|
| 242 | done; \
|
|---|
| 243 | if [ ! -d "${INST_DIR}" -a ! -w "$$INST_PATH" ] ; then \
|
|---|
| 244 | echo "ERROR: Directory $$INST_PATH is a parent directory of your"; \
|
|---|
| 245 | echo " install directory ${INST_DIR} and is not writable."; \
|
|---|
| 246 | echo " Perhaps you need root access."; \
|
|---|
| 247 | echo " Installation aborted, exiting Make."; \
|
|---|
| 248 | exit; \
|
|---|
| 249 | fi; \
|
|---|
| 250 | if [ -d ${INST_DIR} -a ! -w "${INST_DIR}" ] ; then \
|
|---|
| 251 | echo "ERROR: Your install directory ${INST_DIR} is not writable."; \
|
|---|
| 252 | echo " Perhaps you need root access."; \
|
|---|
| 253 | echo " Installation aborted, exiting Make."; \
|
|---|
| 254 | exit; \
|
|---|
| 255 | fi; \
|
|---|
| 256 | result=`echo "${INST_DIR}" | awk '{ if ($$1 ~ /grass/) print $$1 }'`; \
|
|---|
| 257 | if [ "$$result" = "" ] ; then \
|
|---|
| 258 | echo "WARNING: Your install directory ${INST_DIR}"; \
|
|---|
| 259 | echo " does not contain the word 'grass'."; \
|
|---|
| 260 | echo " It is highly recommended that the word 'grass' be part"; \
|
|---|
| 261 | echo " of your install directory to avoid conflicts."; \
|
|---|
| 262 | echo " Do you want to continue? [y/n]"; \
|
|---|
| 263 | read ans; \
|
|---|
| 264 | ans=`echo "$$ans" | tr A-Z a-z`; \
|
|---|
| 265 | if [ "$$ans" != "y" ] ; then \
|
|---|
| 266 | echo "Installation aborted, exiting Make."; \
|
|---|
| 267 | exit; \
|
|---|
| 268 | fi; \
|
|---|
| 269 | fi; \
|
|---|
| 270 | ${MAKE} real-install
|
|---|
| 271 |
|
|---|
| 272 | real-install: FORCE
|
|---|
| 273 | test -d ${INST_DIR} || ${MAKE_DIR_CMD} ${INST_DIR}
|
|---|
| 274 | @##### test -d ${INST_DIR}/dev || ${MAKE_DIR_CMD} ${INST_DIR}/dev
|
|---|
| 275 | test -d ${BINDIR} || ${MAKE_DIR_CMD} ${BINDIR}
|
|---|
| 276 | -sed -e "s#GISBASE=.*#GISBASE=${INST_DIR}#" ${ARCH_BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR} > ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}
|
|---|
| 277 | -chmod a+x ${BINDIR}/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}
|
|---|
| 278 | -cd ${GISBASE} ; tar cBf - $(FILES) | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 279 | -cd ${GISBASE} ; tar cBf - bin | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 280 | -cd ${GISBASE} ; tar cBf - bwidget | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 281 | -cd ${GISBASE} ; tar cBf - docs | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 282 | -cd ${GISBASE} ; tar cBf - driver | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 283 | -cd ${GISBASE} ; tar cBf - etc | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 284 | -cd ${GISBASE} ; tar cBf - fonts | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 285 | ifeq ($(strip $(MINGW)),)
|
|---|
| 286 | -cd ${GISBASE} ; tar cBf - man | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 287 | endif
|
|---|
| 288 | -cd ${GISBASE} ; tar cBf - scripts | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 289 | -cd ${GISBASE} ; tar cBf - tools | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 290 | if [ ${LOCALE} -eq 1 ] ; then cd ${GISBASE} ; tar cBf - locale | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null ; fi
|
|---|
| 291 | @ # The man, include, and lib could go to ${PREFIX}/ BUT if this is
|
|---|
| 292 | @ # done, then the corresponding uninstall instructions must delete
|
|---|
| 293 | @ # the grass files BY FILENAME NOT DIRECTORY!! Otherwise there is a
|
|---|
| 294 | @ # high risk of deleteing system files since PREFIX is defined by
|
|---|
| 295 | @ # default to be /usr/local
|
|---|
| 296 | @##### -cd ${GISBASE} ; tar cBf - man | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 297 | -cd ${GISBASE} ; tar cBf - include | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 298 | -sed -e "s#^\(GRASS_HOME.[^=]*\).*#\1= ${INST_DIR}#" \
|
|---|
| 299 | -e "s#^\(RUN_GISBASE.[^=]*\).*#\1= ${INST_DIR}#" \
|
|---|
| 300 | ${GISBASE}/include/Make/Platform.make > ${INST_DIR}/include/Make/Platform.make
|
|---|
| 301 | -sed -e "s#^\(ARCH_DISTDIR.[^=]*\).*#\1= ${INST_DIR}#" \
|
|---|
| 302 | -e "s#^\(ARCH_BINDIR.[^=]*\).*#\1= ${UNIX_BIN}#" \
|
|---|
| 303 | ${GISBASE}/include/Make/Grass.make > ${INST_DIR}/include/Make/Grass.make
|
|---|
| 304 | -cd ${GISBASE} ; tar cBf - lib | (cd ${INST_DIR} ; tar xBf - ) 2>/dev/null
|
|---|
| 305 | -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/monitorcap > ${INST_DIR}/etc/monitorcap
|
|---|
| 306 | -sed 's#'${GISBASE}'#'${INST_DIR}'#g' ${GISBASE}/etc/fontcap > ${INST_DIR}/etc/fontcap
|
|---|
| 307 | @##### -chmod -R 1777 ${INST_DIR}/locks 2>/dev/null
|
|---|
| 308 | -chmod -R a+rX ${INST_DIR} 2>/dev/null
|
|---|
| 309 | ifeq ($(strip $(MINGW)),)
|
|---|
| 310 | @#GEM installation
|
|---|
| 311 | -tar cBf - gem/skeleton | (cd ${INST_DIR}/etc ; tar xBf - ) 2>/dev/null
|
|---|
| 312 | -${INSTALL} gem/gem$(GRASS_VERSION_MAJOR)$(GRASS_VERSION_MINOR) ${BINDIR} 2>/dev/null
|
|---|
| 313 | endif
|
|---|
| 314 | @# enable OSX Help Viewer
|
|---|
| 315 | @if [ "`cat include/Make/Platform.make | grep -i '^ARCH.*darwin'`" ] ; then /bin/ln -sfh "${INST_DIR}/docs/html" /Library/Documentation/Help/GRASS-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR} ; fi
|
|---|
| 316 |
|
|---|
| 317 |
|
|---|
| 318 | install-strip: FORCE
|
|---|
| 319 | ${MAKE} strip
|
|---|
| 320 | ${MAKE} install
|
|---|
| 321 |
|
|---|
| 322 | install-macosx: FORCE
|
|---|
| 323 | ${MAKE} -C macosx install-macosx
|
|---|
| 324 |
|
|---|
| 325 | bindist:
|
|---|
| 326 | if [ "${MACOSX_APP}" = "1" ] ; then \
|
|---|
| 327 | ${MAKE} bindist-macosx; \
|
|---|
| 328 | exit; \
|
|---|
| 329 | fi; \
|
|---|
| 330 | ${MAKE} real-bindist
|
|---|
| 331 |
|
|---|
| 332 | real-bindist:
|
|---|
| 333 | mkdir -p ${ARCH_DISTDIR}/etc/nad/src ; \
|
|---|
| 334 | cp -f ${MODULE_TOPDIR}/lib/proj/*.lla ${ARCH_DISTDIR}/etc/nad/src ; true
|
|---|
| 335 | ( date=`date '+%d_%m_%Y'`; cd ${ARCH_DISTDIR}; tar cBf - ${BIN_DIST_FILES} | gzip -fc > ../grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date.tar.gz)
|
|---|
| 336 | -date=`date '+%d_%m_%Y'`; name=grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date.tar.gz; \
|
|---|
| 337 | size=`ls -l $$name | awk '{print $$5}'`; \
|
|---|
| 338 | sed -e "s/BIN_DIST_VERSION/${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date/" \
|
|---|
| 339 | -e "s/GRASSPRG_NAME/grass${GRASS_VERSION_MAJOR}${GRASS_VERSION_MINOR}/" \
|
|---|
| 340 | -e "s/SIZE_TAR_FILE/$$size/" -e "s#BIN_DIST_DIR#'${INST_DIR}'#" \
|
|---|
| 341 | -e "s/ARCHITECTURE/${ARCH}/" \
|
|---|
| 342 | -e "s/LD_LIBRARY_PATH_VAR/${LD_LIBRARY_PATH_VAR}/" \
|
|---|
| 343 | -e "s/TEST_STR=/TEST_STR=executable/" \
|
|---|
| 344 | -e "s#IMPORTANT.*#Generated from the binaryInstall.src file using the command make bindist#" \
|
|---|
| 345 | -e "s/# executable shell.*//" -e "s/# make bindist.*//" \
|
|---|
| 346 | binaryInstall.src > grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date-install.sh ; \
|
|---|
| 347 | chmod a+x grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}-${ARCH}-$$date-install.sh 2>/dev/null
|
|---|
| 348 |
|
|---|
| 349 | bindist-macosx:
|
|---|
| 350 | ${MAKE} -C macosx bindist-macosx
|
|---|
| 351 |
|
|---|
| 352 | # make a source package for distribution:
|
|---|
| 353 | srcdist: FORCE distclean
|
|---|
| 354 | -${MAKE_DIR_CMD} ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 355 |
|
|---|
| 356 | @ # needed to store code in package with grass-version path:
|
|---|
| 357 | -mv * ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 358 | @ # do not include the debian control files:
|
|---|
| 359 | -mv ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}/debian .
|
|---|
| 360 | @ #we use -h to get the linked files into as real files:
|
|---|
| 361 | tar cvfzh grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}/* --exclude=CVS
|
|---|
| 362 | @ # restore src code location:
|
|---|
| 363 | -mv ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}/* .
|
|---|
| 364 | -rmdir ./grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 365 | @ echo "Distribution source package: grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz ready. Calculating MD5 sum..."
|
|---|
| 366 | md5sum grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz > grass-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.md5sum
|
|---|
| 367 |
|
|---|
| 368 | # make a source package for library distribution:
|
|---|
| 369 | srclibsdist: FORCE distclean
|
|---|
| 370 | -${MAKE_DIR_CMD} ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 371 |
|
|---|
| 372 | @ # needed to store code in package with grass-version path:
|
|---|
| 373 | -cp -L * ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 374 | -cp -rL tools ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 375 | -cp -rL include ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 376 | -cp -rL --parents lib/external/shapelib ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 377 | -cp -rL --parents lib/datetime ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 378 | -cp -rL --parents lib/db ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 379 | -cp -rL --parents lib/gis ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 380 | -cp -rL --parents lib/linkm ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 381 | -cp -rL --parents lib/form ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 382 | -cp -rL --parents lib/vector ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 383 |
|
|---|
| 384 | -cp -rL --parents db/drivers ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 385 |
|
|---|
| 386 | tar chvfz grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}/* --exclude=CVS
|
|---|
| 387 | -rm -r ./grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}
|
|---|
| 388 | @ echo "Distribution source package: grass-lib-${GRASS_VERSION_MAJOR}.${GRASS_VERSION_MINOR}.${GRASS_VERSION_RELEASE}.tar.gz ready."
|
|---|
| 389 |
|
|---|
| 390 | builddemolocation:
|
|---|
| 391 | test -d ${ARCH_DISTDIR} || ${MAKE_DIR_CMD} ${ARCH_DISTDIR}
|
|---|
| 392 | -tar cBf - demolocation | (cd ${ARCH_DISTDIR}/ ; tar xBfo - ) 2>/dev/null
|
|---|
| 393 | -(cd ${ARCH_DISTDIR}/demolocation ; \
|
|---|
| 394 | rm -rf ".svn" ; \
|
|---|
| 395 | rm -rf "PERMANENT/.svn" ; \
|
|---|
| 396 | rm -rf "PERMANENT/vector/.svn" ; \
|
|---|
| 397 | rm -rf "PERMANENT/vector/mysites/.svn" ; \
|
|---|
| 398 | rm -rf "PERMANENT/vector/point/.svn" ; \
|
|---|
| 399 | rm -rf "PERMANENT/dbf/.svn" )
|
|---|
| 400 | @ echo "GISDBASE: ${RUN_GISBASE}" > ${RUN_GISRC}
|
|---|
| 401 | @ echo "LOCATION_NAME: demolocation" >> ${RUN_GISRC}
|
|---|
| 402 | @ echo "MAPSET: PERMANENT" >> ${RUN_GISRC}
|
|---|
| 403 | @ echo "GRASS_DB_ENCODING: utf-8" >> ${RUN_GISRC}
|
|---|
| 404 | @ echo "DEBUG: 0" >> ${RUN_GISRC}
|
|---|
| 405 | @ echo "GRASS_GUI: text" >> ${RUN_GISRC}
|
|---|