# Configuration Makefile
#
# Part of the Routino routing software.
#
# This file Copyright 2013 Andrew M. Bishop
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
#

# Installation locations (edit if required)

prefix=/usr/local
bindir=$(prefix)/bin
docdir=$(prefix)/doc/routino
datadir=$(prefix)/share/routino


# Locations in the source distribution (do not edit)

webdatadir=web/data
webbindir=web/bin
webwwwdir=web/www/routino
webdocdir=web/www/routino/documentation


# Compilation programs

CC=gcc
LD=gcc


# Language dialect selection
#CFLAGS=-std=c99

# Warning options
#CFLAGS+=-Wall -Wmissing-prototypes -Wextra -Wno-unused-parameter
CFLAGS=-Wall -Wmissing-prototypes -Wextra -Wno-unused-parameter

# Optimisation options
CFLAGS+=-O3
CFLAGS+=-ffast-math

# Optimisation option (only works if compilation and execution use exactly the same CPU architecture).
#CFLAGS+=-march=native


# Maths library
LDFLAGS=-lm


# Required for multi-threaded support (comment these two lines out if not required)
CFLAGS+=-pthread -DUSE_PTHREADS
LDFLAGS+=-pthread -lpthread


# Required for bzip2 support (comment these two lines out if not required)
CFLAGS+=-DUSE_BZIP2
LDFLAGS+=-lbz2


# Required for gzip support (comment these two lines out if not required)
CFLAGS+=-DUSE_GZIP
LDFLAGS+=-lz


# Required to use stdio with files > 2GiB on 32-bit system.
CFLAGS+=-D_FILE_OFFSET_BITS=64


# Required to compile on Linux without a warning about pread() and pwrite() functions.
CFLAGS+=-D_POSIX_C_SOURCE=200809L

#CFLAGS+=-D DEBUG

