| 301 |
ashish |
1 |
@GLOBAL_HEADER_MK@
|
|
|
2 |
|
|
|
3 |
@PRODUCT_MK@
|
|
|
4 |
|
|
|
5 |
all:
|
|
|
6 |
|
|
|
7 |
# IMPORTANT THINGS TO FOLLOW
|
|
|
8 |
# Do not use relative paths to refer to sources, objects, libs etc not located in the current component dir or its subdirectories.
|
|
|
9 |
# Use $(top_srcdir), $(top_buildir), $(srcdir) which are provided by automake.
|
|
|
10 |
# Example:
|
|
|
11 |
# Use /xxx/yyy OR $(xxx_home)/yyy/.. to refer to paths outside the root of this project.
|
|
|
12 |
# To refer to sources or other input files use $(top_srcdir)/... if outside of current dir but in this project.
|
|
|
13 |
# To refer to all *generated* files, objects, libs etc [ if not in current dir or its subdir], use $(top_builddir)
|
|
|
14 |
# Follow naming conventions for global, common and specific flags.
|
|
|
15 |
# Make build configuratiion and rules readable.
|
|
|
16 |
# Break up into logical sections.
|
|
|
17 |
# Set up command line options, default paths in configure.ac.
|
|
|
18 |
# Generate gen-cpp in current dir not in other locations.
|
|
|
19 |
# Do no create new targets especially if build time is small
|
|
|
20 |
# Default setting is opt mode. Use --disable-opt to turn this off.
|
|
|
21 |
# Default setting is static library . Use --disable-debug to turn on shared.
|
|
|
22 |
|
|
|
23 |
# Section 1 #########################################################################
|
|
|
24 |
# Set up User defined flags, variables and switches here.
|
|
|
25 |
# It is preferable to define these variables in configure.ac.
|
|
|
26 |
|
|
|
27 |
# User specified path variables set in configure.ac.
|
|
|
28 |
# thrift_home
|
|
|
29 |
# jvm_lib
|
|
|
30 |
# smc_home
|
|
|
31 |
# fb_home
|
|
|
32 |
# fb303_home
|
|
|
33 |
# hadoop_home
|
|
|
34 |
#
|
|
|
35 |
THRIFT = $(thrift_home)/bin/thrift
|
|
|
36 |
|
|
|
37 |
# User defined conditionals and conditonal statements set up in configure.ac.
|
|
|
38 |
# FACEBOOK set in configure.ac
|
|
|
39 |
|
|
|
40 |
if FACEBOOK
|
|
|
41 |
FB_SOURCES = gen-cpp/ServiceManager_types.cpp gen-cpp/ServiceManager.cpp
|
|
|
42 |
FB_CPPFLAGS = -I$(fb_home)
|
|
|
43 |
endif
|
|
|
44 |
if DEBUG
|
|
|
45 |
DEBUG_CPPFLAGS = -DDEBUG_TIMING
|
|
|
46 |
endif
|
|
|
47 |
|
|
|
48 |
|
|
|
49 |
# Set libraries external to this component.
|
|
|
50 |
EXTERNAL_LIBS = -L$(thrift_home)/lib -L$(fb303_home)/lib -L$(hadoop_home)/lib -lfb303 -lthrift -lthriftnb
|
|
|
51 |
EXTERNAL_LIBS += -levent -lpthread
|
|
|
52 |
if USE_SCRIBE_HDFS
|
|
|
53 |
EXTERNAL_LIBS += -lhdfs -ljvm
|
|
|
54 |
endif
|
|
|
55 |
|
|
|
56 |
# Section 2 ############################################################################
|
|
|
57 |
# Set common flags recognized by automake.
|
|
|
58 |
# DO NOT USE CPPFLAGS, CXXFLAGS, CFLAGS, LDFLAGS here! Set in configure.ac and|or override on command line.
|
|
|
59 |
# USE flags AM_CXXFLAGS, AM_CFLAGS, AM_CPPFLAGS, AM_LDFLAGS, LDADD in this section.
|
|
|
60 |
|
|
|
61 |
AM_CPPFLAGS = -I..
|
|
|
62 |
AM_CPPFLAGS += -I$(thrift_home)/include
|
|
|
63 |
AM_CPPFLAGS += -I$(thrift_home)/include/thrift
|
|
|
64 |
AM_CPPFLAGS += -I$(fb303_home)/include/thrift
|
|
|
65 |
AM_CPPFLAGS += -I$(fb303_home)/include/thrift/fb303
|
|
|
66 |
AM_CPPFLAGS += -I$(hadoop_home)/include
|
|
|
67 |
AM_CPPFLAGS += $(BOOST_CPPFLAGS)
|
|
|
68 |
AM_CPPFLAGS += $(FB_CPPFLAGS) $(DEBUG_CPPFLAGS)
|
|
|
69 |
|
|
|
70 |
AM_LDFLAGS = $(BOOST_LDFLAGS) $(BOOST_SYSTEM_LIB) $(BOOST_FILESYSTEM_LIB)
|
|
|
71 |
|
|
|
72 |
# Section 3 #############################################################################
|
|
|
73 |
# GENERATE BUILD RULES
|
|
|
74 |
# Set Program/library specific flags recognized by automake.
|
|
|
75 |
# Use <progname|libname>_<FLAG> to set prog / lib specific flag s
|
|
|
76 |
# foo_CXXFLAGS foo_CPPFLAGS foo_LDFLAGS foo_LDADD
|
|
|
77 |
|
|
|
78 |
# Static -- multiple libraries can be defined
|
|
|
79 |
if STATIC
|
|
|
80 |
lib_LIBRARIES = libscribe.a
|
|
|
81 |
libscribe_a_SOURCES = gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp gen-cpp/scribe_constants.cpp
|
|
|
82 |
INTERNAL_LIBS = libscribe.a
|
|
|
83 |
endif
|
|
|
84 |
|
|
|
85 |
# Shared -- multiple libraries can be defined
|
|
|
86 |
if SHARED
|
|
|
87 |
shareddir = lib
|
|
|
88 |
shared_PROGRAMS = libscribe.so
|
|
|
89 |
libscribe_so_SOURCES = gen-cpp/scribe.cpp gen-cpp/scribe_types.cpp
|
|
|
90 |
libscribe_so_CXXFLAGS = $(SHARED_CXXFLAGS)
|
|
|
91 |
libscribe_so_LDFLAGS = $(SHARED_LDFLAGS)
|
|
|
92 |
INTERNAL_LIBS = libscribe.so
|
|
|
93 |
endif
|
|
|
94 |
|
|
|
95 |
# Binaries -- multiple progs can be defined.
|
|
|
96 |
bin_PROGRAMS = scribed
|
|
|
97 |
scribed_SOURCES = store.cpp store_queue.cpp conf.cpp file.cpp conn_pool.cpp scribe_server.cpp $(FB_SOURCES)
|
|
|
98 |
if USE_SCRIBE_HDFS
|
|
|
99 |
scribed_SOURCES += HdfsFile.cpp
|
|
|
100 |
endif
|
|
|
101 |
scribed_LDADD = $(EXTERNAL_LIBS) $(INTERNAL_LIBS)
|
|
|
102 |
|
|
|
103 |
if SHARED
|
|
|
104 |
scribed_DEPENDENCIES = libscribe.so
|
|
|
105 |
endif
|
|
|
106 |
|
|
|
107 |
# Section 4 ##############################################################################
|
|
|
108 |
# Set up Thrift specific activity here.
|
|
|
109 |
# We assume that a <name>+types.cpp will always be built from <name>.thrift.
|
|
|
110 |
|
|
|
111 |
$(eval $(call thrift_template,.,$(srcdir)/../if/scribe.thrift, -I $(fb303_home)/share/ --cpp --py --php))
|
|
|
112 |
|
|
|
113 |
if FACEBOOK
|
|
|
114 |
$(eval $(call thrift_template,.,$(smc_home)/if/ServiceManager.thrift,--cpp))
|
|
|
115 |
endif
|
|
|
116 |
|
|
|
117 |
BUILT_SOURCES = thriftstyle
|
|
|
118 |
|
|
|
119 |
# Section 5 [OPTIONAL] ##################################################################################
|
|
|
120 |
# Create user specific targets [ OPTIONAL]
|
|
|
121 |
|
|
|
122 |
# Overrides pre-existing target "all". Use only if required.
|
|
|
123 |
# all: <all-special>
|
|
|
124 |
|
|
|
125 |
# Add to pre-existing target clean
|
|
|
126 |
|
|
|
127 |
clean-local: clean-common
|
|
|
128 |
|
|
|
129 |
# Add to pre-existing target all:
|
|
|
130 |
#all-local: scribed
|
|
|
131 |
# @mkdir -p $(top_srcdir)/bin
|
|
|
132 |
# cp $(bin_PROGRAMS) $(top_srcdir)/bin
|
|
|
133 |
|
|
|
134 |
# Special targets.
|
|
|
135 |
#server-opt : $(BUILT_SOURCES) scribed
|
|
|
136 |
|
|
|
137 |
@GLOBAL_FOOTER_MK@
|