This repository has been archived by the owner on Jan 13, 2022. It is now read-only.
/
Makefile.am
137 lines (109 loc) · 4.69 KB
/
Makefile.am
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
@GLOBAL_HEADER_MK@
@PRODUCT_MK@
all:
# IMPORTANT THINGS TO FOLLOW
# Do not use relative paths to refer to sources, objects, libs etc not located in the current component dir or its subdirectories.
# Use $(top_srcdir), $(top_buildir), $(srcdir) which are provided by automake.
# Example:
# Use /xxx/yyy OR $(xxx_home)/yyy/.. to refer to paths outside the root of this project.
# To refer to sources or other input files use $(top_srcdir)/... if outside of current dir but in this project.
# To refer to all *generated* files, objects, libs etc [ if not in current dir or its subdir], use $(top_builddir)
# Follow naming conventions for global, common and specific flags.
# Make build configuratiion and rules readable.
# Break up into logical sections.
# Set up command line options, default paths in configure.ac.
# Generate gen-cpp in current dir not in other locations.
# Do no create new targets especially if build time is small
# Default setting is opt mode. Use --disable-opt to turn this off.
# Default setting is static library . Use --disable-debug to turn on shared.
# Section 1 #########################################################################
# Set up User defined flags, variables and switches here.
# It is preferable to define these variables in configure.ac.
# User specified path variables set in configure.ac.
# thrift_home
# jvm_lib
# smc_home
# fb_home
# fb303_home
# hadoop_home
#
THRIFT = $(thrift_home)/bin/thrift
# User defined conditionals and conditonal statements set up in configure.ac.
# FACEBOOK set in configure.ac
if FACEBOOK
FB_SOURCES = gen-cpp/ServiceManager_types.cpp gen-cpp/ServiceManager.cpp
FB_CPPFLAGS = -I$(fb_home)
endif
if DEBUG
DEBUG_CPPFLAGS = -DDEBUG_TIMING
endif
# Set libraries external to this component.
EXTERNAL_LIBS = -L$(thrift_home)/lib -L$(fb303_home)/lib -L$(hadoop_home)/lib -lfb303 -lthrift -lthriftnb
EXTERNAL_LIBS += -levent -lpthread
if USE_SCRIBE_HDFS
EXTERNAL_LIBS += -lhdfs -ljvm
endif
# Section 2 ############################################################################
# Set common flags recognized by automake.
# DO NOT USE CPPFLAGS, CXXFLAGS, CFLAGS, LDFLAGS here! Set in configure.ac and|or override on command line.
# USE flags AM_CXXFLAGS, AM_CFLAGS, AM_CPPFLAGS, AM_LDFLAGS, LDADD in this section.
AM_CPPFLAGS = -I..
AM_CPPFLAGS += -I$(thrift_home)/include
AM_CPPFLAGS += -I$(thrift_home)/include/thrift
AM_CPPFLAGS += -I$(fb303_home)/include/thrift
AM_CPPFLAGS += -I$(fb303_home)/include/thrift/fb303
AM_CPPFLAGS += -I$(hadoop_home)/include
AM_CPPFLAGS += $(BOOST_CPPFLAGS)
AM_CPPFLAGS += $(FB_CPPFLAGS) $(DEBUG_CPPFLAGS)
AM_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)
# Section 3 #############################################################################
# GENERATE BUILD RULES
# Set Program/library specific flags recognized by automake.
# Use <progname|libname>_<FLAG> to set prog / lib specific flag s
# foo_CXXFLAGS foo_CPPFLAGS foo_LDFLAGS foo_LDADD
# Static -- multiple libraries can be defined
if STATIC
lib_LIBRARIES = libscribe.a
libscribe_a_SOURCES = gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/scribe_constants.cpp
INTERNAL_LIBS = libscribe.a
endif
# Shared -- multiple libraries can be defined
if SHARED
shareddir = $(prefix)/lib
shared_PROGRAMS = libscribe.so
libscribe_so_SOURCES = gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp
libscribe_so_CXXFLAGS = $(SHARED_CXXFLAGS)
libscribe_so_LDFLAGS = $(SHARED_LDFLAGS)
INTERNAL_LIBS = libscribe.so
endif
# Binaries -- multiple progs can be defined.
bin_PROGRAMS = scribed
scribed_SOURCES = store.cpp store_queue.cpp conf.cpp file.cpp conn_pool.cpp scribe_server.cpp $(FB_SOURCES)
if USE_SCRIBE_HDFS
scribed_SOURCES += HdfsFile.cpp
endif
scribed_LDADD = $(EXTERNAL_LIBS) $(INTERNAL_LIBS)
if SHARED
scribed_DEPENDENCIES = libscribe.so
endif
# Section 4 ##############################################################################
# Set up Thrift specific activity here.
# We assume that a <name>+types.cpp will always be built from <name>.thrift.
$(eval $(call thrift_template,.,$(srcdir)/../if/scribe.thrift, -I $(fb303_home)/share/ --cpp --py --php --java))
if FACEBOOK
$(eval $(call thrift_template,.,$(smc_home)/if/ServiceManager.thrift,--cpp))
endif
BUILT_SOURCES = thriftstyle
# Section 5 [OPTIONAL] ##################################################################################
# Create user specific targets [ OPTIONAL]
# Overrides pre-existing target "all". Use only if required.
# all: <all-special>
# Add to pre-existing target clean
clean-local: clean-common
# Add to pre-existing target all:
#all-local: scribed
# @mkdir -p $(top_srcdir)/bin
# cp $(bin_PROGRAMS) $(top_srcdir)/bin
# Special targets.
#server-opt : $(BUILT_SOURCES) scribed
@GLOBAL_FOOTER_MK@