Project

General

Profile

Statistics
| Branch: | Revision:

gdp-if / tensorflow / Makefile @ master

History | View | Annotate | Download (1.35 KB)

1
CXX = g++
2
LN = ln
3
RANLIB = ranlib
4

    
5
GDPDIR = ../../gdp/
6

    
7
# Following flags are automatically generated from  tensorflow install
8
TF_CFLAGS = $(shell python -c 'import tensorflow as tf; \
9
					print(" ".join(tf.sysconfig.get_compile_flags()))' || \
10
				echo '-I/usr/local/lib/python2.7/dist-packages/tensorflow/include -D_GLIBCXX_USE_CXX11_ABI=0')
11
TF_LDFLAGS = -L$(shell python -c 'import tensorflow as tf; \
12
					print(tf.sysconfig.get_lib())' || \
13
					echo '/usr/local/lib/python2.7/dist-packages/tensorflow')
14

    
15
TF_LIB = -ltensorflow_framework
16

    
17
LDFLAGS = \
18
		-L$(GDPDIR)libs \
19
		-L/usr/local/lib
20

    
21
LDLIBS = -lgdp -lep -luuid -pthread -lprotobuf -lpthread -luuid
22

    
23
INCFLAGS = -I$(GDPDIR)
24
# CXXFLAGS = -g -std=c++11 $(INCFLAGS) -fPIC $(TF_CFLAGS)
25
CXXFLAGS = -g -std=c++11 $(INCFLAGS) -fPIC
26

    
27
HFILES = \
28
		gdpfs.h \
29
		gdpfs_tf.h
30

    
31
SRCS_COMMON = \
32
		GDPfs.pb.cc \
33
		gdpfs.cc
34

    
35
SRCS_TFLIB = gdpfs_tf.cc
36

    
37
SRCS_CMD = gdpfs_cmd.cc
38

    
39
all: GDPfs.pb.h gdpfs_cmd gdpfs_tf.so
40

    
41
$(HFILES): GDPfs.pb.h
42

    
43
## override built-in rule
44
%.o: %.cc $(HFILES)
45

    
46
gdpfs_tf.so: $(SRCS_TFLIB) $(SRCS_COMMON)
47
	$(CXX) $(CXXFLAGS) $(TF_CFLAGS) -shared $^ -o $@ $(LDFLAGS) $(LDLIBS) $(TF_LDFLAGS) $(TF_LIB)
48

    
49
gdpfs_cmd: $(SRCS_CMD) $(SRCS_COMMON)
50
	$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LDLIBS)
51

    
52
GDPfs.pb.h: GDPfs.proto
53
	protoc --cpp_out=. GDPfs.proto
54

    
55
clean:
56
	rm -f GDPfs_pb2.py GDPfs.pb.h GDPfs.pb.cc gdpfs_cmd *.o *.so
57