-
Notifications
You must be signed in to change notification settings - Fork 0
/
GNUmakefile
93 lines (73 loc) · 2.14 KB
/
GNUmakefile
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
OBJDIR := obj
TOP := $(shell echo $${PWD-`pwd`})
CXX := g++
AR := ar
## -g -O0 -> -O2
CXXFLAGS := -g -O0 -fno-strict-aliasing -fno-rtti -fwrapv -fPIC \
-Wall -Werror -Wpointer-arith -Wendif-labels -Wformat=2 \
-Wextra -Wmissing-noreturn -Wwrite-strings -Wno-unused-parameter \
-Wno-deprecated \
-Wmissing-declarations -Woverloaded-virtual \
-Wunreachable-code -D_GNU_SOURCE -std=c++0x -I$(TOP)
LDFLAGS := -L$(TOP)/$(OBJDIR) -Wl,--no-undefined
## Copy conf/config.mk.sample to conf/config.mk and adjust accordingly.
include conf/config.mk
## Use RPATH only for debug builds; set RPATH=1 in config.mk.
ifeq ($(RPATH),1)
LDRPATH := -Wl,-rpath=$(TOP)/$(OBJDIR) -Wl,-rpath=$(TOP)
endif
CXXFLAGS += -I$(MYBUILD)/include \
-I$(MYSRC)/include \
-I$(MYSRC)/sql \
-I$(MYSRC)/regex \
-I$(MYBUILD)/sql \
-DHAVE_CONFIG_H -DMYSQL_SERVER -DEMBEDDED_LIBRARY -DDBUG_ON \
-DMYSQL_BUILD_DIR=\"$(MYBUILD)\"
LDFLAGS += -lpthread -lrt -ldl -lcrypt -lreadline
## To be populated by Makefrag files
OBJDIRS :=
.PHONY: all
all:
.PHONY: install
install:
.PHONY: clean
clean:
rm -rf $(OBJDIR)
.PHONY: doc
doc:
doxygen CryptDBdoxgen
.PHONY: whitespace
whitespace:
find . -name '*.cc' -o -name '*.hh' -type f -exec sed -i 's/ *$//' '{}' ';'
.PHONY: always
always:
# Eliminate default suffix rules
.SUFFIXES:
# Delete target files if there is an error (or make is interrupted)
.DELETE_ON_ERROR:
# make it so that no intermediate .o files are ever deleted
.PRECIOUS: %.o
$(OBJDIR)/%.o: %.cc
@mkdir -p $(@D)
$(CXX) -MD $(CXXFLAGS) -c $< -o $@
$(OBJDIR)/%.o: $(OBJDIR)/%.cc
@mkdir -p $(@D)
$(CXX) -MD $(CXXFLAGS) -c $< -o $@
include crypto/Makefrag
include parser/Makefrag
include main/Makefrag
include test/Makefrag
include util/Makefrag
include udf/Makefrag
include mysqlproxy/Makefrag
include tools/import/Makefrag
include tools/learn/Makefrag
include scripts/Makefrag
$(OBJDIR)/.deps: $(foreach dir, $(OBJDIRS), $(wildcard $(OBJDIR)/$(dir)/*.d))
@mkdir -p $(@D)
perl mergedep.pl $@ $^
-include $(OBJDIR)/.deps
# .PHONY: indent
# indent:
# uncrustify --no-backup -c conf/uncrustify.cfg $(wildcard *.cc)
# vim: set noexpandtab: