-
Notifications
You must be signed in to change notification settings - Fork 1
/
common.mk
61 lines (46 loc) · 1.31 KB
/
common.mk
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
## @file common.mk
## @author Tim van Werkhoven ([email protected])
## Common makefile directives for all subdirs.
### Version @ compiletime
include $(top_srcdir)/version.mk
### Inclusion directories
MODS_DIR = $(top_builddir)/mods
LIB_DIR = $(top_builddir)/lib
FOAM_DIR = $(top_builddir)/foam
LIBSIU_DIR = $(top_srcdir)/$(LIBSIU)
### Common flags
AM_CPPFLAGS = \
-I$(LIB_DIR) \
-I$(MODS_DIR) \
-I$(LIBSIU_DIR) \
$(COMMON_CFLAGS)
AM_CPPFLAGS += -D__STDC_FORMAT_MACROS \
-D__STDC_LIMIT_MACROS \
-DFOAM_DATADIR=\"$(datadir)/foam\" \
-DFOAM_VERSION=\"$(FOAM_VERSION)\" \
-DFOAM_BRANCH=\"$(FOAM_BRANCH)\" \
-DFOAM_LASTLOG=\"$(FOAM_LASTLOG)\"
LDADD = $(COMMON_LIBS)
# More error reporting during compilation
AM_CXXFLAGS = -Wall -Wextra -Wfatal-errors -g
### GSL flags
AM_CPPFLAGS += -DHAVE_INLINE
if !HAVE_DEBUG
AM_CPPFLAGS += -DGSL_RANGE_CHECK_OFF
endif !HAVE_DEBUG
### Debug options (first check strict debug, then regular. Add flags accordingly)
if HAVE_STR_DEBUG
AM_CPPFLAGS += -D_GLIBCXX_DEBUG \
-D_GLIBCXX_DEBUG_PEDANTIC \
-D_GLIBCXX_FULLY_DYNAMIC_STRING \
-DGLIBCXX_FORCE_NEW
endif
if HAVE_DEBUG
AM_CXXFLAGS += -ggdb -g3 -fno-inline -O0
else
AM_CXXFLAGS += -ftree-vectorize -O2
endif
### Profiling options
if HAVE_PROFILING
AM_CXXFLAGS += -pg
endif HAVE_PROFILING