File: Makefile.conf

package info (click to toggle)
routino 3.2-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 8,376 kB
  • sloc: ansic: 22,337; xml: 5,520; perl: 2,485; makefile: 753; sh: 661
file content (158 lines) | stat: -rw-r--r-- 3,763 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Configuration Makefile
#
# Part of the Routino routing software.
#
# This file Copyright 2013-2015 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/>.
#

# Automatic operating system detection

UNAME=$(shell uname)

HOST=UNIX

ifneq ($(findstring CYGWIN,$(UNAME)),)
HOST=CYGWIN
endif

ifneq ($(findstring MINGW,$(UNAME)),)
HOST=MINGW
endif


# Simplify handling of executable targets ending in .exe

ifeq ($(HOST),MINGW)
.EXE=.exe
else
.EXE=
endif


# Installation locations (edit if required)

ifneq ($(HOST),MINGW)
prefix=/usr
bindir=$(prefix)/bin
incdir=$(prefix)/include
libdir=$(prefix)/lib
docdir=$(prefix)/share/doc/routino
datadir=$(prefix)/share/routino
else
prefix="c:/Program Files/Routino"
bindir=$(prefix)/bin
incdir=$(prefix)/include
libdir=$(prefix)/lib
docdir=$(prefix)/doc
datadir=$(prefix)/xml
endif


# Library version for ABI compatibility
SOVERSION=0

# Full library version (SOVERSION.MINOR[.RELEASE])
LIBVERSION=$(SOVERSION).0.0


# Compilation programs
CC=gcc
LD=gcc


# Maths library
LDFLAGS=-lm

# Language dialect selection
CFLAGS=-std=c99

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

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

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

# Debugging symbols
#CFLAGS+=-g

# Sanitizer for debugging memory addresses
#CFLAGS+=-fsanitize=address -fsanitize=leak
#LDFLAGS+=-fsanitize=address -fsanitize=leak

# Sanitizer for debugging undefined behaviour
#CFLAGS+=-fsanitize=undefined
#LDFLAGS+=-fsanitize=undefined


# Extra flags for compiling libroutino shared library (visibility of symbols, shared)
CFLAGS_LIB=-fvisibility=hidden
LDFLAGS_LIB=-shared

ifeq ($(HOST),UNIX)
# Extra flags for compiling libroutino shared library (position independent code)
CFLAGS_LIB+=-fPIC
LDFLAGS_LIB+=-fPIC
endif

ifeq ($(HOST),UNIX)
# Extra flags for compiling libroutino shared library (SONAME)
LDFLAGS_SONAME=-Wl,-soname=libroutino.so.$(SOVERSION)
LDFLAGS_SLIM_SONAME=-Wl,-soname=libroutino-slim.so.$(SOVERSION)
endif

# Put the current directory in the shared library path for the router using libroutino
LDFLAGS_LDSO=-Wl,-R.


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


ifneq ($(HOST),MINGW)
# Required for bzip2 support (comment these two lines out if not required)
CFLAGS+=-DUSE_BZIP2
LDFLAGS+=-lbz2
endif


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


# Required for xz support (uncomment these two lines if required)
#CFLAGS+=-DUSE_XZ
#LDFLAGS+=-llzma


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


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

# Hardening flags
CFLAGS+=-g -fPIE -fstack-protector-strong -Wformat -Werror=format-security
CFLAGS+=-Wdate-time -D_FORTIFY_SOURCE=2
LDFLAGS+=-fPIE -pie -Wl,-z,relro -Wl,-z,now