-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathMakefile.am
183 lines (159 loc) · 6.76 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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
lib_LTLIBRARIES = libeos.la
AM_CXXFLAGS = -fvisibility=hidden
AM_CXXFLAGS += $(EXTRA_CFLAGS)
AM_CXXFLAGS += -Wextra -Wall -Wnon-virtual-dtor -Werror -Wno-unused-parameter -Wno-error=unused-value -fPIC -fPIE -fvisibility-inlines-hidden
AM_LDFLAGS = -Wl,--no-undefined -fPIC -fPIE
PUBLISHED_HEADER_FILES := $(wildcard eos/*.h) $(wildcard eos/inline/*.h) $(wildcard eos/types/*.h) $(wildcard eos/inline/types/*.h)
nobase_include_HEADERS = $(PUBLISHED_HEADER_FILES)
EXTRA_DIST = MaybePrintProfilesAndExit.cpp $(wildcard examples/*) $(wildcard examples/test/*)
EXTRA_DIST += GetAgentProcessName.cpp
EXTRA_DIST += eos/version.h.template
if SHIPPING
SHIPPING_FLAG=-DSHIPPING
else
SHIPPING_FLAG=
endif
version.cpp: eos/version.h
eos/version.h: eos/version.h.template
cpp -traditional -I. -I/src/EosSdk $< [email protected]
cat [email protected] | sed 's#@@@@#/**#' | sed 's#@@@#*/#' | sed 's#@@#//#' | grep "^_-_" | sed 's/^_-_ //' | sed 's/^_-_//' | sed 's/pounddefine/#define/' > $@
libeos_la_SOURCES =
libeos_la_SOURCES += agent.cpp
libeos_la_SOURCES += acl.cpp
libeos_la_SOURCES += aresolve.cpp
libeos_la_SOURCES += aresolve_types.cpp
libeos_la_SOURCES += class_map.cpp
libeos_la_SOURCES += decap_group.cpp
libeos_la_SOURCES += directflow.cpp
libeos_la_SOURCES += directflow_types.cpp
libeos_la_SOURCES += eapi.cpp
libeos_la_SOURCES += eth_types.cpp
libeos_la_SOURCES += eth_intf.cpp
libeos_la_SOURCES += eth_lag_intf.cpp
libeos_la_SOURCES += eth_phy_intf.cpp
libeos_la_SOURCES += event_loop.cpp
libeos_la_SOURCES += exception.cpp
libeos_la_SOURCES += fd.cpp
libeos_la_SOURCES += hardware_table.cpp
libeos_la_SOURCES += intf.cpp
libeos_la_SOURCES += intf_types.cpp
libeos_la_SOURCES += impl.cpp impl.h
libeos_la_SOURCES += ip.cpp
libeos_la_SOURCES += ip_types.cpp
libeos_la_SOURCES += ip_intf.cpp
libeos_la_SOURCES += ip_route.cpp
libeos_la_SOURCES += fib.cpp
libeos_la_SOURCES += iterator.cpp
libeos_la_SOURCES += macsec.cpp
libeos_la_SOURCES += mac_table.cpp
libeos_la_SOURCES += mlag.cpp
libeos_la_SOURCES += mpls.cpp
libeos_la_SOURCES += mpls_route.cpp
libeos_la_SOURCES += mpls_vrf_label.cpp
libeos_la_SOURCES += nexthop_group.cpp
libeos_la_SOURCES += panic.cpp
libeos_la_SOURCES += neighbor_table.cpp
libeos_la_SOURCES += policy_map.cpp
libeos_la_SOURCES += policy_map_types.cpp
libeos_la_SOURCES += route_map.cpp
libeos_la_SOURCES += sdk.cpp
libeos_la_SOURCES += SdkImpl.cpp SdkImpl.h
libeos_la_SOURCES += subintf.cpp
libeos_la_SOURCES += system.cpp
libeos_la_SOURCES += timer.cpp
libeos_la_SOURCES += tracing.cpp
libeos_la_SOURCES += version.cpp
libeos_la_SOURCES += vrf.cpp
libeos_la_SOURCES += bfd.cpp
libeos_la_SOURCES += bgp.cpp
libeos_la_SOURCES += bgp_path.cpp
libeos_la_SOURCES += lldp.cpp
libeos_la_SOURCES += xcvr.cpp
libeos_la_SOURCES += nexthop_group_tunnel.cpp
# Add in auto generated X_gen.cpp files too.
libeos_la_SOURCES += acl_gen.cpp
libeos_la_SOURCES += bfd_gen.cpp
libeos_la_SOURCES += bgp_path_gen.cpp
libeos_la_SOURCES += bgp_gen.cpp
libeos_la_SOURCES += class_map_gen.cpp
libeos_la_SOURCES += decap_group_gen.cpp
libeos_la_SOURCES += directflow_gen.cpp
libeos_la_SOURCES += eapi_gen.cpp
libeos_la_SOURCES += eth_lag_intf_gen.cpp
libeos_la_SOURCES += eth_phy_intf_gen.cpp
libeos_la_SOURCES += fib_gen.cpp
libeos_la_SOURCES += hardware_table_gen.cpp
libeos_la_SOURCES += intf_gen.cpp
libeos_la_SOURCES += ip_route_gen.cpp
libeos_la_SOURCES += ip_gen.cpp
libeos_la_SOURCES += lldp_gen.cpp
libeos_la_SOURCES += macsec_gen.cpp
libeos_la_SOURCES += mac_table_gen.cpp
libeos_la_SOURCES += mpls_route_gen.cpp
libeos_la_SOURCES += mpls_vrf_label_gen.cpp
libeos_la_SOURCES += neighbor_table_gen.cpp
libeos_la_SOURCES += nexthop_group_tunnel_gen.cpp
libeos_la_SOURCES += nexthop_group_gen.cpp
libeos_la_SOURCES += policy_map_gen.cpp
libeos_la_SOURCES += route_map_gen.cpp
libeos_la_SOURCES += structured_filter_gen.cpp
libeos_la_SOURCES += subintf_gen.cpp
libeos_la_SOURCES += vrf_gen.cpp
libeos_la_CPPFLAGS = $(AM_CPPFLAGS) $(SHIPPING_FLAG) -fPIC -fPIE
libeos_la_LDFLAGS = -version-info $(SDK_LIBTOOL_VERSION) -lrt
libeos_la_LDFLAGS += -soname libeos.so.$(SDK_VERSION_MAJOR).$(SDK_VERSION_MINOR)
noinst_PROGRAMS = HelloWorld
HelloWorld_SOURCES = examples/HelloWorld.cpp
HelloWorld_LDADD = libeos.la
HelloWorld_CPPFLAGS = -fPIE
# --------- #
# SWIG libs #
# --------- #
if USE_PYTHON
SWIG_FILES := EosSdk.i SwigUtils.i Includes.i SwigRenamer.py swig.patch
python_PYTHON = $(srcdir)/eossdk.py
pyexec_LTLIBRARIES = _eossdk.la
_eossdk_la_SOURCES = $(srcdir)/eossdk_wrap.cpp $(srcdir)/eossdk_wrap.h
_eossdk_la_LDFLAGS = -avoid-version -module
# Swig generated code produces some warnings, depending on the combination of
# Python version and GCC version, so we turn the problematic ones off here as
# we build with -Werror:
_eossdk_la_CXXFLAGS = $(AM_CXXFLAGS) -Wno-strict-aliasing -Wno-missing-field-initializers
_eossdk_la_CXXFLAGS += -Wno-error=maybe-uninitialized -Wno-error=unused-function
_eossdk_la_CPPFLAGS = -I/usr/include/python$(PYTHON_VERSION)
_eossdk_la_LIBADD = libeos.la
$(srcdir)/eossdk_wrap.cpp: $(SWIG_FILES) $(nobase_include_HEADERS) $(srcdir)/eossdk_wrap.cpp
SRCDIR=$(srcdir) prefix [stubs-swig] $(SWIG) -threads -c++ -python -py3 -dirvtable -O -I$(srcdir) -o $@-t $(srcdir)/EosSdk.i
patch --batch --no-backup-if-mismatch -p0 <$(srcdir)/swig.patch
mv $@-t $@
sed 's/#define PyString_AS_STRING.x. PyUnicode_AS_STRING.x./#define PyString_AS_STRING(x) PyBytes_AS_STRING(x)/' -i eossdk_wrap.cpp
$(srcdir)/eossdk_wrap.h: $(srcdir)/eossdk_wrap.cpp
$(srcdir)/eossdk.py: $(srcdir)/eossdk_wrap.cpp
GO_SWIG_FILES := GoEosSdk.i Includes.i SwigRenamer.py
stubsgosrcdir = $(srcdir)/go/src/eossdk
$(srcdir)/eossdkgo_wrap.cpp: $(GO_SWIG_FILES) $(nobase_include_HEADERS)
SRCDIR=$(srcdir) prefix [stubs-swig] $(SWIG) -c++ -cgo -go -intgosize 32 -O -I$(srcdir) -o $@-go $(srcdir)/GoEosSdk.i
mv $(srcdir)/$@-go $@
$(stubsgosrcdir)/eossdkgo_wrap.cpp: $(srcdir)/eossdkgo_wrap.cpp
$(MKDIR_P) $(stubsgosrcdir) && mv $< $@
$(stubsgosrcdir)/eossdkgo_wrap.h: $(srcdir)/eossdkgo_wrap.cpp
$(MKDIR_P) $(stubsgosrcdir) && mv $(srcdir)/$(@F) $@
$(stubsgosrcdir)/eossdk.go: $(stubsgosrcdir)/eossdkgo_wrap.cpp
patch --batch --no-backup-if-mismatch -p0 <$(srcdir)/swig-go.patch
$(MKDIR_P) $(stubsgosrcdir) && mv $(srcdir)/$(@F) $@
BUILT_SOURCES = $(_eossdk_la_SOURCES)
GO_SRC_FILES = $(stubsgosrcdir)/eossdkgo_wrap.cpp $(stubsgosrcdir)/eossdkgo_wrap.h $(stubsgosrcdir)/eossdk.go
MAINTAINERCLEANFILES = $(BUILT_SOURCES)
endif
ACLOCAL_AMFLAGS = -I autogen
EXTRA_DIST += bootstrap build.sh $(SWIG_FILES) $(GO_SWIG_FILES)
EXTRA_DIST += LICENSE
EXTRA_DIST += ltmain.patch
EXTRA_DIST += $(GO_SRC_FILES)
EXTRA_DIST += Dockerfile
dist-hook:
chmod -R u+w $(distdir)
$(MKDIR_P) $(srcdir)/$(stubsgosrcdir)
install-exec-hook:
-echo "add major.minor link for stubbed libeos"
cd .libs; ln -sf libeos.so.$(SDK_VERSION_MAJOR).$(SDK_VERSION_MINOR).$(SDK_VERSION_PATCH) libeos.so.$(SDK_VERSION_MAJOR).$(SDK_VERSION_MINOR);