-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile_rules
87 lines (72 loc) · 2.82 KB
/
Makefile_rules
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
# Locations for the build.
BIN := bin
OBJ := obj
# Pieces of how to build things.
CC := g++
CFLAGS := -std=c++11 -Wextra -Wall -Wsign-promo -Woverloaded-virtual -Wendif-labels -Isrc/
# STRICT=yes removes all exceptions from the warnings.
ifneq ($(STRICT),yes)
CFLAGS := $(CFLAGS) -Wno-unused -Wno-deprecated -Wno-long-long -Wno-parentheses -Wno-unused-parameter
endif
CFLAGS := $(CFLAGS) -fno-nonansi-builtins -mieee-fp -fno-strict-aliasing -iquote . -ggdb
LD := g++
LDFLAGS := -ggdb
LDLIBS :=
AR := ar
# STATIC=yes builds static binaries, primarily for cross platform testing
ifeq ($(STATIC),yes)
LDFLAGS += -static
endif
# GENERIC=yes disables processor-specific options that might cause silently
# broken binaries and data corruption on non-CRD x86-64 machines.
ifneq ($(GENERIC),yes)
CFLAGS := $(CFLAGS) -march=opteron-sse3
else
OBJ := $(OBJ)_generic
BIN := $(BIN)_generic
endif
# If the debugging flag is on, append _debug to the build locations and adjust CFLAGS appropriately.
ifeq ($(DEBUGGING),yes)
OBJ :=$(OBJ)_debug
BIN :=$(BIN)_debug
CFLAGS := $(CFLAGS)
else
CFLAGS := $(CFLAGS) -O3
# Chaos can easily result down this road, but this feature lets you turn on debug mode
# for whatever you happen to recompile, without segregating the resulting objects in a
# separate directory. Do this enough without keeping track of what you've done, and
# you'll end up with a mess of programs that are halfway in debug mode, which will run
# slowly and you won't know why.
ifneq ($(FORCE_DEBUG),yes)
CFLAGS := $(CFLAGS) -DNDEBUG
endif
endif
# If the profiling flag is on, append _prof to the build locations.
ifeq ($(PROFILE),yes)
OBJ :=$(OBJ)_prof
BIN :=$(BIN)_prof
LDFLAGS := $(LDFLAGS) -pg
CFLAGS := $(CFLAGS) -pg
endif
# This is the command that we'll use for all linking.
# Note: certain binaries will use target-specific overrides to adjust LDFLAGS and LDLIBS
# as directed by "MakeDepend: lflags" and "library" directives embedded in their sources.
LINK = $(LD) $(LDFLAGS) -o $@ $< $(OBJ)/LinkTimestamp.o -L$(OBJ) -lCRD $(LDLIBS)
# This is the command that we'll use for all compilation.
# Note: Certain objects will use target-specific overrides to adjust CFLAGS as directed
# by "MakeDepend: cflags" directives embedded in their sources.
COMPILE = mkdir -p $(@D) && $(CC) $(CFLAGS) -c -o $@ $<
# This is the command that we'll use to update the library
ARCHIVE = $(AR) cr $@ $?
# target-specific values for CFLAGS
XERCES_INC := -I/wga/dev/local/xerces_c_3_1_1/include
OMP_FLAGS := -fopenmp
CXXTEST := -Itest
# target-specific values for LDLIBS
GMPXX := -lgmpxx -lgmp
JEMALLOC := -L/wga/dev/local/lib -Wl,-rpath,/wga/dev/local/lib -ljemalloc
OMP := -lgomp
PTHREAD := -lpthread
XERCES := -L/wga/dev/local/xerces_c_3_1_1/lib -Wl,-rpath -Wl,/wga/dev/local/xerces_c_3_1_1/lib -lxerces-c $(PTHREAD)
X11 := -lX11
ZLIB := -lz