forked from dmlc/ps-lite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (36 loc) · 971 Bytes
/
Makefile
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
ifdef config
include $(config)
endif
include make/ps.mk
ifndef CXX
CXX = g++
endif
ifndef DEPS_PATH
DEPS_PATH = $(shell pwd)/deps
endif
ifndef PROTOC
PROTOC = ${DEPS_PATH}/bin/protoc
endif
INCPATH = -I./src -I./include -I$(DEPS_PATH)/include
CFLAGS = -std=c++11 -msse2 -fPIC -O3 -ggdb -Wall -finline-functions $(INCPATH) $(ADD_CFLAGS)
include make/deps.mk
all: ps
clean:
rm -rf build $(TEST) tests/*.d
find src -name "*.pb.[ch]*" -delete
lint:
python2 tests/lint.py ps all include/ps src
ps: build/libps.a
OBJS = $(addprefix build/, customer.o postoffice.o van.o meta.pb.o)
build/libps.a: $(OBJS)
ar crv $@ $(filter %.o, $?)
build/%.o: src/%.cc ${ZMQ} src/meta.pb.h
@mkdir -p $(@D)
$(CXX) $(INCPATH) -std=c++0x -MM -MT build/$*.o $< >build/$*.d
$(CXX) $(CFLAGS) -c $< -o $@
src/%.pb.cc src/%.pb.h : src/%.proto ${PROTOBUF}
$(PROTOC) --cpp_out=./src --proto_path=./src $<
-include build/*.d
-include build/*/*.d
include tests/test.mk
test: $(TEST)