Skip to content

Instantly share code, notes, and snippets.

@fxi
Last active August 29, 2015 14:17
Show Gist options
  • Save fxi/9cbe9223aa4dbcf01401 to your computer and use it in GitHub Desktop.
Save fxi/9cbe9223aa4dbcf01401 to your computer and use it in GitHub Desktop.
#############################################################################
#
# MODULE: GRASS Compilation
# AUTHOR(S): Original author unknown - probably CERL
# Justin Hickey - Thailand - jhickey AT hpcc.nectec.or.th
# Markus Neteler - Germany - neteler AT itc.it
# Andreas Lange - Germany - Andreas.Lange AT Rhein-Main.de
# Radim Blazek - Italy - blazek AT itc.it
# PURPOSE: It provides the commands necessary to compile, install,
# clean, and uninstall GRASS
# See INSTALL file for explanations.
# COPYRIGHT: (C) 2002-2012 by the GRASS Development Team
#
# This program is free software under the GNU General Public
# License (>=v2). Read the file COPYING that comes with GRASS
# for details.
#
#############################################################################
MODULE_TOPDIR = .
include $(MODULE_TOPDIR)/include/Make/Dir.make
include $(MODULE_TOPDIR)/include/Make/Compile.make
DATE := $(shell date '+%d_%m_%Y')
# removed gui dir (and others unnecessary modules) that were problematic for a project of minimal headless grass server.
DIRS = \
demolocation \
tools \
include \
lib \
db \
general \
raster \
vector \
misc \
scripts \
doc \
locale \
man
SUBDIRS = $(DIRS)
FILES = AUTHORS COPYING CHANGES REQUIREMENTS.html GPL.TXT contributors.csv contributors_extra.csv translators.csv
FILES_DST = $(patsubst %,$(ARCH_DISTDIR)/%,$(FILES))
default:
@echo "GRASS GIS $(GRASS_VERSION_MAJOR).$(GRASS_VERSION_MINOR).$(GRASS_VERSION_RELEASE) r$(GRASS_VERSION_SVN) compilation log" \
> $(ERRORLOG)
@echo "--------------------------------------------------" >> $(ERRORLOG)
@echo "Started compilation: `date`" >> $(ERRORLOG)
@echo "--" >> $(ERRORLOG)
@echo "Errors in:" >> $(ERRORLOG)
-$(CHMOD) 755 install-sh
$(MAKE) subdirs
$(MAKE) $(FILES_DST)
$(MAKE) manifests
@if [ `wc -l < "$(ERRORLOG)"` -gt 5 ] ; then \
echo "--" >> $(ERRORLOG) ; \
echo "In case of errors please change into the directory with error and run 'make'." >> $(ERRORLOG) ; \
echo "If you get multiple errors, you need to deal with them in the order they" >> $(ERRORLOG) ; \
echo "appear in the error log. If you get an error building a library, you will" >> $(ERRORLOG) ; \
echo "also get errors from anything which uses the library." >> $(ERRORLOG) ; \
else \
echo "No errors detected." >> $(ERRORLOG) ; \
fi
@echo "--" >> $(ERRORLOG)
@echo "Finished compilation: `date`" >> $(ERRORLOG)
@cat $(ERRORLOG)
@if [ `wc -l < "$(ERRORLOG)"` -gt 8 ] ; then false ; else true ; fi
manifests:
ifeq ($(MANIFEST),external)
find $(ARCH_DISTDIR) -type f -name '*.exe' | \
while read file ; do \
$(MAKE) "$$file".manifest ; \
done
endif
$(ARCH_DISTDIR)/%: %
$(INSTALL_DATA) $< $@
LIBDIRS = \
lib/external/shapelib \
lib/datetime \
lib/gis \
lib/linkm \
lib/db \
lib/vector \
db/drivers
# Compile libraries only
libs:
$(MAKE) -C include
$(MAKE) subdirs SUBDIRS=$(LIBDIRS)
$(MAKE) $(FILES_DST)
cleandistdirs:
-rm -rf $(ARCH_DISTDIR)
-rm -rf $(ARCH_BINDIR)
# Clean out the strings extracted from scripts for translation
cleanscriptstrings:
rm -f locale/scriptstrings/*.c 2>/dev/null
clean: cleandistdirs cleanscriptstrings cleandocs
libsclean: cleandistdirs
$(MAKE) clean-recursive SUBDIRS=$(LIBDIRS)
distclean: clean
-rm -f config.cache config.log config.status config.status.$(ARCH) 2>/dev/null
-rm -f ChangeLog ChangeLog.bak $(ERRORLOG) grass.pc
-rm -f include/config.h include/version.h
-rm -f include/Make/Platform.make include/Make/Doxyfile_arch_html include/Make/Doxyfile_arch_latex 2>/dev/null
include $(MODULE_TOPDIR)/include/Make/Install.make
include $(MODULE_TOPDIR)/include/Make/Docs.make
include $(MODULE_TOPDIR)/include/Make/Doxygen.make
include $(MODULE_TOPDIR)/include/Make/Sphinx.make
DOXNAME=grass
.PHONY: default libs
.PHONY: cleandistdirs cleanscriptstrings clean libsclean distclean
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment